Search code examples
embeddesignerjbpm

jBPM6 - embed web designer in existing application


Are you aware of any guide / tutorial / example project that might help me embed the jBPM web designer in an existing web application? Namely:

  • Which are the maven libraries I need to include?
  • Is it possible to deploy the designer specific components in the main application WAR (this is after all what embedded means)?
  • How can I access the designer? Is there a specific URL for it?

Thanks in advance for any hint.


Solution

  • I finally found out how to do it.

    What you need is a running instance of the KIE workbench (seems this was once formerly called Drools Guvnor). You can get a demo system up and running very fast using the jBPM installer. A written guide on how to do it can be found here. In my case I downloaded the jbpm-6.1.0.Final-installer-full.zip from here.

    As soon as you have the JBoss AS/WildFly with the KIE workbench running you can access it through http://localhost:8080/jbpm-console/.

    Now each BPMN process saved in the KIE workshop seems to have a unique path which is also a Git repository URL. When you open a diagram and go to the metadata tab this path is listed as URI.

    To display this BPMN process inside a custom-built web application with the jBPM Designer BPMN 2 editor, just create an iframe HTML element with that URL in it like the following example:

    <html>
      <head>
        <title>Test</title>
      </head>
      <body>
    
        <h1>Test</h1>
        <p>Editor frame below:</p>
        <iframe height='800' src='http://localhost:8080/jbpm-console?standalone=&path=git://master@jbpm-playground/HR/src/main/resources/hiring.bpmn2' width='1000'></iframe>
    
      </body>
    </html>
    

    As soon as you load that page, the editor will be embedded into the page via that iframe. This works even with a static HTML page without a web server, so it should be quite versatile and your web application surely doesn't need to run inside the same JBoss AS/WildFly instance and doesn't even need to be written in Java.

    What I did not figure out so far is how to create new BPMN processes via some kind of API, which could then be edited within the standalone web application. Also I don't know how access control is supposed to work yet.