[jBPM Users] - Process Definition gets deleted while starting new process i
by jbpmjboss11
Hello Everybody,
I am facing a problem with creating instance of a process. I have two applications pointing to same JBPM schema. One project deploys my JBPM processes which I can also see through my JBPM console, that works. Other project creates multiple instances of the deployed process definition.
Now, in other project when I try to start process instance my process definition gets deleted while processing below statement
processInstance = executionService.startProcessInstanceByKey("myjbpm",variables);
and get the following exception -
org.jbpm.api.JbpmException: no process definition with key myjbpm
I do see my deployed process getting deleted during the processing of
processInstance = executionService.startProcessInstanceByKey("myjbpm",variables);
I deploy my process using following code which is successful.
Configuration configuration = new Configuration();
processEngine = configuration.buildProcessEngine();
repositoryService = processEngine.get(RepositoryService.class);
String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("com/myjbpm.jpdl.xml").deploy();
Thanks in advance for your help!
Yukon
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4270047#4270047
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4270047
16 years, 3 months
[jBPM Users] - JBPM 4 dynamic timer duedate
by newcomer1
What is the best practice for setting dynamic duedates on timers in jbpm4?
I have a use case were I need to signal a transition at a specific date/time depending on a variable(java.util.Date) in the business process.
In the example below start is a Date variable on the process and this fails due to a classcast exception. This way of setting a dynamic duedate seems to be supported in jbpm 3.x. (e.g. http://docs.jboss.org/jbpm/v3.2/userguide/html/businesscalendar.html).
| <state name="waiting">
| <transition name="to out" to="out">
| <timer duedate="#{start} - 1 days" />
| </transition>
| ..
| </state>
|
Part of stacktrace:
| ERROR [ExecuteJobCmd] exception while executing 'ExecuteActivityMessage[11]'
|
| java.lang.ClassCastException: java.util.Date cannot be cast to java.lang.String
| at org.jbpm.pvm.internal.job.TimerImpl.setDueDateDescription(TimerImpl.java:76)
| at org.jbpm.pvm.internal.model.ScopeInstanceImpl.createTimer(ScopeInstanceImpl.java:303)
| at org.jbpm.pvm.internal.model.ScopeInstanceImpl.initializeTimers(ScopeInstanceImpl.java:323)
| at org.jbpm.pvm.internal.model.ExecutionImpl.createScope(ExecutionImpl.java:262)
A quick peak in the jbpm source code seems to reveal that the wanted behavior is not possible, hence the starting question. Do i need to create and persist the timer manually? (e.g. node enter event listener)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4270032#4270032
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4270032
16 years, 3 months
[jBPM Users] - Re: JBPM 4.2 Sub-Processs Not able to access Variables
by emailkuppai
main process
| <?xml version="1.0" encoding="UTF-8"?>
| <process name="wf_ingest_book" version="1" xmlns="http://jbpm.org/4.2/jpdl">
| <start g="264,19,48,48" name="startIngestBook">
| <transition g="-73,-18" name="trDecideType" to="decideType"/>
| </start>
| <decision g="271,125,48,48" name="decideType">
| <handler class="org.sae.services.jbpm4.DecideTypeHandler" />
| <transition g="-95,-18" name="trMetaOnlyIngest" to="metaonly-ingest"/>
| <transition g="499,235:-48,-18" name="trFailed" to="failed"/>
| </decision>
| <sub-process name="metaonly-ingest" sub-process-key="wf_metaonly_ingestion"
| g="130,367,132,53">
| <transition name="trSuccess" to="succeeded" g="-62,-18"/>
| <transition name="trFailed" to="failed" g="-62,-18"/>
| </sub-process>
| <end g="122,443,48,48" name="succeeded"/>
| <end-error g="387,459,48,48" name="failed"/>
| </process>
|
SupProcess
| <?xml version="1.0" encoding="UTF-8"?>
| <process name="wf_metaonly_ingestion" version="1" xmlns="http://jbpm.org/4.2/jpdl">
| <start g="333,26,48,48" name="startMetaOnlyIngestion">
| <transition g="-113,-22" name="trMetaOnlyIngest" to="stateMetaOnlyIngest"/>
| </start>
| <custom g="275,201,163,52"
| name="stateMetaOnlyIngest"
| class="org.sae.services.jbpm4.IngestBookActivity">
| <transition g="234,231:-42,-18" name="trSuccess" to="succeeded"/>
| <transition g="494,231:-48,-18" name="trFailure" to="failed"/>
| </custom>
| <end g="209,356,48,48" name="succeeded"/>
| <end-error g="471,367,48,48" name="failed"/>
| </process>
|
JBPMTestCase
| public void testDoDirty() {
| ProcesssInformationService pisrv = JBPMServices
| .getProcesssInformationService();
| System.out.println("TEST");
| // ProcessInstance processInstance =
| // pisrv.startProcess("wf_ingest_book");
| String pid = "wf_ingest_book";
| String cid = System.currentTimeMillis() + "";
| Map<String,Object> variables = new HashMap<String,Object>();
| variables.put("product-type","book");
| variables.put("ingest-type","meta-only");
| variables.put("prod-cd", "AE-21");
| variables.put("c-id", "");//Some CID Number
| ProcessInstance processInstance = pisrv.startProcess(pid,variables, cid);
|
i can access all these variables in my main process - any event,lisenter,java module hooks.
but these same variables are not able to my sub-process custom module.
i tried to get parent.getProcessInstance.getVariable also.. parent is comming as null..
| ublic class IngestBookActivity implements ExternalActivityBehaviour {
| public void signal(ActivityExecution execution, String signalName,
| Map<String, ?> parameters) throws Exception {
|
| System.out.println( " Parameters "+parameters);
| String prodCd = (String)execution.getVariable("prod-cd");
| String prodType = (String)execution.getVariable("product-type");
| /** both prod-cd, prod-type comming as null */
| IngestionControl pojo = new IngestionControl();
| pojo.setProdCd(prodCd);
| pojo.setProdType(prodType);
|
| String executionPath = "trSuccess";
| try {
| doIngestion(pojo);
| System.out.println(" IngestBook Activity --- Book Ingested Successfully ");
| } catch (Exception e) {
| e.printStackTrace();
| executionPath = "trFailure";
| }
| execution.take( executionPath);
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4270008#4270008
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4270008
16 years, 3 months