Modeler for fragment-based case models
View the Project on GitHub bptlab/gryphon
Getting Started
Local Installation
Prerequisites
Initial Setup
Running gryphon
Using Gryphon in Docker
Creating a Case Model
Creating and editing fragments
Supported Modeling Elements
Syntax for Timer Events
Process variables
Fragment Pre-Conditions
Defining the Data Model
Termination Conditions and Case Start Triggers
Event integration
The following software is necessary to build and run the editor:
npm
)npm install -g node-gyp
on the command line, e.g. cygwin or Window cmd
sudo apt-get install build-essential
npm install -g browserify
npm install -g grunt-cli
bin
directory to your path (default directory is C:\Program Files\MongoDB\Server\3.4\bin
)git clone https://github.com/bptlab/gryphon.git on the command line
)
zoo
and clone into zoo/gryphon
npm install
(in the gryphon directory) to set up all additional dependency packages.grunt config
(in the gyphon directory) to copy both config examples and to give them the correct names.zoo/mongodata
mongod --dbpath ../mongodata
on the command line (if your data directory is somewhere else, be sure to adapt the path accordingly)mongo
client by running mongo on the command lineuse gryphondb
config.js
by editing the property MONGODB_HOST: 'mongodb://localhost/YOUR_DATABASE_NAME
grunt
(in the gyphon directory) to build the UI files and to compile all script sources.bin/www
on the command line.Once your environment is set up, you can start the editor as follows
mongod --dbpath ../mongodata
on the command line.bin/www
on the command line.FOR ALL PEOPLE WHO JUST WANT TO USE THE EDITOR IN AN EASY AND WINDOWS COMPATIBLE WAY READ THIS: If you just want to run the editor, instead of modifying it (even though that doesn’t really matter, you could also edit it this way, just the building part will take longer), you can run the whole thing in a docker container in 3 easy steps:
Step One: Grab a cup of coffee. Step Two: Install Docker. Step Three: Run “docker build -t griffindocker .” Step Four: Grab another cup of coffee. Step Five: Run “docker run -p 3000:3000 -it –rm –name griffin griffindocker”
You can create a new case model by clicking the “Create a scenario”-Button in the Gryphon sidebar.
A case model consists of:
When you create a new case model, a first fragment is automatically created as well. You can rename that fragment in the sidebar.
Naming conventions
The names of case model elements (fragments, data classes, attributes, task names etc.) can contain only alpha-numeric characters, underscores and spaces. The first and last character need to be alpha-numeric. There may not be more than 1 non-alphanumeric character in a row. This is checked by the following regular expression: ^([a-zA-Z\d]|[a-zA-Z\d](?!.*[ _]{2})[a-zA-Z\d _]*?[a-zA-Z\d])$
.
You can create new fragments on the case overview page, as well as give them a descriptive name.
You can edit fragments by selecting it in the sidebar, or in the case overview page. In the integrated bpmn.io editor, you can define the execution steps in BPMN language.
Although the bpmn.io editor offers a variety of types for events and activities, e.g. user task, conditional start event, most of these elements are not supported by the execution engine Chimera. Using them might cause the deployment to fail. The following elements are supported:
DC1[state2]
)Some modeling constructs have additional attributes in the properties panel. For example, service tasks have attributes for the URL of the webservice to call, the http method, the body, and so on.
The syntax for timer events follows the ISO 8601 standard. However, only durations are supported. The timer expression has to be provided as a property of the timer event. An example for a timer expression is P1DT2H5M25S
, which means a duration of one day, 2 hours, 5 minutes and 25 seconds.
Offering support for fixed points in time would only make sense, when the time could be set programmatically. Otherwise, such an event could occur only once and once it is past, it would never occur, even in newly created cases.
Variables allow to access the case data in gateways, service tasks, and send tasks.
The branches leaving a XOR split can be annotated with an expression that evaluates to true or false. Basically, there are two types of expressions: 1) data object state conditions and 2) attribute value conditions. The former check the state of a data object, while the later check attribute values. To refer to a data object, use a hash symbol followed by the data class name, an equality operator and a state, e.g. #Application = rejected
. To access attribute values, use the dot-notation, i.e. #Application.amount <= 5000
. Only those branches for which the expression yields true are control-flow enabled.
To express that a fragment, and thus its activities, should only be enabled when the case is in a certain state, conditional start events can be used. The label of the event should contain an expression that specifies which data objects need to be in which state for the fragment to be enabled, e.g. Customer[verified]
.
In order to use data objects in the fragments, their corresponding data classes have to be defined in the domain model. The domain model for a case can be reached via the sidebar. In the domain model, you can create new data classes and event types.
For each class, you can define attributes with data types.
Also, you can define object life cycles. These represent the possible data state transitions that can occur during the execution of the case.
The object life cycles will be checked against the modelled data flow when saving a fragment. The user will be warned, if a state or state transition is found, that was not modelled in the object life cycle.
In the case overview, you can add termination conditions and case start triggers.
Case models can have several termination conditions defining the goal state(s) of the case. When the case execution fulfills one of the termination conditions it can be terminated by the user. Termination conditions consists of one or more atomic data object state conditions that are pairs of a data class name and one of its states, e.g. Application[accepted]
. Several of those data object state conditions are separated by a comma, meaning that all of the conditions, i.e. their conjunction, has to be fulfilled, e.g. Application[accepted]
, Customer[verified] means that application is in state accepted and the customer is verified.
Case start triggers are used to automatically create a case whenever a specific external event occurs. Each start trigger contains an Esper EPL query that is registered with the event processing platform Unicorn. When an event matching this query occurs (and is detected by Unicorn) the Chimera engine is notified and a case is instantiated. Additionally, data classes can be defined, data objects of which will be automatcally instantiated in the specified state. Also, data contained in the event notification can be mapped to attributes of the instantiated data objects. For each attribute that should instantiated the user has to provide a JsonPath expression that will be applied to the event notification and the result will be stored in the selected attribute. In this way, event data can be used inside a case by mapping.
In fragments, events can be modelled with BPMN message receive events. You can add an event query to these events in the fragment sidebar. The event query is registered in a running instance of the Unicorn plattform. Once it triggers, the BPMN event will be triggered as well.
Similar to case start triggers, you can also define data attribute values that should be saved from events. To this end, you have to add outgoing data objects to the event. In the fragment sidebar, you can then add JSONPath expressions for the data attributes.
Further reading about event integration can be found in the bachelor thesis of Jonas Beyer.
In the case overview, case models can be deployed to running Chimera instances. In the export window, export targets for running Chimera instances can be defined by clicking the “Add target” button.
See the Chimera documentation for further information on the execution of cases.
If running npm install fails: Check whether you have installed all build-essentials (Otherwise run: sudo apt-get install build-essential
) Run: sudo npm install -g node-gyp
Try again.
When running on Windows, make sure to have the following additional dependencies installed:
Q: Why does the gryphon modeler does not let me create my case model. A: Be sure to name them correctly, see naming conventions.