Claus_Jambrich_5663

Scripting Break Points in Workflows

Discussion created by Claus_Jambrich_5663 on Aug 8, 2017
The documentation gives an example of how to set breakpoints via MODIFY_TASK, but how can you set up a working example?

You have a workflow with two tasks.

18oahg9qtjzx.png

The first task, FILE.INPUT.1 is a windows job just executing a ping for 1 minute. The code to set a breakpoint from our documentation I put into script SCRI.BREAK:

qc3wmby78pic.png

The breakpoint will be set on the second task, FILE.INPUT.2. Now run the workflow, open its monitor and watch the activity window:

7yct2sppp8i4.png

The first task (status active) is running, the second one is waiting for predecessor, and the complete workflow is in status active. Now run SCRI.BREAK. It does the following:
  1. Get the current RunId of the workflow MM.DAY
  2. Stop this workflow to modify it. Modifications on a running workflow can only be done when it is stopped. All currently running task will finish, but no new tasks will start in this state.
  3. Set a breakpoint for FILE.INPUT.2.
  4. Commit this change.
  5. Set the workflow to GO again to continue processing.
After SCRI.BREAK has finished, monitor and activity window show:

hoc0ew70l5if.png

The status of the workflow is active again. The switch to stopped and go again is so quick, you don’t see it in the activity window. The first task is still running (still green), the second task is now marked yellow. I.e. it has a breakpoint set and processing will be paused there.

As soon as task one finishes, you see:

1gdy1nwvyhbd.png

The first task ended ok, the second task is still waiting for predecessor and the workflow is in status blocked because of the breakpoint set to FILE.INPUT.2. No processing is done in the moment. To start the processing again, right klick on FILE.INPUT.2 in the monitor and select Modify task, Go immediately:

5jnsyod0su3t.png

You are asked

U4006563 Do you really want to modify this task?

and after confirming

U0011523 Runtime modification: Task 'FILE.INPUT.2' (RunID '0002074476') was immediately started by user 'JAC/SUP'.
Is displayed. Now FILE.INPUT.2 runs and the workflow finishes.

krfsxq6j6z1j.png

Outcomes