Exercise 05: Building a Process Model

From AgileApps Support Wiki

Introduction

Creating a Process

  • A Process is a sequence of tasks or steps that need to be carried out
  • Every Process is part of an Object
    • A Process cannot move across multiple Objects
    • But a Process can cause a Process on another Object to be launched
  • When designing a new application:
    • First, build the data model (define Objects)
    • Then design Processes

Process Models

  • A Process Model is a graphical diagram that you build
    • Defines the sequence of tasks or steps in the Process
  • Process Models can implement branching and joining Gateways
  • Created in the Process Model Editor



PME Full Process.png

Notepad.png

Note:
You must use Firefox or Chrome when using the Process Model Editor

Process Model Editor

  • To create/modify a process model, drag & drop elements from the Shape Repository palette to the Process Model Editor
  • Click the Check Syntax button in the Tools Bar before saving
    • You cannot save if there is a syntax error
    • Do a syntax check (and save) often!
    • The syntax check finds lines that are not connected to a step (they can look right without actually being connected)



Process Model Editor.png

Process Model Editor Tool Bar

PME Tool Bar.PNG

Process Model Shape Repository Palette

PME Description.PNG

Start and End Events



StartAndEndEvents.PNG

Activities: Send Email, Execute Rule Set

Send Email Execute Rule Set.PNG

Activities: Execute Web Service

Execute Web Service Slide.PNG

Sequence Flow

Sequence Flow.PNG

Conditions and Parallelism – Decision Switch

Conditions and Parallelism.PNG

Conditions and Parallelism – Gateways

Gateways.PNG

User Interaction using User Tasks and Approval Steps

Design Time
User Tasks and Approval Steps.PNG

User Interaction using User Tasks and Approval Steps

Run Time
User Tasks and Approval Steps Run Time.PNG

Call Process and Nested Subprocess Activities

Call Process and Nested Subprocess Activities.PNG

Error Handling using Exception Events

Error Handling using Exception Events.PNG

Process Properties

Process Properties.PNG

Duration of a Process

Process Duration.PNG

Process Limitations

  • Processes, like Business Rules, are relatively lightweight
  • They are designed for “human-scale” systems
  • For larger-scale systems, enhancements are needed to help manage the complexity:
    • Logic Validation (gaps in the specified conditions? overlaps?)
      • Example: if (a < 2) then do X; if (a >2) then do Y
      • what if a = 2?
    • Example: if (a <=2 then do X; if (a >=2) then do Y
      • In a Process, the second branch would never be taken
      • In a Rule Set, both Rules would execute - but perhaps only one was intended
    • Test Suites
      • Does anticipated behavior match expectations?
    • Simulations
      • Evaluate results for a set of input data and pre-programmed activities

Starting and Stopping a Process

Starting and Stopping a Process.PNG

Viewing a Running Process

Viewing a Running Process.PNG

“Ad-hoc” Tasks

  • A User can add “Ad-hoc” Tasks to a running Process instance
  • Ad-hoc Tasks become “mini-processes” that have one or multiple User Tasks and Approval steps,ďż˝created on the fly

Modifying a Process Model: A look “Under the Hood”

  • A Process Model is stored in the database using versioning
  • When a process instance is “launched”, a process state record is created
  • The state-record has a link to the current process model, process status (running or closed), ďż˝and an indicator of what task(s) are next
  • When a step is completed, the model defines the next step to take
  • When you modify the process model, a new model is stored and activated with a higher Revision#
  • When launched on a new Case, the state-tracking record points to the new process model
  • But the state-tracking record for a process instance that is in-progress still points to the ďż˝previous process model
  • So modifications do not break a running process instances
  • You can step back to a previous process model (Revert)


Exercise

In this exercise, you create a new Process Model - a diagram that defines the steps needed to process an order. You define Process model elements to automate the processing and control of the Orders Object. Here is the plan for the process flow:

  1. When a new Orders order is submitted by an Agent, automatically update the status of the order to Pending.
  2. Assign a task to the Agent (who created the order) to complete the order (for example, to add line items to it).
  3. When the Agent is finished with the order, assign the order to the Agent’s manager for approval.
  4. If the Manager:
    • Approves the order, set the order status to Resolved.
    • Rejects the order, send an email to the Agent requesting more information.

Warn.png

Important:
For this exercise - and any exercise where you use the Process Model Editor - use Mozilla Firefox or Google Chrome as your Web browser.

Steps

  1. Go to the Configuration page, under the Customization tile, click Objects. Navigate to Orders > Processes > New Process page.
    The Process Model Editor opens in a separate browser window:

    Process Model Editor.png

    Note: Starting the Process Model Editor may take a few seconds.
  2. Use drag & drop to add a Start Event step from the palette to the design canvas:

    PME Start Event.png

  3. To automatically set the order status to pending, add a step of type Execute Rule Set after the Start event.

    PME Execute Rule Set.png

  4. Name the step Update Pending and click + to create a new Rule Set with the same name and with a description Change the status of the order to “pending”. Click Save.

    PME New Rule Set.png

    Note: We will not implement the Rule Set and its Business Rules now. You will add this in a later exercise. 
  5. Connect the Start Event step to the Execute Rule Set step by clicking the Start Event step and dragging its connector arrow to the Execute Rule Set element.

    PME Update Pending.png

  6. Add a User Task step to the canvas. Name it Finish Order Setup, provide a Due Date of 4 hours, assign it to the Individual Owner, and specify Open for the Change status to option:

    PME User Task.png

  7. Add an Approval Step to the canvas. Name it Manager Approval, provide a Due Date of 2 hours, assign it to the User’s manager by selecting the Individual Owner and Reports To for the Assigned to option. Check Comment required and set Change Status to to Resolved.

    PME Approval Step.png

  8. Arrange and connect the steps so that your canvas looks as shown:

    PME Finish Order Setup Manager Approval.png

  9. It is good practice to save your work often:
    1. Since the Process Model will not be saved if there are any syntax errors, click the Check Syntax button to verify that there are no errors in your Process Model. You should see a message stating there are no errors:
      Note: If you get a message stating that there are syntax errors, you must resolve them before you continue.
    2. Save the Process as SouthEast Process Model with a description:

      PME Save SouthEast Process Model.png

    3. In case the process editor window was closed, click on a step in the process image to reopen the Process Model in its Process Model Editor and to continue with the exercise.
  10. After the Manager Approval step, add a Decision Switch to continue the process flow depending on whether the manager approves or rejects the order.

    PME Manager Approval.png

  11. Add another Execute Rule Set step named Complete Order for when the manager approves the order. When configuring the step, create another empty Rule Set called Complete Order on the fly with a description Change the status of the order to “closed”.
  12. Connect step Manager Approval to the Decision Switch.
  13. Connect the Decision Switch to the step Complete Order.
  14. Finally double-click on the connecting arrow leaving the Decision switch to open the Decision Switch dialog box. Configure the connection to be labeled as Approved with a branch condition of Approved equals Yes.

    PME Decision Switch.png

  15. Add an End Event step to the model and connect it to the Complete Order step:

    PME Complete Order.png

  16. To define what happens if the manager rejects an order:
    1. Add a Send Email step to the left of the Decision Switch using the values shown. Name it Email Agent for Updates. Specify the Record Owner as Email recipient. For the Email Template, click + to create a new Email Template named Agent Order Update with a Subject Need More Order Details on the fly.

      PME Send Email.png

    2. Connect the Decision Switch to the Send Email step from above. Double-click on the connecting arrow to open the Decision Switch dialog box. Configure the connection to be labeled as Rejected with a branch condition of Approved equals No.
    3. Now complete the process flow by connecting the Send Email step back to the Update Pending step:

      PME Full Process.png

  17. Check the syntax and save the Process Model.
    As you save the Process Model for the second time, it will ask for a review comment.
    All changes are assigned to your SouthEast Process Model Process model.

    SouthEast Process Model.PNG

Previous

Next