Try OpenEdge Now
skip to main content
BP Server Developer's Guide
Process instance management : Working with dynamic process instances
 

Working with dynamic process instances

Each process instance is a self-contained unit and can be modified dynamically at runtime without modifying the process template. For each modified process instance, a dynamic process template is created. It remains active as long as the process instance is active, and is removed after the completion of the process instance.
For example, the Hiring process template provides a generic Human Resources (HR) solution to hiring new employees. HR can use this process for considering each candidate individually. A process instance is created every time a new candidate is considered. Every workstep and attached data within an instance are related to each specific candidate. The specified process flow usually meets the general recruitment conditions. However, some special recruitments may require template modification with more worksteps or more dataslots.
Figure 14 illustrates how a dynamic process instance of the Hiring process template is created.
Figure 14. Dynamic process instance of hiring process template
In this case, an additional workstep is included to assess the technical aspect of a candidate, while the general process instances also run simultaneously with the original process template definition.
However, before you attempt to modify any instance dynamically, note that:
*The selected process instance must be active and that none of the worksteps should be in the suspended state.
*All active worksteps in the process instance must be human-performed worksteps.
*The process template information is obtained through the process instance SVO.
*The process template name and the process template ID are same as the previous process template.
*The edited process instance can run concurrently with the original process instance, or the original process instance can remain suspended.
While modifying any instance, you can:
*Modify the properties of any inactive workstep by double-clicking it.
*Add a workstep to the process instance.
*Remove an Inactive workstep.
*Drag and drop existing predefined adapters or Web applications from the Task pane, or those that have been created elsewhere and added to the Task pane.
*Provide support for Swim Lanes for Performers, after the swim lanes were added in the Progress Developer Studio for OpenEdge.
Note that while you are modifying any process instance, you are not allowed to:
*Add or delete dataslots.
*Modify dataslot metadata and values.
*Add or delete performers.
*Define new adapters or a subprocess.
*Add Rollback to an activity.
*Specify header and footer for a workstep.
*Modify properties of an active or completed workstep.
*Save any modifications if the process instance is suspended or has a suspended workstep.
*Use versioning with dynamic process instances.
*Complete tasks by e-mail. When the dynamic process instance is dynamically created, the performers of the activated human-performed tasks are not notified about their tasks.
*Access the dynamic process template/workstep template SVO directly.
*Create dynamic process instances of a Subprocess Instance.
Note: You can modify any process instance only once. If further modification is attempted, then a warning message is displayed.
BP Server provides a direct API to create a dynamic ProcessInstance, where the newly created dynamic ProcessInstance becomes the child process of the invoked ProcessInstance.
*public ProcessInstance create(java.lang.String xmlDefinition, Boolean removeOnCompletion)
The dynamic ProcessInstance and its parent process have the same ProcessTemplate ID with different XML definition. As a result, the user can get either the original ProcessTemplate on the parent ProcessInstance or the dynamic ProcessTemplate on the dynamic ProcessInstance SVO.