Use a Dynamic Process in a Structured Process

If your business process is mostly predictable (structured) but part is unpredictable and non-sequential (dynamic), accommodate both by calling a dynamic process from your structured process.

Our previous hospital emergency room example demonstrated calling a structured process (Surgery) from a dynamic process (Emergency Room). Want to learn more? See Use a Structured Process in a Dynamic Process.

But now let’s imagine a different twist in our example: Surgery (a structured process) followed by post surgery (a dynamic process).

What’s dynamic about the post surgery process?

  • The patient may need no additional action, except to be discharged and go home.

  • Minor complications could develop, that might require follow-up care or treatment.

  • In rare cases, the patient might develop major complications and require extensive treatment.

Let’s get started creating:

  • A structured process for the overall surgery tasks. The doctor begins the surgery process, and the patient gives consent. (For the purposes of our example, we’ll imagine that the surgery itself involves additional steps not covered here.)

  • A dynamic process to model the unpredictable post-surgery tasks. For this example, we’ll limit the activities to discharge and, minor and major complications.

Create a Structured and a Dynamic Process

We’ll start a new simple process application (Emergency2) to house the structured and dynamic processes.

  1. On the Process Applications page, click Create, then New Application.
  2. In the Create Application dialog box, enter Emergency2 in the Name field, and click Create.

    The Application Home tab opens with application components shown in the navigation pane.

  3. Create a structured process.
    1. Click Create a Structured Process, and then click Start with a form.
    2. In the Create Process dialog box, enter Surgery Process in the Name field. Deselect Open Immediately and click Create.
  4. Create a dynamic process.
    1. Click Create a Dynamic Process, and then click Start with a todo list.
    2. In the Create Process dialog box, enter PostSurgery Process in the Name field. Deselect Open Immediately and click Create.

      Notice the two processes in the Application Home tab. The different icons indicate dynamic versus structured process.

Add Human Task Activities to the Structured Process

Let’s add a couple of human task activities that we know will be typically performed in a simple surgery process.

  1. Click the Surgery Process to open it.
  2. Add an Approve human task.
    1. Expand Human in the Elements palette.
    2. Drag and drop an approve human task from the palette onto the process editor canvas. Position it in your process where you want to add it.
    3. Double-click the task’s name and enter Patient Consent.
  3. Add a Dynamic Process element.

    This dynamic process element is presently empty, and is just a placeholder. But later, when we associate the PostSurgery dynamic process with this element, then it’ll house all the activities of the PostSurgery dynamic process.

    1. Expand System in the Elements palette.
    2. Drag and drop a dynamic process element Dynamic Process element icon from the palette onto the process.
    3. Double-click the name and enter PostSurgery Process.

Create a Form and Its Presentations

Let’s create a form with multiple presentations that you apply to the human task activities. We’ll start by creating a form and a presentation for the structured process’ start event. Then we’ll create different presentations to customize the form for the various human task activities in our process application.

  1. Click Forms in the navigation pane. On the Forms page, click Create.
  2. In the Create New Web Form dialog box, enter PatientForm in the Name field, leave Open Immediately check box selected, and click Create.
  3. Change the default presentation’s name.
    1. Click the Presentation tab on the Properties pane.
    2. In the presentation table, change the name of the default Main presentation to Start.

      You’ll use this presentation for the structured process’ start event.

  4. Add input text controls for the patient’s first and last name.
    1. Drag and drop two Input Text controls from the Basic palette onto the form’s central canvas side by side.
    2. Select the first one, and change its Name field to FirstName and Label field to First Name.
    3. Select the second control, and change its Name field to LastName and Label field to Last Name.
  5. Create a presentation for the Approve human task.
    1. Click outside a form control and select the Form tab in the Properties pane.
    2. Click Add Add icon in the Presentation table. In the Select Presentation Type dialog box, select Clone.
    3. In the Create Presentation dialog box, select Start in the Select from Previous Presentation field, and enter Consent in the Name field. Leave Switch to this presentation check box selected, and click Create.
    4. Drag and drop a Text Area control onto the form’s canvas. Select the control, and change its name and label to Comment.
  6. Create a Discharge presentation

    Let’s create presentations for the post-surgery tasks in the dynamic process. Start by creating the first presentation.

    1. Click Add in the Presentation table. In the Select Presentation Type dialog box, select Clone.
    2. In the Create Presentation dialog box, select Start in the Select from Previous Presentation field, and enter Discharge in the Name field. Leave Switch to this presentation check box selected, and click Create.
    3. Drag and drop a Text Area control onto the form’s canvas, below the First Name and Last Name controls.
    4. Enter DischargeSummary in its Name field and Discharge Summary in its Label field.
  7. Create a Minor presentation.

    Create the second presentation for the post surgery tasks.

    1. Click Add in the Presentation table. In the Select Presentation Type dialog box, select Clone.
    2. In the Create Presentation dialog box, select Start in the Select from Previous Presentation field, and enter Minor in the Name field. Leave Switch to this presentation check box selected, and click Create.
    3. Drag and drop a Text Area control onto the form’s canvas. Enter TestReports in its Name field and Test Reports in its Label field .
    4. Drag and drop a Radio Button control below the text area control. Enter TreatmentRequired in its Name field and Treatment Required in its Label field.
    5. Change the option names of the radio button control to Yes and No in the Option Names field.
  8. Create a Major presentation.

    Create the third presentation for the post-surgery tasks.

    1. Click Add in the Presentation table. In the Select Presentation Type dialog box, select Clone.
    2. In the Create Presentation dialog box, enter Major in the Name field, and select Start in the Select from Previous Presentation field. Leave Switch to this presentation check box selected, and click Create.
    3. Drag and drop a Text Area control onto the form’s canvas.
    4. Enter Treatment in its Name field, and PostSurgery Treatment in its Label field.

Configure the Dynamic Process Input and Tasks

Define the dynamic process’ input to control what type of data starts the dynamic process. Also, implement each human task activity with a form presentation.

In our example, we have to set the input arguments such that the patient’s first and last name can be the input data for the PostSurgery dynamic process.

  1. In the navigation pane, click Processes.

    You can see the Surgery Process and the PostSurgery Process that you created in the Application Home tab.

  2. Click the PostSurgery Process to open it.
  3. Select Process Input next to the process name at the top of the editor.
  4. Configure settings in the Start the Dynamic Process dialog box.

    Leave With Data Only selected, define the interface arguments and click Define.

    Note that you cannot start a dynamic process used in a structured process with a form. Always start it with data.

    Description of er-example-dp-activity5.png follows
    Description of the illustration er-example-dp-activity5.png

  5. Select a form and presentation for each human task activity in the To-Do List.

    Click Edit Properties Edit Properties icon to open the related properties pane for the activity.

    • Task 1: In the properties pane, enter Patient Discharge in the Name field. Click General under the implementation pane. In the general pane, select PatientForm in the Form field and select Discharge in the Presentation field. Click Close.

      Description of er-example-dp-activity6.png follows
      Description of the illustration er-example-dp-activity6.png
    • Task 2: Repeat the steps of Task 1, only this time enter Minor Complications in the Name field and select Minor in the Presentation field.

    • Task 3: Repeat the steps of Task 1, but enter Major Complications in the Name field and Major in the Presentation field.

  6. Click Save.

Configure the Structured Process to Call the Dynamic Process

Now that you’ve created the processes and form presentations for users to perform tasks, and also defined the input data for the dynamic process, let’s set up the structured process. This includes configuring the structured process to initiate the dynamic process, and configuring data association so that data flows from the structured process into the dynamic process.

  1. Click the Surgery Process tab to open the structured process.
  2. Associate the dynamic process with the dynamic process flow element.
    1. Select the dynamic process element, click Menu Menu icon and then select Open Properties. The implementation pane opens at the bottom of the window.
    2. In the implementation pane, select PostSurgery Process in the Dynamic Process field.
    3. Collapse the implementation pane to save your changes.
  3. Configure the structured process’ start event.

    Now let’s configure the Surgery Process’ start event.

    1. Select the Surgery Process’ start event and open the related implementation pane.
    2. Enter Start the Surgery Process in the Title field.

      This title will appear at the process start in runtime.

    3. Browse and select PatientForm in the Form field.
    4. Select Start in the Presentation field.
    5. Collapse the implementation pane to save your changes.
  4. Configure the Approve human task.
    1. Select the Patient Consent task and open the related implementation pane.
    2. Enter Patient Consent in the Title field.
    3. Browse and select PatientForm in the Form field.
    4. Select Consent in the Presentation field.
    5. Collapse the implementation pane to save your changes.
  5. Configure data association to ensure that input data from the structured process flows into the dynamic process.

    In our example, we want the PostSurgery dynamic process to receive the patient’s first and last name as the input data from the previous activity of the Surgery Process.

    1. Select the dynamic process element.
    2. Click Menu Menu icon and then select Open Data Association.
    3. In the Data Association editor, map the data between the Surgery Process (structured process) and the PostSurgery Process (dynamic process).

      The left pane displays the source (data) objects from the Surgery Process. The right pane displays the payload the PostSurgery Process needs to perform its function.

      • Map patientFormDataObject.firstName from the Surgery Process to body.firstname in the PostSurgery Process.

      • Map patientFormDataObject.lastName in the Surgery Process to body.lastname in the PostSurgery Process.

    4. Click Apply.

Configure Data Association for the Dynamic Process Activities

Define data input and output for the human task activities in your dynamic process by configuring data associations for them.

In the PostSurgery Process, set data associations for the Patient Discharge, Minor Complications and Major Complications human task activities, so that the patient’s first and last name gets auto-populated when these activities are performed in runtime.

  1. In the PostSurgery Process, select the Patient Discharge activity and click More.
  2. In the menu, select Data Association and then Input.
  3. In the Data Association editor, drag and drop data objects into the association fields.

    Associate firstname and lastname from Process Input in the left pane to firstName and lastName from PatientForm in the right pane.

    Description of er-example-dp-activity9.png follows
    Description of the illustration er-example-dp-activity9.png

  4. Click the Output tab and configure the data association, only this time the mapping will be reverse.

    Associate firstName and lastName from PatientForm in the left pane to firstname and lastname from Process Input in the right pane.

  5. Click Apply.
  6. Repeat the steps above for the Minor Complications and Major Complications activities.

Try Out the Process Application in Test Mode

Now that you’ve set up the process application in design time, let’s try out the process application in runtime, as users would.

  • In the structured process, the patient receives an approve task to provide consent for the post surgery treatment phase, which initiates the post surgery dynamic process.

  • A health worker uses the dynamic process to perform activities that fit the patient’s post surgery status.

Begin by test activating.

  1. Click Test.

    A Test Application tab opens. Notice that a caution is displayed. Output data association isn’t currently supported for dynamic process output. But the application can still be activated.

  2. Test activate the application.
    1. Click Activate.
    2. In the Activate to Test dialog box that displays, leave Add Me to All Roles selected, and click Activate.

      When activating an application containing a structured process, you must map roles to users. Because you are test activating, you can skip mapping roles.

      Notice that the Play and Try in Test Mode buttons became green and active. The Play option doesn’t apply to process applications that use dynamic processes. While you can initiate the player, it will stop when the dynamic process player is reached, so its use is not recommended with dynamic process applications.

    3. Click Try in Test Mode.
  3. As the doctor, start the structured process.
    1. From My Tasks (runtime), click your application on the My Apps page that displays after test activation starts.
    2. In the start form that displays, enter the patient’s first and last name, and click Submit.

      Description of er-example-dp-activity12.png follows
      Description of the illustration er-example-dp-activity12.png

      A message briefly displays that a process instance was created.

  4. As the patient, open and approve your assigned consent task.

    The structured process is running and the approve task generated an approval task for the patient.

    1. Click My Tasks and open the Patient Consent task from the My Tasks page by clicking the >. Notice that the patient’s first and last name is auto-populated in the form.
    2. Click Approve to complete the task. A message displays that the action was processed successfully.
  5. As a hospital worker, open and perform activities in the dynamic process.

    After the approval task completed, the dynamic process was called, starting the dynamic process.

    1. Click Dynamic Processes in the navigation pane.
    2. On the Dynamic Processes page, open the PostSurgery Process and click each activity.

      Description of er-example-dp-activity14.png follows
      Description of the illustration er-example-dp-activity14.png

      Notice that the patient’s first name and last name was auto-populated and that the presentation you selected for each activity displays correctly.

    3. Complete one of the activities by entering information and clicking Submit.

      Suppose that the patient experienced minor complications only, then select the minor activity. When you submit the activity, it no longer appears in the Activities list indicating that it is completed.

    4. Click Close to complete the PostSurgery dynamic process.

Congratulations! You’ve just successfully configured a process application that calls a dynamic process from a structured process.