[jBPM] - Can I save my process instance to call it again where stopped?
by Cyrine Bjaoui
Cyrine Bjaoui [https://community.jboss.org/people/cyrine] created the discussion
"Can I save my process instance to call it again where stopped?"
To view the discussion, visit: https://community.jboss.org/message/764573#764573
--------------------------------------------------------------
Hello everybody,
I modeled a process with jbpm5 containing Wait States using Service Tasks. All goes well, my process runs perfectly.
At this stage, I want to save the state of my process, supposedly ProcessInstance = 'X', which was stopped in the example node 'Ni' pending message to continue.
So when I returned to my process, I execute it again by calling this instance X, it should run where it stopped (say from 'Ni').
Is it possible?
If yes, what I need to use for that (Hibernate, MySQL ..)?
P.S.: I am using jbpm in version 5!
Thank you in advance!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/764573#764573]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 6 months
[jBPM] - signal event doesn't work from REST API
by Rudi Fisher
Rudi Fisher [https://community.jboss.org/people/rudi_fisher] created the discussion
"signal event doesn't work from REST API"
To view the discussion, visit: https://community.jboss.org/message/649256#649256
--------------------------------------------------------------
I want to use REST API to call signal. There is some implementation in ProcessMgmtFacade of gwt-console-server for this. I see the source code and I finelly found this in CommandDelegate of jbpm-gwt-core:
public void signalExecution(String executionId, String signal) {
ksession.getProcessInstance(new Long(executionId)).signalEvent("signal", signal);
}
This doesn't fulfil my requirements so I made changes to this class recompile and redeploy. This step is OK, because I made some other changes about this REST API (start process with params) and everythings work fins, so I think the problem is not in this my changed implementation of CommandDelegate. New implementation is:
public void signalExecution(String executionId, String eventType, String eventValue) {
ksession.getProcessInstance(new Long(executionId)).signalEvent(eventType, eventValue);
}
I took example of signal event from original examples to be sure that process is designed OK. I took BPMN2-EventBasedSplit.bpmn2. I tested in Eclipse and works fine - after signal call, process cointinued and finally finished. I deployed this process into my Guvnor repo and started by GWT console. Process stopped and waits at signal nodes (see attached picture).
https://community.jboss.org/servlet/JiveServlet/showImage/2-649256-17846/... https://community.jboss.org/servlet/JiveServlet/downloadImage/2-649256-17...
At this point I wanted to push process by send signal event by REST API with new implementation. Method signalExecution in CommandDelegate is called OK and this method take correct process instance (I have log line there to see process instance). But it seems signalEvent on process instance doesn't work. I'm using the same parameters for signal event in Eclipse and in CommandDelegate. I'm confused about what is different between execution in unit test in Eclipse and at server. I made many tests and examples but my probem has no solution to this day. I found some discussion about similar issues but this not solve this problem.
Working unit test in Eclipse
public static final void main(String[] args) throws Exception {
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ProcessInstance processInstance = ksession.startProcess("com.sample.test");
System.out.println("process instance:" + processInstance.getState());
ksession.signalEvent("Yes", "YesValue", processInstance.getId());
System.out.println("process instance:" + ksession.getProcessInstance(processInstance.getId()));
// NO
processInstance = ksession.startProcess("com.sample.test");
System.out.println("process instance:" + processInstance.getState());
//ksession = restoreSession(ksession, true);
ksession.signalEvent("No", "NoValue", processInstance.getId());
System.out.println("process instance:" + ksession.getProcessInstance(processInstance.getId()));
}
private static KnowledgeBase readKnowledgeBase() throws Exception {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("BPMN2-EventBasedSplit.bpmn2"), ResourceType.BPMN2);
return kbuilder.newKnowledgeBase();
}
Not working code in CommandDelegate and calling at GWT server
ksession.getProcessInstance(new Long(executionId)).signalEvent("Yes", "YesValue");
For BPMN2-EventBasedSplit.bpmn2 see official examples in version 5.2.0 Final
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/649256#649256]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 6 months
[JBoss Tools] - Re: Problems removing CDI support from project
by hd0815
hd0815 [https://community.jboss.org/people/hd0815] created the discussion
"Re: Problems removing CDI support from project"
To view the discussion, visit: https://community.jboss.org/message/764511#764511
--------------------------------------------------------------
Hi,
I did the following tests:
perform a clean via Project --> Clean.
Under Eclipse Juno with latest updates and the latest development release of JBoss Tool for Juno:
(a) clean: 5 sec
(b) CDI Builder: 55 sec
(c) compile: 1 min 5 sec
(d) JBoss KnowledgeBaseBuilder: 1 min 20 sec
(e) CDI Builder (again): 16 min 30 sec
(f) compile (again): 20 sec
total time: 20 min 15 sec
Under latest JBoss DevStudio 6.0.0 Alpha 2
(a) clean: 15 sec
(b) copy resources: 1 min 35 sec
(c) compile: 45 sec
(d) CDI Builder: 10 sec
total time: 2 min 45 sec
The validators are not relevant for this project because the project doesn't use CDI nor EL as I already mentioned.
I realized that the eclipse version of JBoss Tools is using a lot more RAM or at least releases the RAM not so frequently.
HTH
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/764511#764511]
Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 6 months
[jBPM] - XOR Gateway
by tmmaluleke
tmmaluleke [https://community.jboss.org/people/tmmaluleke] created the discussion
"XOR Gateway"
To view the discussion, visit: https://community.jboss.org/message/764516#764516
--------------------------------------------------------------
Hello,
I have a project which have the XOR gateway en when I run it its gives me this error:
This is what I coded in my XOR gateway:
if(studentId !="null"); the process must continue or if(studentId =="null"); the process must alert the user to input the studentId. but when I run this error occurs.
Exception in thread "Thread-4" org.jbpm.workflow.instance.WorkflowRuntimeException: [validatingStudentId.bpmn:1 - Gateway:5] -- Exception when trying to evaluate constraint Accept in split Gateway
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:130)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)
at org.jbpm.workflow.instance.impl.ExtendedNodeInstanceImpl.triggerCompleted(ExtendedNodeInstanceImpl.java:47)
at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:162)
at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:143)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.triggerCompleted(WorkItemNodeInstance.java:239)
at org.jbpm.workflow.instance.node.HumanTaskNodeInstance.triggerCompleted(HumanTaskNodeInstance.java:90)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.workItemCompleted(WorkItemNodeInstance.java:301)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.signalEvent(WorkItemNodeInstance.java:277)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:326)
at org.drools.process.instance.impl.DefaultWorkItemManager.completeWorkItem(DefaultWorkItemManager.java:116)
at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler.handleCompletedTask(GenericHTWorkItemHandler.java:221)
at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler$1.run(GenericHTWorkItemHandler.java:187)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Exception when trying to evaluate constraint Accept in split Gateway
at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:79)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)
... 14 more
Caused by: java.lang.RuntimeException: unable to execute ReturnValueEvaluator
at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:130)
at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:72)
... 15 more
Caused by: java.lang.RuntimeException: Constraints must return boolean values: if(studentId !=" null"); returns null
at org.jbpm.process.instance.impl.MVELReturnValueEvaluator.evaluate(MVELReturnValueEvaluator.java:119)
at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:128)
... 16 more
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/764516#764516]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 6 months