patve03

How to Replace jobs dynamically in For Each Workflow

Discussion created by patve03 Employee on Jun 28, 2018
Latest reply on Jul 24, 2018 by patve03

Hello Team,

 

Can we replace jobs dynamically in a For-Each Workflow?

I have created a for each workflow and want to place one unix job inside it.

I am curious to know can we replace the single job dynamically based on the selection of job in a promptset.

 

I tried using Modify_task in the script object and activated the workflow but it didn't replace the task at run time. Please find the script written in the script object.

 

:SET &ACTOBJ# = ACTIVATE_UC_OBJECT(JOBP.ORCHESTRA)

:SET &TNR# = GET_UC_OBJECT_NR("JOBP.ORCHESTRA")

:SET &RETSTOP# = MODIFY_TASK(&TNR#, STOP_MODIFY)

:SET &RET# = MODIFY_TASK(&TNR#, "JOBS.UNIX.NEW.1",, REPLACE_TASK, "JOBS.UNIX.NEW.2", EXTERNAL) :SET &RETCOMMIT# = MODIFY_TASK(&TNR#, COMMIT) :SET &RETGO# = MODIFY_TASK(&TNR#, GO)

 

And I noticed this statement in the activation report of the script object.

U00011107 Task 'JOBP.ORCHESTRA' ('0001037021') is not stopped - GO not possible.

 

Please let me know where did I go wrong?

 

Thanks,

Srujan

Outcomes