1 Reply Latest reply on Jul 5, 2016 11:39 AM by Abhijit Humbe

    How to get the deploymentId of a Process definition

    Tamás Járvás Newbie



      I started to implement a web application with jBPM 6.3.0.Final integration, which will be running in JBoss. I already have a running instance of jbpm-console in another JBoss. My current setup is:

      - processes can be designed in the jbpm-console webapp. In the jbpm-console, if a project is deployed, it is also deployed to our own Nexus repository.

      - as a result, I just have to add my deployed project as a dependency in my webapp's POM (with the current version) and I can access it, because my jBPM runtime uses the newClasspathKmoduleDefaultBuilder() and it founds my kmodule kjar in my classpath

      - I am not using the REST API, except for one feature: I would like to show the SVG image of the process instances in my webapp on a task form. For this, I am configured everything, so I am able to access the generated SVG files at the url: {jbpm-console-url}/rest/runtime/{deploymentId}/process/{processDefinitionId}/image/{processInstanceId}


      This last thing works great, if I hardcoded the url. I am able to get the Process.getId() for the processDefinitionId. Also I have the Task.getTaskData().getProcessInstanceId() for the processInstanceId variable on the Task form. But I wasn't able to get the deploymentId, which is a Maven GAV. Of course I don't want to hard-code it, because later there could be multiple deployments and also in case of a version change, I only want to change my web app POM, not the code.


      So in short, I would like to get the deploymentId (GAV) from a Process.


      I tried to list the available deployments found in the classpath, but I didn't found any way to do it. The only thing I found is the KieServices.Factory.get().getRepository() where I can see in debug mode the stored KieModules, but there is no interface to get them.



        • 1. Re: How to get the deploymentId of a Process definition
          Abhijit Humbe Master

          You can use following REST API to findout deploymentID










              <outcome xsi:nil="true" />




              <external-id>com.example.01652020:Project1:1.02</external-id>   <--DeploymentID




          share thoughts on this approach.