Setting or clearing custom property when adding files to vault
-
- Posts: 9
- Joined: Fri Sep 30, 2022 11:49 am
- x 1
Setting or clearing custom property when adding files to vault
I have the Copy Tree tool setup to clear and set certain variables (custom properties) when a user copies a design. If a user does a standard 'Save As' in SOLIDWORKS, the new file(s) will get a new filename (based on Serial# counter) but custom properties carry over from the original file. There are certain custom properties that I would like to reset or clear, such as the 'Date' and 'Designer'. What would be the best way to handle this in PDM?
Re: Setting or clearing custom property when adding files to vault
The way I've managed this in the past is to have an initial state that the workflow starts in where I don't care what properties are on that file. There is an automatic transition from that initial state to the "Editable" state that wipes/sets the custom properties as needed and the "Overwrite Version" option is checked on that transition.
This way, the initial state with bad custom properties essentially never existed.
This way, the initial state with bad custom properties essentially never existed.
-
- Posts: 9
- Joined: Fri Sep 30, 2022 11:49 am
- x 1
Re: Setting or clearing custom property when adding files to vault
We actually have an automatic transition like you mentioned but that doesn't trigger until the user checks in the file. After a Save As, the data card is displayed. If the user sets variables, then checks in, the variables would then get cleared - losing what they have entered. Many times, the user doesn't edit the variables that I want to clear (like Date and Designer), so I would like to do this automatically. But if they happen to enter correct data after Save As, I do not want the variables to get cleared. Do you trigger than automatic transition before the user even sees the data card?AlexB wrote: ↑Tue Nov 14, 2023 2:23 pm The way I've managed this in the past is to have an initial state that the workflow starts in where I don't care what properties are on that file. There is an automatic transition from that initial state to the "Editable" state that wipes/sets the custom properties as needed and the "Overwrite Version" option is checked on that transition.
This way, the initial state with bad custom properties essentially never existed.
Re: Setting or clearing custom property when adding files to vault
It's essentially triggered when the user first checks the file in. Due to the limitations you mentioned, our process dictates that adding a file to PDM requires it to be checked in at least one time before working on it due to this automatic transition.starshiphalo2333 wrote: ↑Tue Nov 14, 2023 3:09 pm Do you trigger than automatic transition before the user even sees the data card?
Re: Setting or clearing custom property when adding files to vault
The automatic transition at the start does work well from my experience but as mentioned requires users to first check files in, then out again before they can be worked on however I have found discipline in this regard to be poor.
I set the "Default Value" category in the data card editor to "special value -> clear existing value" a lot for clearing unwanted fields. I find that this allows users to work without first checking the file in then deals with those variables when they get around to the initial check in.
This doesn't work for dates however I prefer to set date drawn after the initial editing transition instead of when the files are created but that's personal preference.
I set the "Default Value" category in the data card editor to "special value -> clear existing value" a lot for clearing unwanted fields. I find that this allows users to work without first checking the file in then deals with those variables when they get around to the initial check in.
This doesn't work for dates however I prefer to set date drawn after the initial editing transition instead of when the files are created but that's personal preference.
Re: Setting or clearing custom property when adding files to vault
in tree copy you could set up the automatic check in from the registry. then automatic first transition to clean all your variables. minimal effort from user pov
-
- Posts: 9
- Joined: Fri Sep 30, 2022 11:49 am
- x 1
Re: Setting or clearing custom property when adding files to vault
Copy Tree is setup to clear and set these variables based on the user performing the Copy Tree and the date the file was copied. I am looking for ways to clear/set these variables if a user manually does a Save As in SOLIDWORKS.
I am curious though, what do you mean by "automatic check in from registry" ? Part of the Copy Tree process is for the user to check the box 'Check-in on Copy' but some users forget to check that box.
Re: Setting or clearing custom property when adding files to vault
I force that setting with the registry for every pdm installation so the user does not have to remember the checkin box
- jcapriotti
- Posts: 1869
- Joined: Wed Mar 10, 2021 6:39 pm
- Location: The south
- x 1214
- x 1999
Re: Setting or clearing custom property when adding files to vault
This is the way. If you don't clear those values on first add to vault, they will forever be in the history. Especially critical for some variables like "Part Number" when searching with the "All versions" checkbox.ReeceB wrote: ↑Tue Nov 14, 2023 4:15 pm The automatic transition at the start does work well from my experience but as mentioned requires users to first check files in, then out again before they can be worked on however I have found discipline in this regard to be poor.
I set the "Default Value" category in the data card editor to "special value -> clear existing value" a lot for clearing unwanted fields. I find that this allows users to work without first checking the file in then deals with those variables when they get around to the initial check in.
Jason