cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti on Karaf + Camel

cmoulliard
Champ in-the-making
Champ in-the-making
Hi,

Based on the example of Activiti In Action, I have deployed succesfully Activiti (engine, process, task, commands) on Apache Karaf and that works fine.

Questions :

- How can I OSGI extend the example to use activiti-camel deployed on karaf too ? I think that a simple camel route should be enough like
from("timer://activiti").log("").("activiti:????").log("display result of BPMN process called : ${body}");
What do I need to put instead of ???? to call the process running as a bundle
- Is it possible to deploy the modeler/explorer as a war on karaf ? Where can I find such a war ?

Regards,

Charles
5 REPLIES 5

trademak
Star Contributor
Star Contributor
Hi Charles,

- to start a new process instance of a specific process definition you could use ("activiti:camelProcess") where camelProcess is the process definition key. Is that what you are looking for?
- didn't try that yet, but I know some people successfully deployed the Explorer on Karaf. Did the default WAR in the Activiti download not work?

Best regards,

cmoulliard
Champ in-the-making
Champ in-the-making
Hi Tijs,

- I have been able to run an example using activiti-camel on karaf. Will share that info later on
- Deploying the WAR like that on karaf was not successful (due to spring issue with AOP). So I have started to create a project (activiti-wab-explorer2) to deploy the WAR as a bundle (reason why the name is wab) without all the libs that normally we have under WEB-INF/lib. That works fine. I will create a ticket to provide the project + code. The only issue that I have now is when I click on 'edit' button to create using the WYSIWIG editor a process/task/BPMN, I get this exception :

2013-05-22 19:51:55,888 | INFO  | qtp1118598848-66 | LogService                       | org.restlet.engine.log.LogFilter  120 | 205 - org.restlet - 2.0.15.0 | 2013-05-22 19:51:55 127.0.0.1 - 127.0.0.1 8181 GET /activiti-explorer2/service/editor id=47 204 0 0 1 http://localhost:8181 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31 http://localhost:8181/activiti-explorer2/VAADIN/widgetsets/org.activiti.explorer.CustomWidgetset/DAF...
2013-05-22 19:51:55,890 | ERROR | qtp1118598848-66 | Server                           | ngine.http.adapter.ServerAdapter  210 | 205 - org.restlet - 2.0.15.0 | An exception occured writing the response entity
java.lang.NullPointerException
at org.restlet.engine.io.BioUtils.copy(BioUtils.java:75)[205Smiley Surprisedrg.restlet:2.0.15.0]
at org.restlet.representation.InputRepresentation.write(InputRepresentation.java:148)[205Smiley Surprisedrg.restlet:2.0.15.0]
at org.restlet.engine.http.ServerCall.writeResponseBody(ServerCall.java:553)[205Smiley Surprisedrg.restlet:2.0.15.0]
at org.restlet.engine.http.ServerCall.sendResponse(ServerCall.java:491)[205Smiley Surprisedrg.restlet:2.0.15.0]
at org.restlet.ext.servlet.internal.ServletCall.sendResponse(ServletCall.java:462)[206Smiley Surprisedrg.restlet.ext.servlet:2.0.15.0]
at org.restlet.engine.http.adapter.ServerAdapter.commit(ServerAdapter.java:200)[205Smiley Surprisedrg.restlet:2.0.15.0]
at org.restlet.engine.http.HttpServerHelper.handle(HttpServerHelper.java:154)[205Smiley Surprisedrg.restlet:2.0.15.0]
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1031)[206Smiley Surprisedrg.restlet.ext.servlet:2.0.15.0]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)[94Smiley Surprisedrg.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.2]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)[104Smiley Surprisedrg.eclipse.jetty.servlet:7.6.8.v20121106]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1329)[104Smiley Surprisedrg.eclipse.jetty.servlet:7.6.8.v20121106]
at org.activiti.explorer.filter.ExplorerFilter.doFilter(ExplorerFilter.java:44)[217:wrap_mvn_org.activiti_activiti-explorer_5.13-SNAPSHOT:0]

Regards,

Charles
Apache Committer

trademak
Star Contributor
Star Contributor
Hi Charles,

Great!
I think the issue you see is related to the EditorRestResource implementation that's in the activiti-modeler module. That contains the following line:

<blockcode>
InputStream editorStream = this.getClass().getClassLoader().getResourceAsStream("editor.html");
</blockcode>

That doesn't work in an Osgi container I suspect. Maybe you can change that line?

Best regards,

cmoulliard
Champ in-the-making
Champ in-the-making
Changing the line to

    InputStream editorStream = Thread.class.getClassLoader().getResourceAsStream("editor.html");

is not enough as the editor.html file is defined under the activiti-webapp-explorer2 but used by activiti-modeler

cmoulliard
Champ in-the-making
Champ in-the-making
Will have a look.

I have also discovered that some resources like test.svg, kermit.jpg, froggie.jpg, … are missing from the project activiti-explorer (DemoDataGenerator). Don't know the reason

So I have also commented them or done some modifs in the code

        createUser("kermit", "Kermit", "The Frog", "kermit", "kermit@activiti.org",
                null,
                Arrays.asList("management", "sales", "marketing", "engineering", "user", "admin"),
                Arrays.asList("birthDate", "10-10-1955", "jobTitle", "Muppet", "location", "Hollywoord",
                        "phone", "+123456789", "twitterName", "alfresco", "skype", "activiti_kermit_frog"));

        createUser("gonzo", "Gonzo", "The Great", "gonzo", "gonzo@activiti.org",
                null,
                Arrays.asList("management", "sales", "marketing", "user"),
                null);
        createUser("fozzie", "Fozzie", "Bear", "fozzie", "fozzie@activiti.org",
                null,
                Arrays.asList("marketing", "engineering", "user"),
                null);

AND

            try {
                InputStream svgStream = this.getClass().getClassLoader().getResourceAsStream("org/activiti/explorer/demo/model/test.svg");
                if(svgStream!=null){
                repositoryService.addModelEditorSourceExtra(model.getId(), IOUtils.toByteArray(svgStream));
                }
            } catch (Exception e) {
                LOGGER.warn("Failed to read SVG", e);
            }

            try {
                InputStream editorJsonStream = this.getClass().getClassLoader().getResourceAsStream(jsonFile);
                if (editorJsonStream != null) {
                    repositoryService.addModelEditorSource(model.getId(), IOUtils.toByteArray(editorJsonStream));
                }
            } catch (Exception e) {
                LOGGER.warn("Failed to read editor JSON", e);
            }