LSPS documentation logo
LSPS Documentation
Goal Model

A Goal Model is a hierarchy of Achieve and Maintain Goals, and Plans and their connections in a Goal-based Process. It specifies what needs to be achieved by the process while the Plan bodies specify how to achieve it.

After all executable Modules in a Model are instantiated, processes of executable Module instances are instantiated and Goal processes trigger all their top Goals: The top Goals become ready and if their pre-condition is met then running. When a Goal becomes running, all its sub-Goals become ready: the Goal triggers all its sub-Goals; a ready sub-Goal can become running and commit further to their child modeling elements, that is, either to Achieve Goals or to Plans. If a Goal has several Plans as its child elements, the Goal triggers one Plan, and that either the first Plan with its pre-condition evaluated to true or if no Plan pre-conditions are provided, a randomly chosen Plan.

Important: Since pre-conditions are evaluated continuously, make sure they do not perform any assignments to prevent performance issues.

If a Plan fails, another Plan is triggered. If all Plans fail, the parent Goal fails.

Achieve Goal

An Achieve Goal is a modeling element that represents a condition or a state that is to be achieved. Achieve Goals typically represent explicit objectives of the process, such as, placing an order, producing a car, sending a message, etc.

An Achieve Goal exist in a goal hierarchy: it may have no parent modeling element or it can have another Achieve Goal as its super-Goal. It can have one or multiple child elements connected with the Decomposition flow. Its child elements can be either Achieve Goals or Plans: It is not possible to decompose a single Achieve Goal into both Goals and Plans.

On runtime, Achieve Goals go through a set of statuses defined by their life cycle).

An Achieve Goal can define the following:

  • Pre-condition is a Boolean expression checked continuously while an Achieve Goal is Ready. If a pre-condition becomes true, the Goal becomes Running.

    Important: Since pre-conditions are evaluated continuously, make sure they do not perform any assignments to prevent performance issues.

  • Deactivate condition is a Boolean expression checked continuously while an Achieve Goal is Not finished (Inactive/Ready/Running). If evaluated to true, the Achieve Goal, its sub-Goals and Plans become Deactivated immediately.
  • Visibility defines Goal access rules: if set to Public, the Goal is accessible from the entire model; if you unselect the option, it is private and accessible only from within its module.
AchieveGoal_iconic.png
Achieve Goal in the iconic notation
AchieveGoal_decorative.png
Achieve Goal in the decorative notation

Achieve Goal Life Cycle

When a GO-BPMN process is instantiated, its Goals are instantiated as well: all Goals become inactive. An inactive Achieve Goal is not prepared for running and waits for its activation. All top Achieve Goals of the process instance become ready: When a goal becomes ready, it has its pre-condition checked. If the pre-condition evaluates to true, the goal becomes running. The pre-condition is checked continuously while the Goal is ready.

When a goal becomes running, it activates either all its sub-goals or one Plan, that becomes ready.

A Running Achieve Goal can become achieved or failed:

  • It becomes achieved when one of its Plans is achieved or all of its sub-Goals are achieved or deactivated;
  • It becomes failed when at least one of its sub-goals failed or none of its Plans was achieved.

Important Achieve Goal status can be influence by the deactivation and activation mechanism.

lifecycle_AchieveGoalNoDeact.png
Lifecycle of Achieve Goals

Decomposition

In a Goal model, Decomposition represents a relationship used either for detailing a Goal to its sub-Goals, or specifying how a Goal can be achieved by corresponding Plans.

A Decomposition is presented as a connector used in Goal hierarchies and enables you to establish acyclic oriented relationships between:

  • two Achieve Goals,
  • Maintain Goal and Achieve Goal, and
  • Goal and Plan.

Maintain Goals cannot be targets of a Decomposition (every Maintain Goal is a top Goal).

During execution the following rules apply:

  • If a Goal is decomposed in sub-Goals, all the sub-Goals are committed to and executed. The super Goal is accomplished only if all its sub-Goals are Achieved or Deactivated.
    • If one of the sub-Goal fails, the super Goal fails and any other sub-Goals become deactivated. The failure is distributed also to other parent Goals of the failed Goal, that is, if a Goal, which fails, has any parent Goals, these parent Goals fail as well.
    • Super Goal can succeed even if one or multiple Goals were deactivated. If a Goal is decomposed in several Plans, only one of the Plans is triggered (either the one with the pre-condition evaluated to true or the first randomly-chosen Plan). When a Plan is Achieved, its parent Achieve Goal becomes Achieved or its parent Maintain Goal becomes Ready.
    • If a Plan fails, an alternative Plan is selected.
    • If no other Plan can be triggered, that is, if all available Plans fail, the parent Goal fails.
Decomposition.png
Decomposition notation

Maintain Goal

A Maintain Goal serves to make sure a condition is true and that either while an Achieve Goal or while the process is running. The Achieve Goal or the Process represent the scope of the Maintain Goal: if the Achieve Goal or Process is running and the condition on the Maintain Goals becomes false, the Maintain Goal is triggered: The Maintain Goal and its sub-tree serve to make the condition true again.

A Maintain Goal is always a top Goal and can be decomposed in Plans or Achieve Goals.

The scope of a Maintain Goal is the Process by default. To define an Achieve Goal as its scope, use the Maintain Scope connector.

Usage Example: The maintain condition defines the minimum amount of material that must be on stock at all times. If the amount on stock is lower than the defined amount, the condition becomes false, and the Maintain Goal is activated: Plans or sub-Goals attached to the Maintain Goal provide for restocking.

Maintain Goal Attributes

  • Maintain condition is a Boolean expression checked continuously while the Maintain Goal is Ready. When the condition becomes false, the Maintain Goal becomes Running.

    Important: Since pre-conditions are evaluated continuously, make sure they do not perform any assignments to prevent performance issues.

  • Visibility defines the access rules to the Maintain Goal.

A Maintain Goal can be shown either in the decorative or iconic notation.

MaintainGoal_iconic.png
Maintain Goal in the iconic notation
MaintainGoal_decorative.png
Maintain Goal shown in the decorative notation

Maintain Goal Life Cycle

During execution of a Goal-based Process instance, Maintain Goals go through a particular set of stages, referred to as a life cycle. At every stage, the goal is in a particular state.

lifecycle_MaintainGoalNoDeact.png
Maintain Goal life cycle without the Activation mechanism

The execution of a Maintain Goal depends primarily on its Maintain Scope. A Maintain Scope may be the entire parent Goal-based Process or a particular Achieve Goal.

A Maintain Goal is Inactive if its scope is not running:

  • If the scope is the parent process, the maintain goal becomes immediately Ready
  • If the scope is an Achieve Goal, the Maintain Goal remains Inactive while the Achieve Goal is Inactive or Ready.

When the scope becomes Running, the Maintain Goal becomes Ready and the maintain condition is checked continuously.

At the moment, when the maintain condition becomes false, the Maintain Goal becomes Running: its sub-goals become Ready or one of its Plans becomes Running. Note that the maintain condition is not checked while the Maintain Goal is Running.

When the sub-tree execution of a Maintain Goal is finished, the following can occur:

  • If the scope is still Running, the Maintain Goal becomes Ready and the maintain condition is being checked again.
  • If the scope is no longer Running, the Maintain Goal becomes Inactive.

If the scope is an instance of a Goal-based Process which is Finished, the Inactive state is only transient and the Maintain Goal becomes Deactivated.

Maintain Scope

A Maintain Scope flow defines the Achieve Goal scope of a Maintain Goal (the flow may connect only an Achieve Goal and a Maintain Goal and each Maintain Goal can have only one Maintain Scope. If you require a more diverse Maintain Scope of a Maintain Goal, consider defining a maintain condition.

Maintain scope is visualized as an oriented solid arrow with a short perpendicular line as an arrowhead pointing toward the Achieve Goal, which is the scope of the maintenance.

MaintainScope.png
Maintain Scope

Maintain Goal with Maintain Scope

If the element of the maintain scope is:

  • reactivated, the Maintain Goal becomes Ready.
  • not active, the Maintain Goal is Inactive.

Plan

A Plan is an element of a Goal hierarchy which specifies what to do in order to achieve its parent Goal. It contains a Plan Model, which is an uninterrupted work flow of Events and Activities connected with Flows.

A Plan must have exactly one incoming decomposition originating from a Goal: one Plan can have only one parent Goal. It is the leaf element of a Goal hierarchy with no outgoing flow elements.

Plan_iconic.png
Plan in iconic notation
Plan_decorative.png
Plan in decorative notation

A Plan can define the following:

  • Pre-condition is a Boolean condition, which is continuously checked while a Plan is Inactive.
  • Failure Error Codes is a set of error codes (every error code being a string), which cause the Plan to fail after it has received any of the error codes: the error can be produced either by an error code end event in its body). If null, any error code causes the Plan to fail.

Plan Life Cycle

When a Process is instantiated, all the Plans are created and becomes Inactive. An Inactive Plan becomes Running when triggered by its parent Goal. At that moment, the Plan pre-condition is evaluated. If evaluated to true, the Plan triggers execution of its Plan Model, that is, its None Start Event produces a token and its namespace context is initiated.

Note: If a Goal is decomposed in several Plans and you want the system to select a Plan based on some context data, use the pre-condition expression.

While Running, a Plan can be deactivated by its parent goal. A deactivated Plan becomes Inactive. A Running Plan becomes Failed, if its Plan Model ends with an Error End Event, or an error code is caught Errors.

A Plan becomes Achieved, if the execution of its Plan Model finishes with any other End Event.

lifecycle_Plan.png
Plan life cycle

Goal Activation and Deactivation

Goal activation and deactivation is a mechanism that enables an instant change of a Goal status to either make the entire Goal sub-tree to come to a halt or to continue its execution.

You can activate and deactivate Goal either from the <../management/modelinstancemanagementpds.html::goalactivation>Management perspective of PDS or with the activate() and deactivate() functions of the Standard Library.

Deactivation

Goals, both Achieve and Maintain, can define a deactivate condition, which causes the Goal to become Deactivated when the condition becomes true.

The condition is checked continuously while the following is true:

  • For Achieve Goals, while they are Not Finished (inactive, ready, or running).
  • For Maintain Goals, while they are Alive (parent process instance is running).

When the condition becomes true, the Goal becomes Deactivated immediately. Goals can be deactivated manually as well.

When a goal is deactivated, the following happens:

  1. All its sub-Goals and Plans in a top-down manner become Deactivated.
  2. Any Running child Plans stop their execution immediately and becomes Inactive.

Note: An Achieve Goal or a Plan is deactivated also when their parent fails.

Activation

If an Achieve Goal is Achieved, Failed, or Deactivated, it is considered Finished. Only a finished Achieve Goal can be activated: on activation it becomes Ready. Note that the status of its parent Goals remains unchanged, only its sub-elements go through their life cycle.

A Maintain Goal can be deactivated at any time while it is Alive: on its deactivation, the Maintain Goal stops execution of all its sub-Goals and Plans instantly. A Maintain Goal also becomes Deactivated when the scoped Achieve Goal becomes Deactivated as well as when the parent Goal-based Process becomes Finished.

lifecycle_AchieveGoal.png
Life Cycle of Achieve Goals with Activation and Deactivation
lifecycle_MaintainGoal.png
Life Cycle of Maintain Goals with Activation and Deactivation