1 of 84

Chapter 4: Advanced Process Modeling

Contents

  1. More on Rework and Repetition
  2. Handling Events
  3. Handling Exceptions
  4. Processes and Business Rules
  5. Recap

2 of 84

Process Modeling in the BPM Lifecycle

3 of 84

Chapter 4: Advanced Process Modeling

Contents

  1. More on Rework and Repetition
  2. Handling Events
  3. Handling Exceptions
  4. Processes and Business Rules
  5. Recap

4 of 84

More on rework and repetition

XOR-join: entry point

XOR-split: exit point

Structured cycle (SESE fragment)

SESE = Single Entry Single Exit fragment, i.e. a fragment delimited by a single entry node and a single exit node (there are no other incoming arcs into the fragment or outgoing arcs from the fragment)

5 of 84

Block-structured repetition: Loop Activity

BPMN also provides the loop activity construct to allow the repetition of a task or sub-process

6 of 84

Example: block-structured repetition

Must have a decision activity

Completion condition

7 of 84

Loop Activity or (Arbitrary) Cycle?

8 of 84

Arbitrary Cycles

Arbitrary = unstructured, i.e. it can have multiple entry and exit nodes (non-SESE).

8

entry point

exit point

exit point

entry point

9 of 84

Exercise 4.1

  • Identify the entry and exit points that delimit the unstructured cycles in the process model shown below. What are the repetition blocks?

10 of 84

Exercise 4.1

  • Identify the entry and exit points that delimit the unstructured cycles in the process model shown below. What are the repetition blocks?
  • Model the business process shown below using a loop activity.

11 of 84

Example: multi-instance activity

In procurement, typically a quote is to be obtained from all preferred suppliers (assumption: five preferred suppliers exist). After all quotes are received, they are evaluated and the best quote is selected. A corresponding purchase order is then placed.

11

Procurement

12 of 84

Solution: without multi-instance activity

12

Procurement

13 of 84

Parallel repetition: multi-instance activity

Provides a mechanism to indicate that an activity is executed multiple times concurrently

Useful when the same activity needs to be executed for multiple entities or data items, such as:

    • Request quotes from multiple suppliers
    • Check the availability for each line item in an order separately
    • Send and gather questionnaires from multiple witnesses in the context of an insurance claim

13

14 of 84

Solution: with multi-instance activity

14

cardinality

Procurement

15 of 84

Further example: multi-instance activity

15

After a car accident, a statement is sought from the witnesses that were present, in order to lodge the insurance claim. As soon as the first two statements are received, the claim can be lodged to the insurance company without waiting for the other statements.

Motor insurance claim lodgement

16 of 84

Solution: multi-instance activity

Multi-instance pool

denotes multiple participants of the same type

Data collection�denotes a set of data objects of the same type

(determines cardinality of multi-instance activity)

Completion condition indicates minimum number of instances required to complete

(≤ cardinality)

Motor insurance claim lodgement

17 of 84

Our order-to-cash example…�now with pools, messages and MI markers

17

18 of 84

Exercise 4.2

Model the following process fragment.

After a car accident, a statement is sought from two witnesses out of the five that were present in order to lodge the insurance claim. As soon as the first two statements are received, the claim can be lodged with the insurance company without waiting for the other statements

19 of 84

Uncontrolled Repetition: Ad-hoc sub-process

Contains activities to be executed in arbitrary order and number of times

May define order of sub-set of activities by sequence flow

Can be used in an early version of a process diagram�when the order of execution is still unknown

Completion condition

20 of 84

Example: Ad-hoc sub-process

20

21 of 84

Exercise 4.3: Army recruitment

21

A typical army selection process starts by shortlisting all candidates’ applications. Those shortlisted are then called to sit the following tests: drug and alcohol, eye, color vision, hearing, blood, urine, weight, fingerprinting and doctor examination. The color vision can only be done after the eye test, while the doctor examination can only be done after color vision, hearing, blood, urine and weight have been tested. Moreover, it may be required for some candidates to repeat some of these tests multiple times in order to get a correct assessment, e.g. the blood test may need be repeated if the candidate has taken too much sugar in the previous 24 hours. The candidates that pass all tests are asked to sit a mental exam and a physical exam, followed by an interview. Only those that also pass these two exams and perform well in the interview can be recruited in the army.

Model the following process snippet.

22 of 84

Chapter 4: Advanced Process Modeling

Contents

  1. More on Rework and Repetition
  2. Handling Events
  3. Handling Exceptions
  4. Processes and Business Rules
  5. Recap

23 of 84

How do we model this scenario?

23

A Purchase Order (PO) handling process starts when a PO is received. The PO is first registered. If the current date is not a working day, the process waits until the following working day before proceeding. Otherwise, an availability check is performed and a PO response is sent back to the customer.

PO handling

24 of 84

Events handling

In BPMN, events model something instantaneous happening during the execution of a process

They affect the process flow:

    • Start
    • Intermediate
    • End

24

25 of 84

BPMN event types

25

26 of 84

Example: message events

Start event

(receive)

Intermediate catching event

(receive)

End event

(send)

27 of 84

Comparison with sending/receiving tasks

=

=

=

28 of 84

So, when to use what?

Use message events only when the corresponding activity would simply send or receive a message and do nothing else

29 of 84

Typed or Untyped Event?

30 of 84

Exercise 4.4

Is there any other activity in the loan assessment model below that can be replaced by a message event?

31 of 84

Temporal events

32 of 84

Example: temporal events

In a small claims tribunal, callovers occur once a month to set down the matter for the upcoming trials. The process for setting up a callover starts three weeks prior to the callover day, with the preparation of the callover list containing information such as contact details of the involved parties and estimated hearing date. One week prior to the callover, the involved parties are notified of the callover date. Finally, on the callover day, the callover material is prepared and the callover is held.

Start�event

Intermediate catching event

Intermediate catching event

33 of 84

Coming back to our scenario…

A Purchase Order (PO) handling process starts when a PO is received. The PO is first registered. If the current date is not a working day, the process waits until the following working day before proceeding. Otherwise, an availability check is performed and a PO response is sent back to the customer.

PO handling

34 of 84

Multiple start events

The first start event that occurs will trigger an instance of the process

35 of 84

Exercise 4.4: Internet Service Provider

35

The ISP sends an invoice by email to the customer on the first working day of each month (Day 1). On Day 7, the customer has the full outstanding amount automatically debited from its bank account. If an automatic transaction fails for any reason, the customer is notified on Day 8. On Day 9, the transaction that failed on Day 7 is re-attempted. If it fails again, on Day 10 a late fee is charged to the customer’s bank account. At this stage, the automatic payment is no longer attempted. On Day 14, the Internet service is suspended until payment is received. If the payment is still outstanding on Day 30, the account is closed and a disconnection fee is applied. A debt-recovery procedure is then started.

Model the billing process of an Internet Service Provider (ISP).

36 of 84

Racing events: Event-based decision

With the XOR-split gateway, a branch is chosen based on conditions that evaluate over available data

🡪 The choice can be made immediately after the token arrives from the incoming flow

Sometimes, the choice must be delayed until an event happens

🡪 The choice is based on a “race” among events

Two types of XOR split:

36

data-driven XOR-split

event-driven�XOR split

37 of 84

Example: Event-based decision

37

38 of 84

Exercise 4.6: Stock replenishment

A restaurant chain submits a purchase order (PO) to replenish its warehouses every Thursday. The restaurant chain’s procurement system expects to receive either a “PO Response” or an error message. However, it may also happen that no response is received at all due to system errors or due to delays in handling the PO on the supplier’s side. If no response is received by Friday afternoon or if an error message is received, a purchasing officer at the restaurant chain’s headquarters should be notified. Otherwise, the PO Response is processed normally.

Model the following process.

39 of 84

Matching choices in different business parties

Matching a data-driven choice at Client

Lead-to-Quote

40 of 84

What’s wrong with this collaboration diagram?

19

Auction creation

41 of 84

Solution

Auction creation

42 of 84

Exercise 4.7

Fix the following�collaboration diagram.

43 of 84

Recap: message and timer events

44 of 84

Chapter 4: Advanced Process Modeling

Contents

  1. More on Rework and Repetition
  2. Handling Events
  3. Handling Exceptions
  4. Processes and Business Rules
  5. Recap

45 of 84

Process abortion

Exceptions are events that deviate a process from its “normal” course

The simplest form of exception is to notify that there is an exception (negative outcome)

This can be done via the Terminate end event: it forces the whole process to abort (“wipes off” all tokens left behind, if any)

45

46 of 84

Example 1: terminate event

46

Signal the negative outcome…

47 of 84

Example 2: terminate event

47

Abort the process by removing all tokens…

48 of 84

Exercise 4.8

Revise the examples presented so far by using the terminate event appropriately.

49 of 84

Exception handling

Internal: something goes wrong inside an activity, whose execution must thus be interrupted. Handled with the Error event

External: something goes wrong outside the process, and the execution of the current activity must be interrupted. Handled with the Message event

Timeout: an activity takes too long and must be interrupted. Handled with the Timer event

49

Handling exceptions often involves stopping a sub-process and performing a special activity

Types of exceptions for an activity (task/sub-process):

All these events are catching intermediate events. They stop the enclosing activity and start an exception handling routine.

50 of 84

Internal exception: error event

50

Must be attached to the activity’s boundary

51 of 84

Example: internal exception

51

Consider again our “PO Handling process” example with the following extension: if an item is not available, any processing related to the PO must be stopped. Thereafter, the client needs to be notified that the PO cannot be further processed.

PO handling

52 of 84

Solution: internal exception

52

Must catch an error event thrown from within the same activity

Throwing and catching error events must have the same label

PO handling

53 of 84

One more example: internal exception

Extend the claim handling process shown below as follows:

After checking the insurance policy, a possible outcome is that the insurance is invalid. In this case, any processing is cancelled and a letter is sent to the customer. In the case of a complex claim, this implies that the damage checking is cancelled if it has not yet been completed.

53

54 of 84

Solution: internal exception

54

55 of 84

Example: external exception

55

A PO change request may be received anytime after the PO is registered. This request includes a change in quantity or line items. When such a request is received, any processing related to the PO must be stopped. The PO change request is then registered. Thereafter, the process proceeds as it would do after a normal PO is registered. Further, if the customer sends a PO cancelation request after the PO registration, the PO processing must be stopped and the cancelation request must be handled.

PO handling

56 of 84

Solution: external exception

8

PO handling

57 of 84

Exercise 4.9

Model the following routine for accessing an Internet bank service.

The routine for logging into an Internet bank account starts once the credentials entered from the user have been retrieved. First, the username is validated. If the username is not valid, the routine is interrupted and the invalid username is logged. If the username is valid, the number of password trials is set to zero. Then, the password is validated. If this is not valid, the counter for the number of trials is incremented and if lower than three, the user is asked to enter the password again, this time together with a CAPTCHA test to increase the security level. If the number of failed attempts reaches three times, the routine is interrupted and the account is frozen. Moreover, the username and password validation may be interrupted should the validation server not be available. Similarly, the server to test the CAPTCHA may not be available at the time of log in. In these cases, the procedure is interrupted after notifying the user to try again later. At any time during the log in routine, the customer may close the web page, resulting in the interruption of the routine.

58 of 84

Exercise 4.10: activity timeout

Once a wholesale order has been confirmed, the supplier transmits this order to the carrier for the preparation of the transportation quote. In order to prepare the quote, the carrier needs to compute the route plan (including all track points that need to be traversed during the travel) and estimate the trailer usage.

By contract, wholesale orders have to be dispatched within four days from the receipt of the order. This implies that transportation quotes have to be prepared within 48 hours from the receipt of the order to remain within the terms of the contract.

Order-to-transportation quote

59 of 84

Solution: activity timeout

Order-to-transportation quote

60 of 84

Example: Non-interrupting boundary events

The customer may send a request for address change after the PO registration. When such a request is received, it is just registered, without further action.

60

PO handling

61 of 84

Non-interrupting boundary events

Sometimes we may need to trigger an activity in parallel to the normal flow, i.e. without interrupting the normal flow.

This can be achieved by using non-interrupting boundary events

61

Must be attached to the activity’s boundary

62 of 84

Solution: non-interrupting boundary events

62

PO handling

63 of 84

Exercise 4.11

Consider the process for assessing loan applications below.

64 of 84

Exercise 4.11

Extend this process as follows.

An applicant who has decided not to combine the loan with a home insurance plan may change its mind any time before the eligibility assessment has been completed. If a request for adding an insurance plan is received during this period, the loan provider will simply update the loan application with this request.

65 of 84

Complex Exceptions

[…] Further, if the customer sends a PO cancelation request after the PO registration, the PO processing must be stopped and the change request needs to be handled.

65

[…] Further, if the customer sends a PO cancelation request after the PO registration, the request is first assessed. Based on the progress of the order handling (e.g. if items have already been fetched from external warehouses) a penalty is determined and communicated to the customer. The customer has 48 hours to accept the penalty and go on with the cancelation or to stop the cancelation and continue with the order handling.

PO handling

66 of 84

Complex Exceptions: Signal event

  • To send or receive a signal for synchronization purposes
  • A signal is broadcasted without any specific target. Thus it can be caught multiple times
  • Signals are different than messages which are routed to a specific target

Can be attached to the activity’s boundary

67 of 84

Solution: non-interrupting event + signal event

Broadcasts a signal to all catching signal events bearing same label

PO handling

68 of 84

Event sub-process

To handle events that may not refer to a particular task/ sub-process within a process

  • Placed into a process or subprocess
  • Is activated when its start event is triggered
  • It may or may not interrupt the parent process or sub-process, depending on the type of its start event:
    • Non-Interrupting:

    • Interrupting:

69 of 84

Example: event sub-process

PO handling

Only receptive of events occurring during the execution of the enclosing sub-process

70 of 84

Event sub-processes or boundary events?

71 of 84

Exercise 4.12

Model the following business process for reimbursing expenses.

After an expense report is received from an employee, the employee is notified of the receipt of the report. Next, a new account must be created if the employee does not already have one. The report is then reviewed for automatic approval. Amounts under EUR 1,000 are automatically approved while amounts equal to or over EUR 1,000 require manual approval. In case of rejection, the employee must receive a rejection notice by email. In case of approval, the reimbursement is deposited directly to the employee's bank account and an approval notice is sent to the employee via email, with the details of the money transfer. At any time during the review, the employee can send a request for amount rectification. In that case the rectification is registered and the report needs to be reviewed again. Moreover, if the report is not handled within 30 days, the process is stopped and the employee receives a cancelation notice email so that he can resubmit the expense report from scratch.

72 of 84

Example: activity compensation

After a PO has been registered, checked, and a response has been sent back, a payment sub-process and a fulfilment sub-process are started. During these two sub-processes, a PO cancellation may be received from the customer. In this case, both sub-processes are stopped, and their effects are reverted (e.g. reimbursement and/or goods return may need to occur).

72

PO handling

73 of 84

Activity compensation

  • Rollback of completed process activities
  • May be used as part of an exception handling procedure

  • Triggered by throwing Compensate event

  • Compensation Handler (a catching Compensate event + a Compensate activity) performs the rollback

73

74 of 84

Solution: activity compensation

74

Only one compensate activity must be linked from a catching compensate event

The compensate activity can be a sub-process

PO handling

75 of 84

Compensate event

75

Must be attached to the activity’s boundary

  • Indicates that the enclosing activity must be compensated
  • The “throwing intermediate” and the “end” version generate the compensation event
  • The “intermediate catching” version triggers the compensation when attached to the boundary of an activity

76 of 84

Exercise 4.13

Modify the model created in Exercise 4.13 as follows.

If the report is not handled within 30 days, the process is stopped, the employee receives a cancelation notice email and must resubmit the expense report. However, if the reimbursement for the employee’s expenses had already been made, a money recall needs to be made, to get the money back from the employee, before sending the cancelation notice email.

77 of 84

Recap: Events

77

78 of 84

Chapter 4: Advanced Process Modeling

Contents

  1. More on Rework and Repetition
  2. Handling Events
  3. Handling Exceptions
  4. Processes and Business Rules
  5. Recap

79 of 84

Processes and Business Rules

79

  • Business rules implement organizational policies or practices

  • Example: in an online shop platinum customers have a 20% discount for purchases over EUR 250.

  • In BPMN, business rules can be captured via:
    • Decision activities

    • Conditions on outgoing arcs of (X)OR-split

    • Conditional events

80 of 84

Example: conditional event

80

Replenishment order

81 of 84

Exercise 4.14

Model the following business process snippet.

In a stock exchange, stock price variations are continuously monitored during the day. A day starts when the opening bell rings and concludes when the closing bell rings. Between the two bells, every time the stock price changes by more than 10%, the entity of the change is first determined. Next, if the change is high, a “high stock price” alert is sent, otherwise a “low stock price” alert is sent.

82 of 84

Chapter 4: Advanced Process Modeling

Contents

  1. More on Rework and Repetition
  2. Handling Events
  3. Handling Exceptions
  4. Processes and Business Rules
  5. Recap

83 of 84

Recap

  1. Structured loops can be modelled with loop activities, but arbitrary cycles cannot
  2. Multi-instance activities model activities that need to be executed multiple times without a-priori knowledge of their number
  3. Multi-instantiation extends to business objects and resources
  4. Intermediate events can either be catching or throwing
  5. Message events capture message exchange at the start, during and at the end of a process
  6. Timer events capture temporal events (absolute or periodic)

84 of 84

Recap (cont‘ed)

  1. Exceptions can be technology or business based, and either internal, external or activity timeouts
  2. The simplest way to handle exceptions is via process abortion using terminate events
  3. Boundary error events capture internal extensions
  4. Boundary message events capture external extensions
  5. Boundary timer events capture activity timeouts
  6. Signal events broadcast multiple messages and can be used to capture complex exceptions
  7. Compensation events are required to revert the effects of completed activities
  8. Conditional events are one way of capturing business rules