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.

Building blocks of Petri nets

Petri nets are composed of two main components.

Transitions (squares) and places (circles)

A place can contain tokens (resources of places, a discrete number of marks)

Transition

Place

Basic rules

Transitions and places are connected with arc (directed line). 

Arcs can connect places with transitions or transitions with places.

It is impossible to connect the transition with transition or place with the place. This is due to the fact that Petri Nets are bipartite graphs.

You can connect multiple places with one transition.

Same way you can connect multiple places with one transition.

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. For more info please consider reading our research paper on this topic.

Transitions in Petri nets are executable only in the case that all basic firing conditions are fulfilled

As we can see places p26 and p27 both contain a single token. That’s enough to make transition executable.

In this case we can see, that transition is not executable because place p1 is missing a token.

Transition will not be executable until both places p1 and p2 contain at least one token.

The basic characteristic of arcs is their multiplicity (cardinality). The default multiplicity of every arc is one. That can be changed to any discrete number.

 

 

Firing rules with multiplicity

  • Input places have to contain at least as many tokens as the
    the 
    multiplicity of the corresponding input arc.
  •  
  • Transition removes as many tokens from input places as the multiplicity of the corresponding input arc.
  •  
  • Transition creates as many tokens in output places as the multiplicity of the corresponding output arc.

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. multiplicity of arc.

Example

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).