BPMN v1.1 - Loops

From Training Material
Jump to navigation Jump to search
title
BPMN 2.0 BPMN v1.1 - Loops
author
Bernard Szlachta (NobleProg Ltd)

Loops ⌘

  • Standard Loop
    • While
    • Until
  • Multi Instance
    • Parallel
    • Sequential

Standard Loop ⌘

  • have a boolean expression that is evaluated after each cycle of the loop
  • If the expression is still True, then the loop will continue
While (TestTime = Before)
  • expression is evaluated before the activity is performed
  • the activity may not actually be performed
Until (TestTime = After)
  • the activity will be performed at least once.

Standard Loop Attributes ⌘

  • have a boolean expression that is evaluated after each cycle of the loop
  • If the expression is still True, then the loop will continue
  • There are two variations of the loop, which reflect the programming constructs of while and until
    • while loop will evaluate the expression before the activity is performed, which means that the activity may not actually be performed
  • until loop will evaluate the expression after the activity has been performed, which means that the activity will be performed at least once
LoopCondition
Expression
  • MUST have a boolean Expression to be evaluated
  • plus the timing when the expression SHALL be evaluated (TestTime)
LoopCounter
Integer
  • used at runtime to count the number of loops and is automatically updated by the process engine
  • The LoopCounter attribute MUST be incremented at the start of a loop
  • The modeler may use the attribute in the LoopCondition Expression (e.g. LoopCounter <= 12)
LoopMaximum (0-1)
Integer
  • The Maximum an optional attribute that provides is a simple way to add a cap to the number of loops
  • This SHALL be added to the Expression defined in the LoopCondition
TestTime (Before | After)
String
  • if Before the activity begins are equivalent to a programming while function.
  • if After the activity finishes are equivalent to a programming until function.

Multi-Instance Loop Attributes ⌘

  • Multi-Instance loops reflect the programming construct for each
  • The loop expression for a Multi-Instance loop is a numeric expression evaluated only once before the activity is performed
  • The result of the expression evaluation will be an integer that will specify the number of times that the activity will be repeated
MI_Condition
Expression
  • MultiInstance Loops MUST have a numeric Expression to be evaluated
  • the Expression MUST resolve to an integer
LoopCounter
Integer
  • only applied for Sequential MultiInstance Loops and for processes that are being executed by a process engine
  • updated at runtime by a process engine to count the number of loops as they occur
  • MUST be incremented at the start of a loop
  • Unlike a Standard loop, the modeler does not use this attribute in the MI_Condition Expression, but it can be used for tracking the status of a loop
MI_Ordering (Sequential | Parallel)
String
  • defines whether the loop instances will be performed sequentially or in parallel
  • Sequential MI_Ordering is a more traditional loop (e.g. for i=1 to 10)
  • Parallel MI_Ordering is equivalent to multi-instance specifications that other notations, such as UML Activity Diagrams use
  • If set to Parallel, the Parallel marker SHALL replace the Loop Marker at the bottom center of the activity shape

FlowCondition ⌘

MI_FlowCondition (None | One | All | Complex) All
String [Parallel MI_Ordering only]
  • This attribute is equivalent to using a Gateway to control the flow past a set of parallel paths.
  • None is the same as uncontrolled flow (no Gateway) and means that all activity instances SHALL generate a token that will continue when that instance is completed.
  • One is the same as an Exclusive Gateway and means that the Token SHALL continue past the activity after only one of the activity instances has completed
    • The activity will continue its other instances, but additional Tokens MUST NOT be passed from the activity.
  • All is the same as a Parallel Gateway and means that the Token SHALL continue past the activity after all of the activity instances have completed.
  • Complex is similar to that of a Complex Gateway. The ComplexMI_FlowCondition attribute will determine the Token flow.
ComplexMI_FlowCondition (0-1)
Expression [Complex MI_FlowCondition only]
  • If the MI_FlowCondition attribute is set to “Complex,” then an Expression Must be entered
  • MAY reference Process data
  • be evaluated after each iteration of the Activity and SHALL resolve to a boolean
  • If the result of the expression evaluation is TRUE, then a Token will be sent down the activity’s outgoing Sequence Flow
  • Otherwise, no Token for that iteration will be sent