Sub workflows and extended properties on child jobs from parent

2542
4
08-03-2011 08:02 PM
FraserHand
Occasional Contributor III
Hi There,
I'm using WFM 10 SP2 and have the following questions based on the fact that we want to do as much as possible through configuration rather than customisation.
We have a massive create job, design and build workflow which is one encompassing workflow with several sub processes within it.
1) I can't see how you can embed a workflow within another, so we are using child jobs to simulate that - is the correct way of doing this?
2) when creating a child job, I need to set certain properties based on values from the parent job - I can't see an easy way of doing that - I have found a execute SQL custom step - but I can't exec SQL against the prop tables as I need to be able to generate an OBJECTID. What's the best way to approach this?
Thanks,
Fraser
0 Kudos
4 Replies
TopeBello
Occasional Contributor III
Hi,

There is a sample step that might address some of your needs that we include as part of the SDK. It will be at <install location>\Developer Kit\Samples\CustomSteps\CreateChildJobsAdvanced
This step allows you to create a child job that inherits a lot of properties from the parent like AOI, extended properties, basic properties and more. It also allows you to model dependencies on these jobs and the parent job.

I will recommend that you explore this step and see if it meets your needs. You may still have to use the execute SQL for your updates because the extended properties are created after a job is created. So updating a field there has to be a post job creation operation.
Here is an example of what an update to an extended properties field will look like using the SQL step:

/database:jtxsystem /sql:"update  EXTPROPTable.Field ....where ..."

The main point there is that the table you are updating must be in the same repository as the system tables or in the data workspace.

Does this make sense?

Thanks,
Tope
0 Kudos
FraserHand
Occasional Contributor III
Hi Tope,
Thanks for that - I had seen that sample and have looked at the code - I'll take a closer look and see if it will meet my requirements. So does this mean that the overall parent job will need a workflow which creates the required children jobs by calling this custom step?
Thanks,
Fraser
0 Kudos
TopeBello
Occasional Contributor III
Yes, there will be a step in the parent workflow that will run this custom step to create the child job(s). At 10.1, you will be able to run a workflow from a step in another workflow. This is ultimately what you want to achieve.

Thanks,
Tope
0 Kudos
FraserHand
Occasional Contributor III
Hi Tope,
That sample will do nicely - thanks. I'm going to extend it to take multiple extended properties but that looks fairly trivial to do.
Thanks for the reply and suggestion - much appreciated.
Fraser
0 Kudos