Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Invoking a Nested Job using <jobfile>
sleepyd
I'm writing a workflow that will invoke a nested job. That nested job will be identified by a job specification file (using the <jobfile> attribute of the <wftask> task definition). I'm using a job specification file in order to avoid requiring the user to explicitly invoke the job -- I need the job to be invoked automatically.
I'm having trouble specifying the name of the <jobfile>. I can't use a single, hard-coded name here, because the job specification file will be generated on-the-fly by an externaltask in the parent workflow. That external task will write the job specification file out to the filesystem using a naming convention like "nested_wf_name.workflow_id".
Since I don't know the name of the generated job specification file at the time the parent workflow is instantiated, I am unable to configure the <jobfile> tag correctly such that it can locate the generated job specification file.
QUESTION:
Is there any system variable, POST/GET variable, or TAG that I can use in the definition of the parent workflow that will give me that workflow's ID? (Or is the ID not assigned until after the instantiation is already complete?)
Find more posts tagged with
Comments
Migrateduser
Your parent job will be assigned its ID when it is invoked, so you won't have that until its job spec is created. And you can't arbitrarily change any data in your job spec once it's created, unless it's one of the canned items there is a CLT for (like owner, timeout, etc.). So your jobfile name must be hardcoded at the time you define your parent job spec file, within the parent wft. That doesn't mean you can't be creative and figure out a way to make the job spec filename unique for your nested job. You could use a stored unique number that you read and increment each time the job is executed and save that unique number in a workflow variable in your parent job. Then you can define the name of the jobfile using that unique number embedded in the filename, and you can pass that number to your externaltask that builds the child job spec. That's one idea - I have a feeling it's not the best approach though.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
sleepyd
I was afraid you'd say that...
I guess I'll just have to explore pre-generating some unique id when the parent workflow is instantiated.
Thanks, Smitty77, for your help.