[JBoss jBPM] - Re: Signal process instance asynchronous
by hhhuber
there are reasons why i don't want to make the first node 'async'. so i kept looking for a way to signal a process asynchronously. this is what i implemented:
a AsyncProcessSignalJob that can be saved as a jbpm-job. then the job executor finds and executes the job as any other job.
| public class AsyncProcessSignalJob extends Job {
|
| /** The Constant serialVersionUID. */
| private static final long serialVersionUID = -8358943330005955423L;
|
| public AsyncProcessSignalJob() {
| }
|
| public AsyncProcessSignalJob(ProcessInstance processInstance) {
| this.setDueDate(new Date());
| this.setProcessInstance(processInstance);
| this.setToken(processInstance.getRootToken());
| }
|
| @Override
| public boolean execute(JbpmContext jbpmContext) throws Exception {
|
| ProcessInstance processInstance = this.getProcessInstance();
| processInstance.signal();
| jbpmContext.save(processInstance);
| return true;
| }
|
|
then i created a hibernate mapping file
|
| <hibernate-mapping auto-import="false" default-access="field">
|
| <subclass name="foo.bar.AsyncProcessSignalJob"
| discriminator-value="P"
| extends="org.jbpm.job.Job">
|
| </subclass>
|
| </hibernate-mapping>
|
which must be included in jbpm.hibernate.cfg.xml.
once i have created (but not signaled) a process instance i can schedule it like this:
| public void signalAsync(ProcessInstance processInstance, JbpmContext jbpmContext) {
| AsyncProcessSignalJob job = new AsyncProcessSignalJob(processInstance);
| jbpmContext.getJobSession().saveJob(job);
| }
|
|
does this look reasonable? have i overlooked something? i'm still in early testing phase so i cannot guarantee that this code really runs stable.
any comments would be appreciated.
kind regards,
oliver
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4237861#4237861
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4237861
16 years, 10 months
[JBoss jBPM] - Problem while using EsbActionHandler in jpdl
by vnm
Hi,
I am facing problem while using EsbActionHandler in jpdl..I am using jboss server version 4.2.2.ga and jboss esb version 4.4.ga and jbpm-jpdl3.2.3
Scenario in which we are using jbpm and esb
In our web application on specific submit of request I have invoked esb service by calling serviceInvoker.deliverSync(obj)method..And the service invoked by this call will initiate jbpm process which has already been deployed on jboss server..And this process in turn is using nodes in which I have configured EsbActionHandler on node enter event..
Problem I am facing
So on initialization of jbpm process by processdefinition,signal() , it will call first service in jpdl. This service is running successfully but after completion of this service ,jbpm will invoke the second one service and the second one service is not getting data which has been prepared by the first service..And so my whole process execution is stopped over there... So basically my bpm variable is not saved after execution of first esb service
According to errors generated I have tried so many ways to overcome but not able to get success..
Seeking for help from anyone who can solve this
herin with I have mentioned the error which I think is the cause of the problem I am facing
WARN [CallbackCommand] Token id 636 from process instance 332 is no longer active
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4237834#4237834
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4237834
16 years, 10 months
[JBoss jBPM] - Problem with taskform
by efabbri
Hi! I've installed the new jBpm CR1 release and I tried to run the taskform example as seen on the http://vimeo.com/4643652 but in my machine the example return the exeption:
anonymous wrote : HTTP Status 500 -
|
| type Exception report
|
| message
|
| description The server encountered an internal error () that prevented it from fulfilling this request.
|
| exception
|
| org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: No UI associated with task ID 14
| org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)
| org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)
| org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)
| org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)
| org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
| org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
| org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
|
| root cause
|
| java.lang.RuntimeException: No UI associated with task ID 14
| org.jboss.bpm.console.server.TaskMgmtFacade.renderUI(TaskMgmtFacade.java:156)
| sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| java.lang.reflect.Method.invoke(Method.java:597)
| org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
| org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
| org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
| org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
| org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
| org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
| org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
| org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
| org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
|
| note The full stack trace of the root cause is available in the JBoss Web/2.1.3.GA logs.
What does I'm doing wrong?
Thanks.
Emanuele
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4237833#4237833
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4237833
16 years, 10 months