Categories
#DCR XML #Import process model JSON or XML

Simple JSON and XML for import of process models

Creating DCR process models using the DCR XML is not as easy as we would like. In order to support graphical editing of the DCR process models in DCR Whiteboard, the XML has been extended making it more difficult to create DCR process models.

In order to ease creating DCR process models is 3rd party tools we created a simple and easy to use DCR JSON and XML import format.

Example JSON and XML is found on the links. A simplified JSON example is outlined below:

{
    "DCRModel": [
       {
          "title": "Import App test",
          "description": "DCR Process",
          "type": "DCRModel",
          "roles": [
             {
                "title": "Employee",
                "description": "employee description",
                "specification": "Employee speficiation"
             }
          ],
          "events": [
             {
                "id": "Case",
                "label": "The expense report",
                "description": "",
                "purpose": "Purpose",
                "guide": "guide",
                "type": "subprocess"
             },
             {
                "id": "FilloutExpenseReport",
                "label": "Fill out an expense report",
                "roles": "Employee",
                "datatype": "money",
                "parent": "Case"
             }
          ],
          "rules": [
             {
                "type": "condition",
                "source": "FilloutExpenseReport",
                "target": "Approve"
             },
             {
                "type": "response",
                "source": "FilloutExpenseReport",
                "target": "Payout",
                "description": "You must payout within a week",
                "duration": "P7D",
                "guard": "FilloutExpenseReport@executed"
             }
          ]
       }
    ]
 }

DCR Process Model Import

Importing the simple JSON or XML format is done in the DCR Process Model Import App you find in the DCR Appstore.

Before you can use the App you must enable it. Go to the Appstore and click enable under All.

Simply open the App

and click Choose File:

The logic will read the JSON or XML file and show a list of the objects found, e.g. roles, activities and rules:

Click Import to import the process model.

DCR Highlight JSON

The DCR Highlight XML also exists in a simplified JSON format outlined below:

{
  "type": "Model",
  "title": "Simple Highlight JSON",
  "layers": [
    {
      "name": "description",
      "text": "A to B",
      "defaultLayer": true
    },
    {
      "name": "law",
      "text": "§54 When the case worker receives a call he must log it",
      "defaultLayer": false
    }
  ],
  "highlights": [
    {
      "type": "activity",
      "highlights": [
        {
          "layer": "default",
          "start": 0,
          "end": 1,
          "text": "A"
        },
        {
          "layer": "law",
          "start": 36,
          "end": 40,
          "text": "call"
        }
      ],
      "graphElement": [
        "Activity0"
      ]
    },
    {
      "type": "activity",
      "highlights": [
        {
          "layer": "default",
          "start": 5,
          "end": 6,
          "text": "B"
        }
      ],
      "graphElement": [
        "Activity1"
      ]
    },
    {
      "type": "rule",
      "highlights": [
        {
          "layer": "default",
          "start": 2,
          "end": 3,
          "text": "to"
        },
        {
          "layer": "law",
          "start": 4,
          "end": 8,
          "text": "When"
        }
      ],
      "graphElement": [
        "Activity0--condition--Activity1",
        "Activity0--response--Activity1",
        "Activity0--include--Activity1"
      ]
    }
  ]
}

Related Release notes

No related documentation found.

Related Videos

No related videos found.

Related Articles

Exformatics Declarative Case Management Workflows as DCR Graphs

LinkedIn
Share