Use a Structured Process in a Dynamic Process

What if parts of your business process follow a predictable and sequential path? Model them as structured processes that your dynamic process calls. Structured processes also provide some functionality not currently available in dynamic processes, such as decision models, integrations, and service calls.

Create a Structured Process

Let’s create a structured process.

  1. In design time, click the Application Home tab.
  2. Click Create a Structured Process and then click Start when a message is received. Optionally, click Create, and then click New Process.
  3. In the Create Process dialog box, enter Surgery Process in the Name field. Deselect Create Immediately and click Create.

    Notice how the two processes on the Application Home tab have different icons to indicate dynamic versus structured processes.

    Note that structured processes must be asynchronous processes using the Message Start pattern.

Add Human Tasks

Let’s add human tasks to the structured process we just created.

  1. Open the Surgery Process.
  2. Insert an Approve human task.

    Drag and drop an Approve human task from the Elements Palette onto the process flow. Position it where you want to add it.

    Double-click the task’s name and enter Patient Consent.

  3. Insert a Submit human task.

    Drag and drop a Submit human task from the Elements palette onto the process flow. Position it where you want to add it.

    Double click the task’s name and enter Surgery Tasks.

  4. Modify properties for the Submit human task.
    1. Select Surgery tasks, click Menu Menu icon and then select Open Properties.
    2. In the Properties pane, select Is Draft.

      Notice that Surgery Tasks turns gray. This means that it is just a placeholder for the surgery tasks to be configured later.

    3. Click Collapse Pane collapse pane icon to collapse the Properties pane.

Edit the Process’ Swimlane

Edit the process’ swimlane to assign a role responsible for performing each tasks within the process. In the Surgery Process, let us change the process’ swimlane to a surgeon role.

  1. Select Process Owner and click Edit.
  2. In the implementation pane, click Add Role add icon to add a role and enter Surgeon.
  3. Click Collapse Pane collapse pane icon to collapse the implementation pane.

Associate a Web Form with the Approve Human Task

Let’s associate a web form with the Patient Consent human task.

  1. Select the Patient Consent human task, click Menu menu icon and choose Open Properties.
  2. Click the browse icon next to the Form field to search for PatientForm.
  3. Select PatientForm and click OK.
  4. In the Presentation field, select Surgery. Collapse the implementation pane to save your changes.

Define the Process Start and End Events

Implement the process start and end events to input and output the name fields.

  1. Select the Start Message event.
  2. Choose Open Properties, then click Edit for Define Interface.
  3. In the Arguments Definition table of the Configure dialog box, click Add and enter FirstName in the Name field. Click Add and enter LastName as a string type field, and click OK
  4. Select the End Message event and repeat the steps from 1–3.

Configure Data Associations for Process Start and End Events

Define data associations for the Surgery Process’ start and end events to define what payload passes onto the process start event and what data passes out of the process end event.

  1. Select the Start Message event. Click Menu menu icon and choose Open Data Association to open the Data Association editor.
  2. Map FirstName to patientFormDataObject.firstName, and LastName to patientFormDataObject.lastName. Click Apply.
  3. Select the End Message event, open the Data Association editor, and repeat step 2.

Call the Structured Process in the Dynamic Process

Let’s configure the dynamic process to call the structured process.

  1. Return to the dynamic process by selecting the Emergency Process tab.
  2. Select the Surgery activity and click More, then Change Type, and then Process Activity.

    Notice that its activity icon now shows a process rather than a human task.

  3. Edit its properties (Implementation) and select SurgeryProcess in the Process field and Start in the Start Event field.

    Leave Non-blocking deselected, which means that the dynamic process will wait for the structured process instance to complete to continue.

  4. Deselect the Repeatable and Manually Activated markers.

    Note that you can apply these markers to structured processes when they make sense.

  5. Set data association now that the activity has changed type.

    Use auto mapping for input and output.

  6. Click Apply.

Test Activate to Validate the Application

Test activate the Emergency application to validate and make it available in runtime.

  1. Click Test.
    • If the validation was successful, proceed to the next step.

    • If any validation issues are listed, correct the issues and click Test again.

  2. Click Activate.
  3. In the Activate to Test dialog box, leave Add Me to All Roles, and click Activate.

    A message displays that the application activated successfully.

  4. Click Try in Test Mode.
A new test mode browser tab opens. The navigation tab now displays runtime options.

Try the Structured Process in Runtime

Now that you’ve created a structured process in a dynamic process, and test activated the application, let’s try out the Surgery process in runtime to see how it works.

  1. Click My Apps, then create and open a dynamic process instance. Notice that the Surgery activity shows a structured process icon in the Activities list.
  2. Select Inbox in the navigation pane. Typically, the surgeon would be accessing an assigned task from a structured process like the Surgery process from the Inbox rather than from within the dynamic process, although knowledge workers can open structured process tasks from either the Inbox or Dynamic Process.
  3. Open the Emergency task whose process is SurgeryProcess. Click Approve and the task is completed. Notice that this Approval human task displayed Reject and Approve buttons rather than a Submit button.
  4. Select Dynamic Processes in the navigation pane and reopen the topmost instance. The Surgery task no longer appears, since you completed it through the Inbox. Click the Audit tab and you can see (and open) the just completed Surgery process activity.