Table of Contents
Getting started
DCR Active Repository provides a RESTful API to manipulate process models and simulations. This section will give an example of how to use the Postman tool to manipulate processs models and simulations.
We'll provide four examples
- Get a list of your process models in DCRGraphs.net
- Start simulation of a specific process model
- Get a list of enabled or pending events in the simulation
- Execute an event in a simulation
Download and install Postman and start the application.
![]() |
Get a list of your process models in DCRGraphs.net
Enter the URL https://repository.dcrgraphs.net/api/graphs in the URL line and set the action to GET. Then click Send.You'll then get a 403, access denied, back.
Click on "No Auth" and select "Basic Auth", enter username and password and click Update Request:
![]() |
Then click on Send again
![]() |
The list looks like this:
<graphs>
<graph id="1234" title="My first process model" />
...
</graphs>
Start simulation of a specific process model
Start a simulation by a POST to the following URL: https://repository.dcrgraphs.net/api/graphs/<graphid>/simsAs above, ensure username and password are provided.
Clicking SEND will give returncode 201 and the simulation id
![]() |
x-dcr-simulation-id -> 29535
The returncode is 201 on success.
Get a list of enabled or pending events in the simulation
To get a list of enabled or pending events for a simulation you must do a GET to the following URL: https://repository.dcrgraphs.net/api/graphs/<graphid>/sims/<simid>//events?filter=enabled-or-pending
![]() |
The events is returned in a format as outlined below:
<events isAccepting="true|false" nextDeadline="..." nextDelay="...">
<event id="Activity0" included="true" enabled="true" pending="false" executed="false" fullPath="Activity0" roles="" groups="" description="" label="Do some work" eventType="" /> </events>
The returncode is 200 on success.
Execute an event in a simulation
Executing an event is done by making at POST to the following URL: https://repository.dcrgraphs.net/api/graphs/<
graphid>/sims/<simid>/events/<eventid>
![]() |
Execute an event in a simulation with data
Executing an event is done by making at POST to the following URL: https://repository.dcrgraphs.net/api/graphs/<graphid>/sims/<simid>/events/<eventid>
When posting you need to pass the data value:{DataXML:'<globalStore><variable id="Data" value="1" isNull="false" type="int" /></globalStore>'}
![]() |
Notice: The value is XML send as a JSON object.
The returncode is 204 on success.
A comprehensive example
We've prepared a Postman project that can be downloaded from this location.
This example use process model 4013, expense report, check this link for details.
The process is shown below:
![]() |
When an employee fill out an expense report the money must be paid out within one week. After filling out the expense report the manager should approve the expense report. If the manager approves the expense report the money can be paid out by finance. If approval is awaiting manager approval payout cannot happen. If the manager rejects the expense report he must later approve the expense report in order to payout to happen. The employee can redraw the expense report. Doing so will close the case. Once payout has been done the case is closed and all activities are void.
Setting common authentication
The first thing to do is to set authentication for your Postman project.
![]() |
Fillout userid and password of your DCR account:
![]() |
Initialize simulation
The very first thing to do is to initialize the simulation, i.e. create an instance of the DCR process model. This is done using the InitializeInstance operation.
![]() |
Write down the X-DCR-Simulation-ID returned by the server, in the image 59443.
This is the ID of the simulation stored in DCR Active Repository and all URL's for getEvents, ExecuteEvents and setTime should be adjusted to host this id.
getEvents
Remember to adjust the URL using the simulation ID just returned from InitializeInstance.
![]() |
Remember to choose XML as format to view returned XML in an easy way.
ExecuteEvent - fill out expense report
Execute the Fill out expense report first.
![]() |
Then execute getEvents operation again
![]() |
Notice that the instance now have a deadline, nextDeadline, found in the XML, and that the event Approve is now pending.
ExecuteEvent - Approve
Exeucte the Approve event
![]() |
Then execute getEvents operation again
![]() |
Compare with the getEvents above - now the Payout event is enabled and pending.
setTime
Note the nextDeadline time from getEvents above and try to execute setTime.
![]() |
Then getEvents again
![]() |
Finally - Payout and the process stops
Execute Payout event
![]() |
Then execute getEvents to see the status.
![]() |
Notice that the process is not completed, as isAccepting is True.