[jBPM] - Signal Event is not happening in persisted process
by ravichandrankg
ravichandrankg [https://community.jboss.org/people/ravichandrankg] created the discussion
"Signal Event is not happening in persisted process"
To view the discussion, visit: https://community.jboss.org/message/751377#751377
--------------------------------------------------------------
Hi,
In our company, we are doing some sample process implementation for our application, to decide which BPM engine to be use. It mostly have external system communication, that will trigger the next set of activities in our application.
I am using the following sample process, with one human task and two script tasks with signal events (to trigger from external applications).
https://community.jboss.org/servlet/JiveServlet/showImage/2-751377-19130/... https://community.jboss.org/servlet/JiveServlet/downloadImage/2-751377-19...
and first signal event is having the properties as below,
https://community.jboss.org/servlet/JiveServlet/showImage/2-751377-19132/... https://community.jboss.org/servlet/JiveServlet/downloadImage/2-751377-19...
I am using JBPM 5.3.0.Final version, JBOSS 5.1 and MySQL 5.5.
I am creating a single knowledge session for whole my web application (singleton object holder class, initializing at server startup time). I am creating the process as,
+ StatefulKnowledgeSession jbpmsession = util.getSession();+
+ UserTransaction ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );+
+ ut.begin();+
+ ProcessInstance instance = jbpmsession.startProcess("IngestMetadataAndFile", props);+
+ jbpmsession.insert(instance);+
+ ut.commit();+
and the getSession method will return the new session for first time, and reloaded session there after, using the following code.
+StatefulKnowledgeSession sessionobj = null;+
+ Properties properties = new Properties();+
+ properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");+
+ properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory");+
+ KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);+
+ if (sessionId == -1) {+
+ sessionobj = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, config, env );+
+ } else {+
+ try {+
+ sessionobj = JPAKnowledgeService.loadStatefulKnowledgeSession( sessionId, kbase, config, env);+
+ } catch(Exception e) {+
+ System.out.println("Exception in loading the session");+
+ sessionobj = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, config, env );+
+ }+
+ }+
+ new JPAWorkingMemoryDbLogger(sessionobj);+
+ KnowledgeRuntimeLoggerFactory.newConsoleLogger(sessionobj);+
+ JPAProcessInstanceDbLog processLog = new JPAProcessInstanceDbLog(sessionobj.getEnvironment());+
+ DsrClientHandler wsHumanTaskHandler = new DsrClientHandler(sessionobj);+
+ wsHumanTaskHandler.setClient(client.getTaskClient());+
+ sessionobj.getWorkItemManager().registerWorkItemHandler("Human Task",wsHumanTaskHandler);+
With this code, i can able to create the process instance successfully and i am completing the human task by using HornetQ service. It is sucessfully completing the human task and coming to the script task (i can see the syslogs in the script task get printed). From the script task, i am calling my business implementation java class and calling signal event after the business logic completion.
I am signalling as below,
+ StatefulKnowledgeSession ksession = util.getSession();+
+ ksession.signalEvent(eventtype, null, Long.parseLong(processid));+
+ //ksession.signalEvent(eventtype, null);+
+ ProcessInstance processinst = ksession.getProcessInstance(Long.parseLong(processid));+
+ //processinst.signalEvent(eventtype, null);+
after this signalling, it is not coming to the next script task. I have developed my BPMN file by using eclipse (setup using JBPM 5.3 installer).
I dont know what is really wrong with my code. I am not getting any exception after the signal event, but console is printing the following logs.
*2012-07-31 12:29:27,804 INFO [STDOUT] (Thread-26) BEFORE PROCESS NODE EXITED node:External Task1[id=4] process:Sample new DSR Process[id=IngestMetadataAndFile]*
*2012-07-31 12:29:27,805 INFO [STDOUT] (Thread-26) BEFORE PROCESS NODE TRIGGERED node:Signal[id=5] process:Sample new DSR Process[id=IngestMetadataAndFile]*
*2012-07-31 12:29:27,805 INFO [STDOUT] (Thread-26) AFTER PROCESS NODE TRIGGERED node:Signal[id=5] process:Sample new DSR Process[id=IngestMetadataAndFile]*
*2012-07-31 12:29:27,805 INFO [STDOUT] (Thread-26) AFTER PROCESS NODE TRIGGERED node:External Task1[id=4] process:Sample new DSR Process[id=IngestMetadataAndFile]*
*2012-07-31 12:29:27,805 INFO [STDOUT] (Thread-26) AFTER PROCESS NODE TRIGGERED node:External Task1[id=4] process:Sample new DSR Process[id=IngestMetadataAndFile]*
*2012-07-31 12:29:27,805 INFO [STDOUT] (Thread-26) AFTER PROCESS NODE TRIGGERED node:EnterMetadata[id=2] process:Sample new DSR Process[id=IngestMetadataAndFile]*
can you please help me to get out of this issue, where i got stucked and invested lot of time :( .
Thanks,
Ravichandran
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/751377#751377]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 6 months
[jBPM] - Determining available transitions
by stevearoonie
stevearoonie [https://community.jboss.org/people/stevearoonie] created the discussion
"Determining available transitions"
To view the discussion, visit: https://community.jboss.org/message/754428#754428
--------------------------------------------------------------
Hi all,
I am looking at replacing jBPM 3 with 5 and there is one feature of 3 that we use extensively that I am not sure how to do in 5 - we send to the client application (not a web app) the set of transitions that the current user is able to take for the selected task. This allows us to alter and redeploy a workflow and have the UI automatically pick up new/changed transitions.
I gather that in version 5/BPMN2 outgoing transitions would be implemented by an XOR split that would use data added in the completion of the task node to choose the correct path, but I have not seen any examples where you can retrieve the set of valid transitions from anywhere. Before I go ahead with some custom implementation is there some recommended way to do this, or a different approach I should be using?
thanks in advance
Steve
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/754428#754428]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 7 months
[JBoss Messaging] - How to list or monitor messages in a Queue which is already under use
by Aneesh Sebastian
Aneesh Sebastian [https://community.jboss.org/people/aneeshsebastian] created the discussion
"How to list or monitor messages in a Queue which is already under use"
To view the discussion, visit: https://community.jboss.org/message/720125#720125
--------------------------------------------------------------
I have a requirement to monitor a JBoss messaging queue, where users should be able to delete posted messages dynamically. The application has a MDPOJO registered and is up and running at server start up.
My requirement is, users should be able to delete a posted message any time he wishes. I tried below proto codes :
*Option1*
public void listAllJMS_Messages()
{
try {
ObjectName objectName=new ObjectName("jboss.messaging.destination:name=XXX,service=Queue");
List ls = (List) server.invoke(objectName, "listMessages" , null, null);
List<javax.jms.Message> messages=(List<javax.jms.Message>)server.invoke(objectName, "listAllMessages" , null, null);
int count=0;
for(javax.jms.Message msg : messages) {
System.out.println((++count)+"t"+msg.getJMSMessageID());
if(msg.getJMSType() != null && msg.getJMSType().equalsIgnoreCase("Text")) {
TextMessage text = (TextMessage)msg;
System.out.println(text.getText());
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// System.out.println((++count)+"t"+msg.getText());
}
*Option2*
public void listMsg() {
String destinationName = "queue/XXX";
Context ic = null;
ConnectionFactory cf = null;
Connection connection = null;
try {
ic = getInitialContext();
cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
Queue queue = (Queue)ic.lookup(destinationName);
connection = cf.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
QueueBrowser qbrowser = session.createBrowser(queue);
Enumeration<?> qamsgs = qbrowser.getEnumeration();
while (qamsgs.hasMoreElements()){
Message msg = (Message)qamsgs.nextElement();
}
connection.start();
}
catch(Exception e)
{
System.out.println(e);
}
finally
{
if(ic != null)
{
try
{
ic.close();
}
catch(Exception e1)
{
System.out.println(e1);
}
}
}
}
In both the options,messages are getting listed in case of no message consumers at present.If have a live message consumer MDB, then list is returned as null.
I defintely need MDB consumer up and running.But still need to monitor messages.I should be able to do below :
1. List messages]
2. Delete a particular message
3. Change priority
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/720125#720125]
Start a new discussion in JBoss Messaging at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 7 months
[jBPM] - call JBPM process from seam project
by raymond zhou
raymond zhou [https://community.jboss.org/people/zhouraymond] created the discussion
"call JBPM process from seam project"
To view the discussion, visit: https://community.jboss.org/message/755212#755212
--------------------------------------------------------------
Hello
I created two projects in Jboss Developer Studio 5, one is seam project and one is jbmp project(BPMN2.0), I am trying to start the sample process(sample.bpmn - in my jBPM project) from a seam action by calling the generated class ProcessMain(this ProcessMain can be run separately in JDS5)
when I ran this from JDS5, I am getting the error
======
Unable to instantiate 'org.drools.bpmn2.BPMN2ProcessProviderImpl'
Caused by: java.lang.ClassNotFoundException: org.drools.bpmn2.BPMN2ProcessProviderImpl from BaseClassLoader@e873b{vfsfile:/C:/Dev/EnterprisePlatform-5.1.1/jboss-eap-5.1/jboss-as/server/default/deploy/myApp.war/}
I am using Jboss EAP5.1.1 as my JDS5 server runtime. and I have added all the jar from my jbdevstudio5\runtimes folder into my seam project, but still getting this error, could anyone here give me some direction on how to implement this?
thanks a lot
P.s I attached a screen shot to show my jds5 projects structure.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/755212#755212]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 7 months
[jBPM] - Human Task and variables
by tmmaluleke
tmmaluleke [https://community.jboss.org/people/tmmaluleke] created the discussion
"Human Task and variables"
To view the discussion, visit: https://community.jboss.org/message/756749#756749
--------------------------------------------------------------
Hello,
I was trying to do a business process with variables but wahen i run it i got this error. I have attached my project please take a look at it mybe i made a mistake.
(null: 668, 15): cvc-id.1: There is no ID/IDREF binding for IDREF 'discription'.
Could not find variable scope for variable discription
when trying to execute Work Item Human Task
Continuing without setting parameter.
0 29/08 14:58:25,250[Thread-2] ERROR service.hornetq.HornetQTaskClientConnector.run - org.jbpm.process.workitem.wsht.BlockingAddTaskResponseHandler cannot be cast to org.jbpm.task.service.TaskClientHandler$GetTaskResponseHandler
Exception in thread "Thread-2" java.lang.RuntimeException: Client Exception with class class org.jbpm.task.service.hornetq.HornetQTaskClientConnector$1 using port 5445
at org.jbpm.task.service.hornetq.HornetQTaskClientConnector$1.run(HornetQTaskClientConnector.java:134)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: org.jbpm.process.workitem.wsht.BlockingAddTaskResponseHandler cannot be cast to org.jbpm.task.service.TaskClientHandler$GetTaskResponseHandler
at org.jbpm.task.service.TaskClientHandler.messageReceived(TaskClientHandler.java:75)
at org.jbpm.task.service.hornetq.HornetQTaskClientHandler.messageReceived(HornetQTaskClientHandler.java:56)
at org.jbpm.task.service.hornetq.HornetQTaskClientConnector$1.run(HornetQTaskClientConnector.java:120)
... 1 more
DOEOfficial execute taskSchool Evaluation(5: )
java.lang.IllegalStateException: The Marshaller Context Needs to be Provided
at org.jbpm.task.utils.ContentMarshallerHelper.marshalSingle(ContentMarshallerHelper.java:98)
at org.jbpm.task.utils.ContentMarshallerHelper.marshal(ContentMarshallerHelper.java:59)
at department.DepartmentOfEductaionProcess.main(DepartmentOfEductaionProcess.java:79)
9953 29/08 14:58:35,203[Thread-3] ERROR workitem.wsht.GenericHTWorkItemHandler.executeWorkItem - Wed Aug 29 14:58:35 WAT 2012: Error when creating task on task server for work item id 2. Error reported by task server: Task operation request timed out
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/756749#756749]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 7 months