[JBoss jBPM] - Re: process-end behavior
by greenHand
Firstly, the process instance was associated with the old definition so it was correct that the email was sent. My bad.
Now I have a new process instance associated with the new definition (below). Now even both node A and B complete successfully, the email was never sent. The reason is the event at node A SEND_APPROVE_EMAIL_TO_REQUESTOR) was never fired.
Is it legal to have event type="process-end" at a node which is not an END node?
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="MY_PROCESS_DEF">
|
|
| <start-state name="START">
| <transition to="APPROVAL" name="to APPROVAL"></transition>
| </start-state>
|
|
| <task-node name="APPROVAL">
| <task name="mypackage.ApproverAssignmentHandler">
| <assignment class="mypackage.ApproverAssignmentHandler"></assignment>
| </task>
| <transition to="fork for approve path" name="approve"></transition>
| <transition to="fork for reject path" name="reject"></transition>
| <transition to="fork for cancel path" name="cancel"></transition>
| </task-node>
|
| <node name="SEND_APPROVE_EMAIL_TO_REQUESTOR">
| <event type="process-end">
| <action name="mypackage.ApprovedEmailActionHandler" class="mypackage.ApprovedEmailActionHandler"></action>
| </event>
| <transition to="join for approve path" name="from SEND_APPROVE_EMAIL_TO_REQUESTOR"></transition>
| </node>
|
| <node name="EXECUTE_REQUESTED_PROGRAM">
| <action class="mypackage.ExeRequestProgramActionHandler" name="mypackage.ExeRequestProgramActionHandler" accept-propagated-events="false"></action>
| <transition to="join for approve path" name="from EXECUTE_REQUESTED_PROGRAM "></transition>
| </node>
|
| <node name="SEND_REJECT_EMAIL_TO_REQUESTOR">
| <event type="process-end">
| <action name="mypackage.RejectedEmailActionHandler" class="mypackage.RejectedEmailActionHandler"></action>
| </event>
| <transition to="join for reject path" name="from SEND_REJECT_EMAIL_TO_REQUESTOR"></transition>
| </node>
|
| <node name="DELETE_REQUEST_DATA">
| <action class="mypackage.DeleteRequestDataActionHandler" name="mypackage.DeleteRequestDataActionHandler" accept-propagated-events="false"></action>
| <transition to="join for reject path" name="from DELETE_REQUEST_DATA"></transition>
| </node>
|
| <fork name="fork for approve path">
| <transition to="SEND_APPROVE_EMAIL_TO_REQUESTOR" name="to SEND_APPROVE_EMAIL_TO_REQUESTOR"></transition>
| <transition to="EXECUTE_REQUESTED_PROGRAM" name="to EXECUTE_REQUESTED_PROGRAM "></transition>
| </fork>
|
| <fork name="fork for reject path">
| <transition to="SEND_REJECT_EMAIL_TO_REQUESTOR" name="to SEND_REJECT_EMAIL_TO_REQUESTOR"></transition>
| <transition to="DELETE_REQUEST_DATA" name="to DELETE_REQUEST_DATA "></transition>
| </fork>
|
| <join name="join for approve path">
| <transition to="END" name="from join for approve path"></transition>
| </join>
|
| <join name="join for reject path">
| <transition to="END" name="from join for reject path"></transition>
| </join>
|
| <fork name="fork for cancel path">
| <transition to="SEND_TIMEOUT_EMAIL_TO_REQUESTOR" name="to SEND_TIMEOUT_EMAIL_TO_REQUESTOR"></transition>
| <transition to="DELETE_REQUEST_DATA_DUE_TO_CANCEL" name="to DELETE_REQUEST_DATA_DUE_TO_CANCEL"></transition>
| </fork>
|
| <node name="SEND_TIMEOUT_EMAIL_TO_REQUESTOR">
| <event type="process-end">
| <action name="mypackage.TimedOutEmailActionHandler" class="mypackage.TimedOutEmailActionHandler"></action>
| </event>
| <transition to="join for cancel path" name="from SEND_TIMEOUT_EMAIL_TO_REQUESTOR"></transition>
| </node>
|
| <node name="DELETE_REQUEST_DATA_DUE_TO_CANCEL">
| <event type="process-end">
| <action name="mypackage.DeleteRequestDataActionHandler" class="mypackage.DeleteRequestDataActionHandler"></action>
| </event>
| <transition to="join for cancel path" name="from DELETE_REQUEST_DATA_DUE_TO_CANCEL"></transition>
| </node>
|
| <join name="join for cancel path">
| <transition to="END" name="from join for cancel path"></transition>
| </join>
|
|
| <end-state name="END"></end-state>
|
|
| </process-definition>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175390#4175390
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175390
17 years, 7 months
[JBoss jBPM] - API questions: how to...
by roberto
Hi,
I have some questions about JBPM/JPDL Api (maybe a minimal part question of a very long future list of questions... sorry)
I'm rewriting a task "to do list"... like the jbpm-console.
Why ?
1) Because jbpm-console doesn't manager authorizations (http://www.jboss.com/index.html?module=bb&op=viewtopic&t=141654)
2) Because I want a standard user interface between my ERP and WorkFlow system
....
about point 2):
2.a) how can I get a task/process instance image rappresentation ?
I know I can get the jpg image of the process definition using
ProcessDefinition vPD = vJbpmContext.getGraphSession().loadProcessDefinition(aProcessDefinition);
vBytes = vPD.getFileDefinition().getBytes("processimage.jpg");
and there is a very good example for process instance at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=102817
(thank you very much Mr. dleerob). But.. there is a more simple way ? like the getBytes("processoimage.jsp" ... directly from standard jpdl api?
Will be implements in a future release?
2.b) I can define variables. It is possible to define 3 properties : "required", "read", "write"
What's about nature of the field ? e.g. a list of value or if it is a number (and maybe the precision) or is a string, a date and so on?
If it is possible to define this additional properties... how can I get it from jpdl api?
I'm try also to get a look to java source code of the jbmp-console, but it is not so simple to found all response
thank you to all.
Bye
Roberto
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175337#4175337
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175337
17 years, 7 months
[JBoss jBPM] - Handling errors on page flows
by kasim
Ok maybe i am just missing it here.
I am trying to create a fairly simple page flow definition. And i am using page flows because it could eventually get more complicated based on a substance.
But how do i handle error validations?
| <page name="loader-information" view-id="/loadCollection.xhtml">
| <transition name="next" to="substances-load">
| <action expression="#{loadConfigSvc.saveLoadConfig()}"/>
| </transition>
| <transition name="cancel" to="cancel"></transition>
| </page>
|
So i have that saveLoadConfig can return a boolean false if it fails to validate and saves a message ot the facesmessages.
Well ... when i run it it naturally goes to the next page.
I know i can handle global exceptions for it in the pages code, but really i just want it to go back on itself and redisplay the same page. Can i use rules with the actions? Like we do in pages.xml?
Or do i need to make a decision node instead?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175311#4175311
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175311
17 years, 7 months
[JBoss jBPM] - Re: Consuming webservice in jBPM JPDL (Eclipse)
by chrlyck
I deployed using the deployment tab in jBPM JPDL and marked the src/main/java so everything should be ok, but am i supposed to put the com.sample.action.CalculatorWS-stuff somewhere in a jar-file so it's in the classpath?
I made a jar and put it in the lib-folder, but no luck. Got the printstacktrace to work - don't know what happened since it didn't work - not much help looking at it though.
10:31:50,271 ERROR [STDERR] org.jboss.ws.WSException: Cannot load service endpoint interface: com.sample.action.CalculatorWS
| 10:31:50,271 ERROR [STDERR] at org.jboss.ws.metadata.umdm.EndpointMetaData.getServiceEndpointInterface(EndpointMetaData.java:248)
| 10:31:50,271 ERROR [STDERR] at org.jboss.ws.metadata.umdm.EndpointMetaData.eagerInitializeOperations(EndpointMetaData.java:525)
| 10:31:50,271 ERROR [STDERR] at org.jboss.ws.metadata.umdm.EndpointMetaData.initializeInternal(EndpointMetaData.java:519)
| 10:31:50,271 ERROR [STDERR] at org.jboss.ws.metadata.umdm.EndpointMetaData.eagerInitialize(EndpointMetaData.java:507)
| 10:31:50,271 ERROR [STDERR] at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.rebuildEndpointMetaData(JAXWSClientMetaDat
| aBuilder.java:308)
| 10:31:50,271 ERROR [STDERR] at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPortInternal(ServiceDelegateImpl.java:262)
| 10:31:50,271 ERROR [STDERR] at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:193)
| 10:31:50,271 ERROR [STDERR] at javax.xml.ws.Service.getPort(Service.java:92)
| 10:31:50,271 ERROR [STDERR] at com.sample.action.CalculatorWSService.getCalculatorWSPort(CalculatorWSService.java:57)
| 10:31:50,271 ERROR [STDERR] at com.sample.action.isbncheck.execute(isbncheck.java:21)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.def.Action.execute(Action.java:122)
| 10:31:50,271 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 10:31:50,271 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 10:31:50,271 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 10:31:50,271 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
| 10:31:50,271 ERROR [STDERR] at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.def.Action_$$_javassist_34.execute(Action_$$_javassist_34.java)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:259)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.def.Node.execute(Node.java:338)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.def.Node.enter(Node.java:318)
| 10:31:50,271 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 10:31:50,271 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 10:31:50,271 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 10:31:50,271 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
| 10:31:50,271 ERROR [STDERR] at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.def.Node_$$_javassist_80.enter(Node_$$_javassist_80.java)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.def.Transition.take(Transition.java:151)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.def.Node.leave(Node.java:393)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.node.StartState.leave(StartState.java:70)
| 10:31:50,271 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 10:31:50,271 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 10:31:50,271 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 10:31:50,271 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
| 10:31:50,271 ERROR [STDERR] at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.def.Node_$$_javassist_80.leave(Node_$$_javassist_80.java)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.exe.Token.signal(Token.java:192)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.exe.Token.signal(Token.java:163)
| 10:31:50,271 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 10:31:50,271 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 10:31:50,271 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 10:31:50,271 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
| 10:31:50,271 ERROR [STDERR] at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.graph.exe.Token_$$_javassist_14.signal(Token_$$_javassist_14.java)
| 10:31:50,271 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:482)
| 10:31:50,287 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:421)
| 10:31:50,287 ERROR [STDERR] at org.jbpm.jsf.core.action.CompleteTaskActionListener.handleAction(CompleteTaskActionListener.java:52)
| 10:31:50,287 ERROR [STDERR] at org.jbpm.jsf.core.impl.JbpmActionListenerWrapper.processAction(JbpmActionListenerWrapper.java:82)
| 10:31:50,287 ERROR [STDERR] at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
| 10:31:50,287 ERROR [STDERR] at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:746)
| 10:31:50,287 ERROR [STDERR] at javax.faces.component.UICommand.broadcast(UICommand.java:368)
| 10:31:50,287 ERROR [STDERR] at org.jbpm.jsf.taskform.ui.UITaskFormButtonBase.broadcast(UITaskFormButtonBase.java:56)
| 10:31:50,287 ERROR [STDERR] at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
| 10:31:50,287 ERROR [STDERR] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
| 10:31:50,287 ERROR [STDERR] at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
| 10:31:50,287 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| 10:31:50,287 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| 10:31:50,287 ERROR [STDERR] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| 10:31:50,287 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| 10:31:50,287 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
| 10:31:50,287 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| 10:31:50,287 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| 10:31:50,287 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| 10:31:50,287 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| 10:31:50,287 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| 10:31:50,287 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
| 10:31:50,287 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: com.sample.action.CalculatorWS
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
| 10:31:50,287 ERROR [STDERR] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
| 10:31:50,287 ERROR [STDERR] at org.jboss.ws.metadata.umdm.EndpointMetaData.getServiceEndpointInterface(EndpointMetaData.java:239)
| 10:31:50,287 ERROR [STDERR] ... 75 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175232#4175232
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175232
17 years, 7 months
[JBoss jBPM] - Consuming webservice in jBPM JPDL (Eclipse)
by chrlyck
Hi guys
Starting to get better at this stuff - i have a really annoying problem with consuming webservices in jBPM though.
Until now i have been making processes calling internal stuff, and using a lot of examples.
My first step into the real world is consuming a webservice.
I made the webservice myself, its a simple java webservice adding two numbers together. I have tested it by implementing a client in NetBeans IDE 6.1, and it works like a charm. I have copied the code to jBPM and made a simple process executing it.
To make things even more simple i have put the webservices code in the same package as the client itself, i was unsure whether it actually deployed the files...
Here it is:
package com.sample.action;
|
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
| import org.jbpm.graph.def.ActionHandler;
| import org.jbpm.graph.exe.ExecutionContext;
|
| public class isbncheck implements ActionHandler {
|
| private static final long serialVersionUID = 1L;
|
| public void execute(ExecutionContext executionContext) throws Exception
| {
| String msg;
| try
| {
| log.info("##############################");
| log.info("Debug:1");
| CalculatorWSService service = new CalculatorWSService();
| log.info("Debug:2");
| CalculatorWS port = service.getCalculatorWSPort(); //TODO: Error - wtf?
| log.info("Debug:3");
| int i = 3;
| int j = 400000;
| int result = port.add(i, j);
| msg = "Result = "+result;
| }
| catch (Exception ex)
| {
| msg = "Error: " + ex.getMessage();
| }
| log.info(msg);
| log.info("##############################");
| executionContext.leaveNode();
| }
|
| private static final Log log = LogFactory.getLog(isbncheck.class);
| }
When running this, my webserver (tomcat 6) sends the following output.
anonymous wrote : 09:42:45,912 INFO [isbncheck] ##############################
| 09:42:45,912 INFO [isbncheck] Debug:1
| 09:42:45,943 INFO [isbncheck] Debug:2
| 09:42:45,975 INFO [isbncheck] Error: Cannot load service endpoint interface: com.sample.action.CalculatorWS
| 09:42:45,975 INFO [isbncheck] ##############################
As you might have guessed by the name of the class i have tried with another webservice with the same error (an ISBN check webservice). In both cases i can create the service, but when calling the service.get*Whatever*Port() i get the error. I've been googling like a mad-man but nobody seems to have this problem, so what am i doing wrong?
Btw. i'm sure it's a simple question, but how do i do the "printstacktrace" to the webserver console so i can see the full error?
Thanks in advance.
Nibe
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175229#4175229
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175229
17 years, 7 months
[JBoss jBPM] - Re: 3.2 scheduler in ear
by MikeSchulze
Thx for your answer kukeltj.
I designed a process-definition with a timer. I deployed it to my hsql-database and used the JobExecutor Servlet for the Timer-Handling. So far so good. My process can be startet and the timer is activated (and removed from the JBPM_JOB-table) at the right time.
After that I wanted to switch to the EJB-Timer-Services supported by jbpm-enterprise.ear. I deployed the ear to my JBoss and deployed the same process-definition to it. The JBoss i use is the one that is published with jbpm-suite.
When I start a process, an entry for my timer is added to my jbpm_job table. Also there is a new table - called TIMERS in which the app-server adds an entry for a timer too (using the ejb-deployers.xml). The later one fires and after that the entry is remove from the TIMERS-table, but not my jbpm-job.
So I guess, there is still something misconfigured and jbpm is not connected to the EJB-Timer. All configuration files are from jbpm-enterprise.ear :-(
I've read the docs and searched this forum but haven't found anything to help me yet. I'm using:
- jBPM 3.2.3
- JBoss AS 4.2.2 (out of jbpm-suite) and
- jbpm-entrerprise.ear - so i guessed the all configurations should have been made.
Thx - Mike
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175214#4175214
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175214
17 years, 7 months