Petriflow fundamentals

“The Petrifow language was created for purpose of taking advantage of the simple nature of Petri nets and extend them to meet any requirements of the real-life business modelling.” (From the article about Petriflow) Petri nets are capable of iteration, concurrent execution and  they  enable choice  making. Unlike many  current  business modelling  languages, Petri nets  have an exact  mathematical  definition.

Cornerstones of Petri nets

Transition

Petri nets are composed of two main components: transitions (squares) and places (circles). Transition is connected to place by an arc (directed line) and vice versa. A place can contain tokens (resources of places, a discrete number of marks). A transition can be in two states: executable on non-executable. 

Place

Basic rules

1. Arcs can be used only with the purpose to connect places with transitions or transitions with places. It is impossible to connect the transition with transition or place with the place. Petri nets are directed bipartite graphs.

2. You cannot connect two places or transitions. But you can connect multiple places with one transition or connect multiple transitions with one place.

3. “In classical Petri nets, firing a transition is one atomic event. During this event, a transition consumes tokens from connected input places and produce tokens to output places. The number of consumed and produced tokens is according to the firing rule in original Petri nets.” (From the article about Petriflow)

4. Transitions in Petri nets are executable only in the case that all basic firing conditions are fulfilled. This can be simply demonstrated in the net where two places are connected into one transition. Transition is not executable until both places contain at least one token.

In this case, a transition is enabled only if all places connected to it (inputs) contain one or more tokens. You can imagine transitions as events and places as states. Transitions are waiting to be executable till places will fulfil all necessary conditions.

5. The basic characteristic of arcs is their multiplicity (cardinality). By default, the multiplicity of every arc is one. That can be changed to any discrete number.  How is multiplicity changing enabling and firing rules?

Firing rules:

1.)Input places have to contain at least as many tokens as the
the 
multiplicity of the corresponding input arc.

2.)Transition removes as many tokens from input places as the cardinality of the corresponding input arc

3.)Transition creates as many tokens in output places as the cardinality of the corresponding output arc

6. Arcs can be used between place and transition in both directions in the same pair. During the firing event token from the place is taken by input arc, but in this case, it is also given back by output arc. All other basic rules are applied even in this case, e.g. cardinality of arc.

Summary

An instance of this process will allow you to fire the transition “Take” max. five times. You can imagine any sort of real-life process that can be hidden behind this net: cashier working with five products, bus driver taking max. five people into the bus. In Netgrif Application Builder, you can add forms that these people will fill and application is created. (Link to a XML file)

In this blog, you have seen all the basic rules that are necessary to know before you start working with Petriflow modelling. What is our conclusion? That by knowing only this few information, you can create simple yet powerful applications. What to do now? Add data, forms and roles and you can deploy your application. Check our simple guide (NAB tutorial) how to add data and roles and you are ready! Please check also a guide on how to deploy your model into the NAE environment (NEA tutorial).