Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 4 Using Graft Steps : How Does a Graft Step Work?

How Does a Graft Step Work?
Graft steps are similar to dynamic calls to multiple sub-procedures, but the difference is that the sub-processes are started from an external application and then attached to a specific point in the procedure using the graft step.
When defining a graft step, you have to use a sub-procedure parameter template so that the output mappings are defined for any sub-processes that are started by the application. There are no input parameter definitions required because the external application starts the sub-processes with the case data. This is provided as part of a TIBCO iProcess Objects call sending the sub-procedure fields as name/value pairs.
You place a graft step on your main procedure at the point where you require any external processes or iProcess sub-procedures to be attached. When all the sub-processes have completed, the case data will be transferred to the main procedure according to the output parameter mappings. Even if a non-iProcess process has been started by the application, the graft step will not be complete until that process has completed.
iProcess uses a task count as the protocol between the external application and the TIBCO iProcess Engine to determine how many processes are associated with a graft step. When the task count has been defined by the external application, iProcess knows how many processes need to be completed before the graft step can be released. See Graft Step Task Count for more information about the task count.
Graft Step Task Count
For a graft step to complete and its release actions to be processed, iProcess needs to know that the processes that are attached to the graft step are complete. To do this, the external application sets the number of tasks that it will attach to the graft step and communicates this to iProcess using the SetGraftTaskCnt TIBCO iProcess Objects method and TaskCnt property. This pre-defines how many tasks have to be completed before the graft step can be released by iProcess. A task can be made up of cases of a sub-procedure or external processes. For each task, the external application can specify that:
For example, if a funds procedure sends a request to the financial system to carry out an audit funds process, the task count is set to 1. If the request also requires a process to track the funds, the task count would be set to 2.
However, the financial system may have three processes to run as part of task 1 such as debit, credit and audit. These are grouped under the task count of 1. When the task is complete i.e. all the processes have completed, the external application decrements the task count automatically by 1 via SPO. Each time the StartGraftTask or DeleteGraftTask SPO function is called, the task count (TaskCnt) is decremented by 1. If the second task, resulted in no process needing to be run, a delete task operation using the DeleteGraftTask function decrements the task count by 1.
The graft step is complete when the task count reaches 0.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved