-
1. Re: How to start a process (developed in BPMN2 Modeler) in a CDI application based on jBPM 6.2?
clp207 May 6, 2015 8:13 AM (in response to awizenm)Michael,
The RuntimeEnvironment producer is mainly for pre 6.2 environments. The recommended approach in 6.2 is to package your process as a kjar in maven. This page and accompanying 6.2 examples are a good reference examples (Upgrade of jbpm-6-examples to jBPM 6.2 services | Jiri Svitak). The StartupBean in his examples replaces the EnvironmentProducer for deploying services.
Once your process is packaged as a kjar, then your first two lines should find the artifact and deploy it correctly.
-
2. Re: How to start a process (developed in BPMN2 Modeler) in a CDI application based on jBPM 6.2?
awizenm May 7, 2015 3:38 AM (in response to clp207)Hi Chris,
thank you for your suggestion.
OK then. I will package my process as kjar and install it to my local maven.
I have created my process with BPMN2 Modeler.
How to package a process definition as kjar?
I miss this crucial information in the 6.2 documentation.
-
3. Re: How to start a process (developed in BPMN2 Modeler) in a CDI application based on jBPM 6.2?
awizenm May 7, 2015 8:05 AM (in response to awizenm)Many thanks to Chris and Francesco
Deploying a kjar is not that difficult...
To work with my process definition file as desired I have placed it in a separate minimal maven project.
The most important thing is to add those lines to the pom of the new project:
<packaging>kjar</packaging> <properties> <jbpm.version>6.2.0.Final</jbpm.version> </properties> <build> <plugins> <plugin> <groupId>org.kie</groupId> <artifactId>kie-maven-plugin</artifactId> <version>${jbpm.version}</version> <extensions>true</extensions> </plugin> </plugins> </build>
Eclipse complains about the plugin line, but installing of the kjar to maven works anyway.
Now I can design my process using BPMN2 Modeller in my Luna Eclipse.
Deployment with KModuleDeploymentUnit works as desired.
KModuleDeploymentUnit deploymentUnit = new KModuleDeploymentUnit("com.sample", "myProcess", "1.0"); deploymentService.deploy(deploymentUnit); Map<String, Object> params = new HashMap<String, Object>(); params.put("potentialOwner", "userA"); long processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "myProcessId", params);
As a next step I will move the deployment lines to the StartupBean.
Enclosed see my minimal project for process deployment.
-
myProcess.zip 8.2 KB
-