[jboss-user] [JBoss jBPM] - Re: Need help to fix timer issue

gchanteb do-not-reply at jboss.com
Tue Mar 17 10:59:24 EDT 2009


And it works with action handler:

<?xml version="1.0" encoding="UTF-8"?>
  | 
  | <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="process6">
  | 
  | 	<start-state name="start-state1">
  | 		<transition to="tsmactoncr"></transition>
  | 	</start-state>
  | 
  | 	<state name="tsmactoncr" async="true">
  | 		<timer name="timer" duedate="7 seconds" transition="to escalated">
  | 			<action class="yourpackage.Action1"></action>
  | 		</timer>
  | 		<transition to="normailflow" name="to normal flow"></transition>
  | 		<transition to="escalationflow" name="to escalated"></transition>
  | 	</state>
  | 	
  | 	<state name="normailflow">
  | 		<event type="node-enter">
  | 			<script>
  | 				System.out.println("Node-enter: normailflow");
  | 			</script>		
  | 		</event>
  | 		<transition to="end-state1"></transition>
  | 	</state>
  | 	
  | 	<state name="escalationflow">
  | 		<event type="node-enter">
  | 			<script>
  | 				System.out.println("Node-enter: escalationflow");
  | 			</script>		
  | 		</event>	
  | 		<transition to="end-state1"></transition>
  | 	</state>
  | 	
  | 	<end-state name="end-state1"></end-state>
  | 
  | </process-definition>

package yourpackage;
  | 
  | import org.jbpm.graph.def.ActionHandler;
  | import org.jbpm.graph.exe.ExecutionContext;
  | 
  | public class Action1 implements ActionHandler
  | {
  | 	private static final long serialVersionUID = 532619789299259672L;
  | 
  | 	@Override
  | 	public void execute(ExecutionContext executionContext) throws Exception 
  | 	{
  | 		for(int cpt=0;cpt<1000;cpt++)
  | 		{
  | 			System.out.println("Action 1: "+cpt);
  | 		}
  | 	}
  | }

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218685#4218685

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218685



More information about the jboss-user mailing list