BACK

Download Φ License Φ Forum Φ Team Φ Home



Behavior Modeling with ConceptBase

Dynamic Models

By means of meta models, ConceptBase can be used to represent almost any graphical modeling language. Some of these languages have a dynamic semantics, i.e. they make statements about the execution of some steps or about the behavior of some objects.

As an example, consider classical Petri nets. A Petri net consists of so-called places and transitions. A place can hold a number of tokens. A transition will consume tokens from input places and produce tokens on its output places. In order to be enabled, a transition requires at least one token in all its input places. The screenshot displays an example Petri net for coordinating two traffic lights. The transition yr1 is enabled (green color) since its input place yellow1 has one token indicated by the black dot. The place red2 also has a token, but the transition rg2 still waits for the place safe2 to be filled by a token.

The concept of an enabled transition is definable as a query class, testing whether the number of tokens at all input places of the transition is greater than zero:

QueryClass Enabled isA Transition
  with constraint 
   c: $ forall p/Input[this] (M(p) > 0) $
end
Whether a state is a dead state, whether a transition is enabled, and whether two given states are reachable by a sequence of transitions can all be derived from ConceptBase query classes.  The assignment of graphical types can be made dependant of query classes. For example, instances of the query class Enabled can be specified to be displayed by green rectangular boxes. The actual execution of Petri nets is not expressible by logical rules but well by so-called active rules. Such rules are triggered by an event (ON-part), then check a condition (IF-part) and execute an action (DO-part) depending on the outcome of the condition. For the case a Petri nets, a single active rules realizes the firing of a transition:

Visual traffic lights with underlying Petri net

ECArule UpdateConnectedPlaces with
  mode m: Deferred
  ecarule
    er : $ t/Transition p/Place m/Integer
           ON Ask fireTransition[t]
           IFNEW (t in Enabled) and 
                 (p in ConnectedPlace[t]) and
                 (m = M(p)+IM(p,t))
           DO Retell (p marks m) $
end

In essence, ConceptBase is expressive enough to define modeling methods like classical Petri nets. In fact, the complete specification of the classical Petri net method easily fits on one page. A commented version with example and graphical types is provided in the CB-Forum.

Other dynamic modeling languages like event-process chains can be handled in a similar way. If you have already defined Petri nets, you can even define (simple) event-process chains as specializations of Petri nets and get an execution environment for event-process chains for free.

By dedicating special graphical types to the different places, one can also display the Petri net for traffic lights in a way that is mimicking the style of real traffic lights. The two small circles above the traffic lights are actually the two places safe1 and safe 2 from the above Petri net. Links between places and transitions are omitted. The two traffic lights are modeled as containers. Hence, the 2nd graph is just an alternative visualization for the very same Petri net displayed in the first graph. See CB-Forum for instructions on how to configure CBGraph to directly fire enabled transitions by clicking them in the graph.

Click actions

CBGraph also supports so-called click actions, allowing direct interaction of the graph with the underlying ConceptBase server. See here for details. Click actions are names of active rules associated to a node in a graph. Thus, one click on such a node shall trigger the associated active rule with the selected node as parameter.

BPMN as Petri net

Executable BPMN model with parallel gateway

Process modeling notations like BPMN can be mapped to equivalent Petri nets and thus inherit their token flow semantics. The specification of some core elements of BPMN in ConceptBase is available at the CB-Forum. It uses specialization and rules to map the BPMN elements to Petri nets. Hence, only deduction is used to specify the Petri net that encodes the semantics of the BPMN model. Some BPMN constructs can directly be assiciated to their Petri net counterparts via specialization:

TransitionLike isA BPMN_Element,GTransition end
PlaceLike isA BPMN_Element,GPlace end
BPMN_Activity isA TransitionLike  end
BPMN_Event isA PlaceLike end

Executable BPMN model with event-based gateway

Other constructs are mapped via deductive rules. For example, if two BPMN activities a1 and a2 directly follow each other via a 'next' link, then this link is interpreted as the place in between a1 and a2. In the ConceptBase specification, places are represented as instances of GPlace and transitions as instances of GTransition. The first diagram shows the derived instantiations for activities t1 and t2. The link in between is an instance of GPlace via the following deductive rule:

  $ forall a1,a2/TransitionLike link/BPMN_Element!next
      From(link,a1) and To(link,a2) ==> (link in GPlace) $

The flows between the places and transitions interpreted from the BPMN model are also derived by rules. For example, the flows from t1 to the link serving as place and then to t2 are both derived. The underlying Petri net language based on GPlace and GTransition defines the semantics of firing a transition by an active rule like shown above for classical Petri nets. This makes a BPMN model encoded with the BPMN definition in ConceptBase executable. CBGraph can thus also execute BPMN models. The Petri net embedding can also be applied to other process notations such as state transition diagrams and event-process chains. All diagrams on this page are "click to play", i.e. you can directly start and execute them if you have installed ConceptBase and associated CBGraph as helper application for graph files.


http://conceptbase.cc -- Contact: M. Jeusfeld, University of Skövde, Box 408, S-54128 Skövde, Sweden
2024-01-30/M.Jeusfeld


Get ConceptBase.cc at SourceForge.net. Fast, secure and Free Open Source software downloads