All -
I'm wondering if anyone knows how to restrict a document to only numbers at time of check-in. For example the PDM would allow a part named 1111111.sldprt but reject aaaaaaaaa.sldprt. It would also have to reject a combination file name like 111111aaaaaa.sldprt. I attempted to use the operators found here but it did not seem to work and the results were sporadic. I am using PDM Standard. Thanks for the help.
SolidworksSolidworks Pdm enterprise Pdm
Andrew,
The conditional operators in the properties of a worflow only apply to the first ever check in of a file. Once the file is in the workflow it has passed that 'gate' and won't be compared to those operators again.
If you were using PDM Professional you would be able to do your file name check with Dispatch or the API and then prevent login.
However with PDM Standard we don't have those options so I don't think we can prevent the check in. That doesn't stop us preventing all state changes however. If we add a transition condition as per the image below this will prevent files that have a non numeric character in their name transitioning:
To break down the string I used:
%\ = any folder in the vault
%[a-z]% = A filename of unknown length that contains a character in the range a-z (in either upper or lower case)
.sld% = any SOLIDWORKS file extension
I would add this transition condition when the files leave an editable state (so users would no longer have permission to rename files) and although they can check any file in they wouldn't be able to send a file with an incorrect name for approval.
I suppose you could also add this condition to your workflow properties to prevent the first check in unless the files are named correctly. This wouldn't stop someone checking the file in, then renaming, and sending for approval though.
David
That's a great breakdown. Didn't know about those operators. Wish I knew this before I built Three Minute Thursday video on Workflow Conditions. Great stuff!!
SolidWorks PDM Workflow Conditions – Checks and Validation - YouTube
Well, I think that I managed to get to the bottom of this question. Per David's suggestion I set these conditions in the workflow properties because that was the best fit for my need.
What I did was use (2) OR statements. The first one denied letters a-z unless checking into a specific directory (ie: PURCHASED PARTS). the second OR statement checked a variable for our part numbering system that had to fall between two ranges. I'm not sure if this is the easiest way to get this working or if there is redundant information in there, but it seems to be working. Hopefully this helps someone out.