Deleting Versions in a workflow

3746
7
01-05-2012 11:45 AM
TimJacobsen
New Contributor III
I am having an issue with the custom clean up step in WMX.  We have circumstances where at a database level versions created in WMX and pertaining to jobs are deleted.  In "clean up" We have arguments/v /m and they work fine, except when versions are deleted at a database level.  In that case an error message of "An error occurred while trying to execute this step.Version not found[VersionNameHere]" appears when executing a clean up step.  At this point we go into the jtx.jtx_jobs table and close the jobs manually.  To solve this I would like separate the m/ and v/ agruments into separate steps.  In the custom steps the argument for deleting a version is only in the "clean up" step as far as i'm aware.  I don't think putting in two clean up steps would be wise, so I need a to create a workflow step that deletes versions.  Any suggestions??
0 Kudos
7 Replies
BrianDemers
Esri Contributor
Hi Tim,

I believe there's an outstanding issue with Workflow Manager and the Clean Up step in certain cases.  If you close Workflow Manager after the step fails, then restart it and re-run the step, does the step then run successfully?  (This obviously isn't a great workaround, but it might at least confirm whether you're seeing the same issue or a different one.)

Brian D.
0 Kudos
AshleyMott
New Contributor III
If I understand your problem correctly, I would suggest utilizing the "Check Version" step first: JTXSteps.VersionExists Then if version exists, the workflow could advance to a step that cleans up both: /v /m If the version has been deleted, the workflow would advance to a clean up step for map only: /m

In my workflows, I use a "Clean Up Map" and "Clean Up Version" steps that are completely seperate from one another and haven't experienced any issues.
0 Kudos
TimJacobsen
New Contributor III
@ Brian -  I think our were seeing a different issue.  When I close Workflow Manager after the step fails, then restart it and re-run the step the same error message reoccurs. 
@ Ashley - Thank you for confirming it is ok to run two clean up steps!  Previously we had "clean up" with /v /m as our last step and it closed jobs, since it was the last step I imagine.  I wasn't sure where the line between the functionality of the "clean up" step and "Close Job" was.  E.g. when I threw two "clean up" steps in a workflow (one being the last step in the workflow)  without a close job step the jobs would not close. I was able to implement the check version with multiple clean steps, a close Job step, and it works great!  Again, Thanks!
0 Kudos
JeremyMirmelstein
Esri Contributor
Hey Tim,

Hope things are going well for you and the team.  Here's some additional insight. 

The CleanUp step that comes with WMX has three arguments: /v /m /a.  These are all optional and represent the cleanup of the job version, the mxd, and the attachments.  You could have three separate cleanup steps that removes each of these items separately if you wanted to. 
  
It is important to be careful with using the VersionExists step.  This step does not actually look and see if there is a database version in your Data Workspace.  Instead, it looks at the WMX tables in order to determine if WMX is aware of a Job Version.  If you delete a job's version using the CleanUp step, WMX will automatically become aware that the Job's Version no longer exists.  However, if you delete the Job Version using ArcCatalog, WMX is not aware and the VersionExists steps will still return 'True'. 

So far as closing jobs is concerned, there is a WMX System Setting to automatically close jobs when the workflow is complete.  This is set on by default: 
[ATTACH=CONFIG]11228[/ATTACH]

Best,
Jeremy
0 Kudos
DanielJohns
Occasional Contributor
Question, during the 'CleanUp' step is it posting changes to the parent version or is it only deleting the child version that was created?

Thank you,
Daniel
0 Kudos
by Anonymous User
Not applicable
Hi Daniel,

Clean up does not post the child version back to the parent, it deletes the current job version, job map document and job attachments based on the arguments specified.

We will be posting a model builder example to http://resources.arcgis.com/en/communities/workflow-manager/ this month though that can be used to post the job version back to the parent, so please keep an eye out for that.

Cheers,
Michael
0 Kudos
DanielJohns
Occasional Contributor
Hi Daniel,

Clean up does not post the child version back to the parent, it deletes the current job version, job map document and job attachments based on the arguments specified.

We will be posting a model builder example to http://resources.arcgis.com/en/communities/workflow-manager/ this month though that can be used to post the job version back to the parent, so please keep an eye out for that.

Cheers,
Michael


Great, thank you.
0 Kudos