Hi Koen, thank you for the response, i've already read the docs but what i want to do is:
order-> task node (accept/cancel order)-> end it's quite simple, if in a fixed period i don't accept or cancel explicity the order, it will be automatically executed and the system ends. I tried to make it in jbpm but when the timer starts, in the java: package org.jbpm.example; | | import org.apache.commons.logging.Log; | import org.apache.commons.logging.LogFactory; | import org.jbpm.context.exe.ContextInstance; | import org.jbpm.graph.def.ActionHandler; | import org.jbpm.graph.exe.ExecutionContext; | import org.jbpm.taskmgmt.def.Swimlane; | import org.jbpm.taskmgmt.def.TaskMgmtDefinition; | import org.jbpm.taskmgmt.exe.SwimlaneInstance; | import org.jbpm.taskmgmt.exe.TaskMgmtInstance; | | public class timeOut implements ActionHandler { | | private static final long serialVersionUID = 1L; | | String swimlaneName; | String msg; | | public void execute(ExecutionContext executionContext) throws Exception { | TaskMgmtDefinition taskMgmtDefinition = executionContext.getProcessDefinition().getTaskMgmtDefinition(); | TaskMgmtInstance taskMgmtInstance = executionContext.getTaskMgmtInstance(); | ContextInstance contextInstance = executionContext.getContextInstance(); | | Swimlane shipperSwimlane = taskMgmtDefinition.getSwimlane("user"); | SwimlaneInstance shipperSwimlaneInstance = taskMgmtInstance.getInitializedSwimlaneInstance(executionContext, shipperSwimlane); | | String actorId = shipperSwimlaneInstance.getActorId(); | | String displayMsg = "a";//replace(msg, "${"+swimlaneName+"}", actorId); | //displayMsg = replace(displayMsg, "${item}", (String)contextInstance.getVariable("item")); | //displayMsg = replace(displayMsg, "${date}", (String)contextInstance.getVariable("date")); | | log.info("###############################################"); | log.info("### TimeOut: "+displayMsg); | log.info("###############################################"); | | executionContext.leaveNode(); | } | | static String replace(String msg, String pattern, String replacement) { | String replaced = null; | int pos = msg.indexOf(pattern); | if (pos!=-1) { | replaced = msg.substring(0,pos) | +replacement | +msg.substring(pos+pattern.length()); | } | return replaced; | } | | private static final Log log = LogFactory.getLog(timeOut.class); | } it leaves the node but informs of an error: 23:04:40,339 INFO [timeOut] ##################################### | ########## | 23:04:40,349 WARN [Timer] timer action threw exception | org.jbpm.graph.def.DelegationException | at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:349) | | at org.jbpm.graph.def.GraphElement$$FastClassByCGLIB$$7a7d6aa6.invoke(<g | enerated>) | at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) | at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ | er.java:136) | at org.jbpm.graph.def.ProcessDefinition$$EnhancerByCGLIB$$131c30ea.raise | Exception(<generated>) | at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343) | | at org.jbpm.graph.def.Node.execute(Node.java:332) | at org.jbpm.graph.def.Node.enter(Node.java:316) | at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated | >) | at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) | at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ | er.java:136) | at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$c68a987a.enter(<generated>) | | at org.jbpm.graph.def.Transition.take(Transition.java:119) | at org.jbpm.graph.def.Node.leave(Node.java:382) | at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:198) | at org.jbpm.graph.def.Node.leave(Node.java:346) | at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated | >) | at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) | at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ | er.java:136) | at org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$9d2b2f44.leave(<genera | ted>) | at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:1 | 20) | at org.jbpm.example.timeout.execute(timeout.java:25) | at org.jbpm.graph.def.Action.execute(Action.java:123) | at org.jbpm.graph.def.Action$$FastClassByCGLIB$$7876e90e.invoke(<generat | ed>) | at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) | at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ | er.java:136) | at org.jbpm.graph.def.Action$$EnhancerByCGLIB$$c66c9cae.execute(<generat | ed>) | at org.jbpm.scheduler.exe.Timer.execute(Timer.java:84) | at org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread | .java:118) | at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70) | Caused by: org.jbpm.JbpmException: can't leave node 'Node(auto-out)' | without leaving transition | at org.jbpm.graph.def.Node.leave(Node.java:364) | at org.jbpm.graph.def.Node.leave(Node.java:346) | at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:1 | 20) | at org.jbpm.example.timeOut.execute(pedidoRecibidoTime | Out.java:38) | at org.jbpm.graph.def.Action.execute(Action.java:123) | at org.jbpm.graph.def.Action$$FastClassByCGLIB$$7876e90e.invoke(<generat | ed>) | at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) | at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializ | er.java:136) | at org.jbpm.graph.def.Action$$EnhancerByCGLIB$$c66c9cae.execute(<generat | ed>) | at org.jbpm.graph.def.Node.execute(Node.java:328) | ... 23 more the cause seems to be: Caused by: org.jbpm.JbpmException: can't leave node 'Node(auto-out)' without leaving transition i don't understand it... should be this done in a differente way? any help will be very appreciated... View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3923740#3923740 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3923740 ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user