Child job stop the overall process until complete

3393
4
11-12-2010 10:49 AM
EdwardCopeland
New Contributor
I have successfully been able to create a child job in my workflow but I would then like to have that child job assigned to the current user and completed before continuing on.  What i am doing is providing more detailed steps and another workflow within the overall workflow.

My problem is that it creates the new child job but I am unable to assign it and embed it into the existing workflow correctly.  I think if i wanted to I go into model builder and build all of this but would rather use the WMX because I can see more uses for this workflow.

I attached a workflow with what I am trying to explain in words.  Any ideas would be greatly appreciated.

Ed
0 Kudos
4 Replies
BrianDemers
Esri Contributor
Ed,

I think the closest you can get to what you describe is to:

  1. Create the child job

  2. Assign the child job to the correct user/group

  3. Add a dependency to the parent job


From the "Dependencies" tab in Workflow Manager, you can make the parent job hold at a particular step until the child job has reached a specific step or status.

If this approach works for you, then one other suggestion:

Regarding the child job assignment: To assign the child job to the current user as you describe, you should be able to use the "/assignuser" argument to "Create Job", along with a Workflow Manager token.  Simply add the following to that step's argument string: /assignuser:[JOB:ASSIGNED_TO]

Hope this helps...

Brian D.
0 Kudos
EdwardCopeland
New Contributor
Thanks Brian,

This did work for me but I am looking to find a way automate the the dependency. In my workflow I have automated the creation of the child job which gets assigned to the current user using the token you provided and would like to somehow pass the job ID and automate the dependency as well so the user can not go to the next step without finishing the child job first.

Thanks again,

Ed
0 Kudos
BrianDemers
Esri Contributor
Makes sense.  One more idea, though I don't know if this is practical in your case.

With 10.0, there are a handful of sample custom steps written in C# and provided with Workflow Manager Desktop under "<Workflow Manager Install Dir>\Developer Kit\Samples\CustomSteps".  One of the steps is called "CreateChildJobsAdvanced", and a quick look through the code seems to show that it might support adding dependencies like you describe.  All of these samples should build out of the box, so if you have Visual Studio 2008 and some familiarity with it, you may want to try to:

  1. Build this custom step

  2. Create a Workflow Manager step that uses the "CreateChildJobsAdvanced" custom step

  3. Add the Workflow Manager step to a workflow, and see if it does what you need


If you do go down this path and it seems to be working, then one last thought: the custom step will register automatically on the machine where it's built, but you may want to refer to the help for the ESRIRegAsm utility if you'll need to deploy this to multiple PCs. (See here.)

Good luck!

Brian D.
0 Kudos
BrianDemers
Esri Contributor
If you do go down this path and it seems to be working, then one last thought: the custom step will register automatically on the machine where it's built, but you may want to refer to the help for the ESRIRegAsm utility if you'll need to deploy this to multiple PCs. (See here.)


I just realized that I got my registration mechanisms mixed up: anyone looking to use the "CreateChildJobsAdvanced" step mentioned above would want to use the standard .NET "regasm" command to register its DLL on other machines, not "ESRIRegAsm".  Sorry if that misled anyone.
0 Kudos