cancel
Showing results for 
Search instead for 
Did you mean: 

Redwood Scripting - Schedule detached job

0 Kudos

Hello,

I would like to script the scheduling of a process definition.
I have used the basic standard method inside a Redwood Script process definition, like so:

JobDefinition jd = jcsSession.getJobDefinitionByName("MyJD");
Job job = jd.prepare();
job.setSubmitFrame(jcsSession.getSubmitFrameByName("MySubmitFrame"));

jcsSession.persist();

However, this leaves the prepared & submitted child job attached as a child job to this current Redwood Script job.
What I am looking for is a way to create a detached job, just like you would get if you were to manually submit a process definition from the GUI.

How can I go about this? Is it even possible?

Many thanks.

Darryl

Accepted Solutions (1)

Accepted Solutions (1)

gmblom
Active Contributor
0 Kudos

hi Darryl,

add job.setParentJob(null) to detach it from the parent.

Regards Gerben

0 Kudos

This worked as described. Brilliant, thanks.

Answers (0)