DCR Active Repository

DCR Active Repository

The purpose of the DCR Active Repository is to make it easy to leverage DCR Graphs as the rules foundation for an Adaptive Case Management system.

Now you can access your DCR graphs from a RESTful API currently supporting these functions.

  • Create a DCR Graph
  • Update a DCR Graph
  • Get a DCR Graph
  • Instantiate a DCR Graph for simulations and instances
  • Get information about instance status, i.e. whether the process is completed or not. We refer to this as “isAccepting”
  • Get Enabled or Pending Events of a DCR Graph instance
  • ExecuteEvent of a DCR Graph instance
  • Advance time of a DCR Graph instance

Using the RESTful API we’ll implement all elements of the RESTful API supporting collections of graphs, graph instances and events. Using the RESTful API graphs can be modified, instantiated, executed etc.

An example of how to use DCR Active Repository using the Postman tool can be found here.

Access to DCR Active Repository requires your DCR username and password and use http basic authentication. Access to the repository requires a commercial license.

An overview of the API is shown below. Refer to DCR Active Repository API reference for details. The engine API interface outlines the programmatic interface.

DCR graphs
*List URIs of graphs, id and titles in collection. Filter options exists to search/filter specific graphs. Optional parameters are:
title=title – will search for graphs containing “title” in title
sort=title (default) –
sort graphs by title or other fields
sort: can be title, id, created, modified
orderby: asc or desc
NA *Create a new DCR graph, returning the id. A DCR Graph is described using DCR XML NA
DCR graph
*Retrieve the DCR graph represented as DCR XML
If sending the parameter “?LatestMajor=true” the repository will return the latest major version of the graph..
*Update the DCR graph using DCR XML NA Remove the graph
DCR graph versions
*Retrieve the versions of the DCR graph as outlined below.
Using the parameter “?Versions=major or All” a list of versions will be returned as outlined in below.
NA Compare two DCR graphs. Initially send DCR XML of both graphs for comparison – later pass version ids as parameters. NA
DCR graph version
*Retrieve the version XML of the specific DCR graph.

Future: If “?RevisionXml=true” it does not return the graph xml but the comparison of the latest major revision.

DCR graph meta data
*Retrieve meta data about the specific DCR graph. XML example below. NA NA NA
DCR graph instances
*Retrieve the DCR graph instances, i.e. instance id (simid) and title. Various filters exists to retrieve representative and swimlane graphs:
isScenario=true or false – if true returns only scenarios (representative graphs)
Format=DCRXMLLog – optional, only used if DCR XML Log format is needed.
Format=XES – optional, only used if XES format is needed.Filename=log.xml – optional filename
NA *Instantiate a DCR graph returning a new instance ID (simid). An optional Title of the simulation can be provided.
API enhanced and now support creating multiple instances by important DCR XML Log which creates multiple instances at the same time. Use parameter Log to enable import.
LatestMajor=true” is defined the instance will be based on the latest major version of the graph. Initialization time can be given in JSON body as outlined below.
DCR graph instance
*Retrieve the DCR graph instance
A filter exists, ?filter=isAccepting, which will return true or false depending on whether the DCR Graph instance is accepting or not
*Parameter ?complete=true will mark the simulation as completed, complete=false will un-complete the simulation
Parameter ?Title=… will update the title of the simulation
*Parameter ?Log=… – will update the simulation *Delete the instance
DCR graph instance events
*Retrieve the events of the DCR graph instance
Filter must be provided to search/filter specific instances
NA *Create a new event in the graph using the XML in the body illustrated below under events NA
DCR graph instance event
**Retrieve the DCR graph instance event *Mark the event as excluded
Use “?filter=exclude”
*Execute the event

If you add “?filter=note” to the URL you can post a note with the event. This note will be saved as a comment in the DCR XML Log.

The role of the event can be passed in the body of the call as a JSON parameter:



*Delete the event
DCR graph instance relations
*Retrieve the DCR graph instance relations NA *Create a new relation *Delete a relation given sourceId, targetId and relation type
DCR graph time
NA NA *Set absolute time in graph as outlined in body (see details below). NA
DCR graph categories
Get list of categories NA Create a new category
DCR graph categories
Retrieve specific category NA Update category Delete category
DCR graph categories
Retrieve graphs for specific category NA NA NA

Notice: The list of URLs is not complete and not everything is implemented at the moment. We’ve marked working areas with an asterisk (*).

DCR Graphs are represented using DCR XML which is the output of the DCRGraphs.net designer tool. DCR XML is used both for classes and instances of processes.

The list of graphs returned contain the following data:


<graph id=”1234″ title=”My first graph” />

When you initialize a graph you can provide the initialization time in the JSON body together with the title of the new instance:

{Title: “PostMan Simulation”,
The list of roles returned contain the following data:
<role title=”user” description=”This is the user” />
<role title=”responsible” description=”The responsible person” />

The list of events returned contain the following data:

<events isAccepting=”true|false” nextDeadline=”…” nextDelay=”…” phase=”…”>

<event id=”Activity 3″ included=”true” enabled=”true” pending=”false” executed=”false” fullPath=”Activity 3″ roles=”” groups=”” description=”” label=”Activity 3″ eventType=”” />
<event id=”Activity 5″ included=”true” enabled=”true” pending=”false” executed=”true” fullPath=”Activity 5″ roles=”” groups=”” description=”” label=”Activity 5″ eventType=”” />
<event id=”Activity 6″ included=”true” enabled=”false” pending=”true” executed=”false” fullPath=”Activity 6″ roles=”” type=”…” referId=”…” groups=”” description=”” label=”Activity 6″ eventType=”” />

The “type” attribute can be “subprocess”, “form”, “nesting”, “instance” or just empty.

The referId attribute points to a graphId – only supported for DCR Forms.

The Execute event takes optional data parameters in the form:
{DataXML: ‘<globalStore><variable id=”‘eventid'” type=”…” value=”…” isNull=”true|false”/> </globalStore>’,
Role: ‘role }

The set absolute time of a graph post the following data in the body: <absoluteTime>ISO 8601 time here</absoluteTime>.
Notice – time must be GMT+0, i.e. not local time zone. Format is ISO 8601, i.e. yyyy-mm-ddTHH:MM:ssZ etc.

The data should be in JSON format so in fact we send e.g.

time: ‘<absoluteTime>2018-09-05T10:40:27.9197330Z</absoluteTime>.‘ }

Deleting relations take the following JSON structure as a body:
{ sourceId:”Activity1″, targetId:”Activity0″, type: “condition” , }

type is the relationType which can be one of the following values “condition”, “response”, “include”, “exclude”, “milestone” or “spawn”.

The RESTful API will be expanded to include all events and relations of graphs as well as simulations/instances, thereby enabling adding, updating and removing events and relations directly.

Versions are returned in the following XML:
<versions >
<version id=”64774″ type=”major” title=”First major version” date=”2018-10-01” user=”6″ />
<version id=”64772″ type=”minor” date=”2018-10-01” user=”4″ />
<version id=”64770″ type=”minor” date=”2018-10-01” user=”4″ />

We’ve created a Windows application for DCR Active Repository that you can use to experiment with the DCR Active Repository. The source code in C# is available for download.

Meta data about a graph returns the following XML:

<graph id=”4013″ title=”Expense – milestone – good coding practice”>
<Collection id=”1952″ title=”DCR Academy” ></Collection>
<Category id=”2252″ title=”DCR Academy – Public Repository” >
<user id =”107″ UserName=”hnor” ModeOfSharing=”CanEdit”></user>
<user id =”1526″ UserName=”lopez@itu.dk” ModeOfSharing=”CanEdit”></user>
<user id =”4″ UserName=”marquard” ModeOfSharing=”CanEdit”></user>
<Owner id=”4″ UserName=”marquard” OrganizationId=”1″ Organizationtitle=”Community” ></Owner>
<user id=”42″ UserName=”Hamza.Ahmad” ModeOfSharing=”CanEdit” ></user>

Accessing this API requires a commercial license.