Move a file to a different folder once it moves through a state in PDME

I am wanting to move competed Engineering Change forms to a folders labeled complete once they have reached a certain state in the workflow. That way the only files in the original folder are files that are currently being changed. Is there a way to do this?SolidworksSolidworks Pdm enterprise Pdm
Answers 7
SF
SF 2010-01-18 Best Answer

You can accomplish this by using Dispatch.  The only problem I have found doing it this way is that there is no 'move' command built in. Instead you have to use the 'copy' command and the the 'delete' command before checking the 'moved' file in. When using this approach you lose the history on the file   This may or may not be a big deal to you.  I am working on some custom executables using the API to see if I can come up with a cleaner way of accomplishing the file movement so that the history is maintained. If you choose to try Dispatch you will more than likely create a script with the following sequences

Check  the box labeled 'During state transition' and then click the Conditions box right next to it to select the workflow state you want the event to trigger on. Then you will add the following commands.

FOR ALL DOCUMENTS

CREATE FOLDER

COPY FILE

DELETE FILE  <-- The original that you made the copy from

CHECK IN FILE

END FOR ALL DOCUMENTS

You will also want to press the variables button and set variables to move the card data you are wanting to transfer as well.

MD
MD 2010-01-20

You can do this using the Enterprise PDM API. Look in the Programmer's Reference Guide under IEdmFile6::Move for an example.

Mike

EPDM 2009 SP3

SF
SF 2010-03-01
I did find the sample code but I am not sure where to go from there.
JS
JS 2010-03-03
If you decide you want to use the API, you are looking at creating a custom addin...typicall through .NET.
AM
AM 2010-03-08
You could try using the Shell Execute command to move the file.  You shoud be able to keep the history if you can move the file and not paste it.
SF
SF 2010-03-10
I did do that with the help of Robin at API support. Yet I am getting a significant slow down when typing in a PDM search. Any ideas?
CS
CS 2013-03-19

I tried using the Shell Execute, and it resulted in a new file in the destination folder. Not entirely sure why.

Craig Sink