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
- A Process Model is a graphical diagram that you build
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 Tool Bar
Process Model Shape Repository Palette
Start and End Events
Activities: Send Email, Execute Rule Set
Activities: Execute Web Service
Sequence Flow
Conditions and Parallelism â Decision Switch
Conditions and Parallelism â Gateways
User Interaction using User Tasks and Approval Steps
User Interaction using User Tasks and Approval Steps
Call Process and Nested Subprocess Activities
Error Handling using Exception Events
Process Properties
Duration of a Process
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
- Logic Validation (gaps in the specified conditions? overlaps?)
Starting and Stopping a Process
Viewing a Running Process
â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:
- When a new Orders order is submitted by an Agent, automatically update the status of the order to Pending.
- Assign a task to the Agent (who created the order) to complete the order (for example, to add line items to it).
- When the Agent is finished with the order, assign the order to the Agentâs manager for approval.
- If the Manager:
- Approves the order, set the order status to Resolved.
- Rejects the order, send an email to the Agent requesting more information.
Steps
- Go to the Configuration page, under the Customization tile, click Objects. Navigate to Orders > Processes > New Process page.
- Use drag & drop to add a Start Event step from the palette to the design canvas:
- To automatically set the order status to pending, add a step of type Execute Rule Set after the Start event.
- 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.
- Note: We will not implement the Rule Set and its Business Rules now. You will add this in a later exercise.â
- 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.
- 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:
- 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.
- Arrange and connect the steps so that your canvas looks as shown:
- It is good practice to save your work often:
- 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.
- Save the Process as SouthEast Process Model with a description:
- 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.
- 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:
- After the Manager Approval step, add a Decision Switch to continue the process flow depending on whether the manager approves or rejects the order.
- 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â.
- Connect step Manager Approval to the Decision Switch.
- Connect the Decision Switch to the step Complete Order.
- 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.
- Add an End Event step to the model and connect it to the Complete Order step:
- To define what happens if the manager rejects an order:
- 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.
- 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.
- Now complete the process flow by connecting the Send Email step back to the Update Pending step:
- 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.
- Check the syntax and save the Process Model.