cancel
Showing results for 
Search instead for 
Did you mean: 

Process instance diagram with REST api

tibere
Champ in-the-making
Champ in-the-making
Hi.

I'm trying to get a diagram instance for a given process, but everytime I'm getting a 404 (for any of my instances id).

Is there something specific that need to be configured when creating the process ? (In the API documentation, it's written that if the user is getting a 404 it is because the process definition does not contain DI information).

Thanks.

Julien
5 REPLIES 5

frederikherema1
Star Contributor
Star Contributor
What is the URL you're using? Does the process-definition actually contains graphical information (BPMNDI)?

Hi,

I'm using /service/process-instance/{processInstanceId}/diagram
How can I check that I have graphical information ?
When I'm using the activiti explorer and looking at all my instances, I can see the diagram of each instances. Is that what you mean by BPMNDI ?

frederikherema1
Star Contributor
Star Contributor
Check the XML of your processes. It should contain a section similar to this:


<bpmndi:BPMNDiagram>
    <bpmndi:BPMNPlane bpmnElement="Minimal" >
      <bpmndi:BPMNShape bpmnElement="_1" >
        <dc:Bounds x="15" y="91" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2" >
        <dc:Bounds x="95" y="88" width="83" height="48" />
      </bpmndi:BPMNShape>

Also, you can check if "isGraphicalNotationDefined" is true when requesting the process-definition via REST.

Where is defined the "isGraphicalNotationDefined" parameter ?

frederikherema1
Star Contributor
Star Contributor
See user guide: Paginated Request: GET /process-definitions?start={start=0}&size={size=10}&sort={sort=id}&order={order=asc}
{
  "data": [
    {
      "id": "financialReport:1",
      "key": "financialReport",
      "version": 1,
      "name": "Monthly financial report",
      "resourceName": "org/activiti/examples/bpmn/usertask/FinancialReportProcess.bpmn20.xml",
      "diagramResourceName": "org/activiti/examples/bpmn/usertask/FinancialReportProcess.png",
      "deploymentId": "10",
      "startFormResourceKey": null,
      "isGraphicNotationDefined": true                
    }
  ],
  "total": 1,
  "start": 0,
  "sort": "id",
  "order": "asc",
  "size": 1
}