[JBoss jBPM] - Re: Need help to fix timer issue
by gchanteb
Yep,
here are my JBoss AS logs when i use the process under jbpm-console:
11:14:13,199 INFO [STDOUT] Arunkumar---::tsmactoncr
11:14:13,239 INFO [STDOUT] Mail assignment handler.
My tasks in jbpm-console:
2 mail gchanteb(a)mycompany.com Not Started Examine Suspend Start
For this process:
<?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="process4">
|
| <start-state name="start-state1">
| <transition to="tsmactoncr"></transition>
| </start-state>
|
| <state name="tsmactoncr" async="true">
| <event type="node-leave">
| <cancel-timer name="timer"></cancel-timer>
| </event>
| <timer duedate="7 seconds" name="timer" transition="to escalated">
| <script>
| System.out.println("Arunkumar---::"+node.getName());
| </script>
| </timer>
| <transition to="normailflow" name="to normal flow"></transition>
| <transition to="escalationflow" name="to escalated"></transition>
| </state>
|
| <state name="normailflow">
| <transition to="end-state1" name="to end-state1"></transition>
| </state>
|
| <task-node name="escalationflow">
| <task name="mail">
| <assignment class="mypackage.MailAssignmentHandler"></assignment>
| </task>
| <transition to="end-state1"></transition>
| </task-node>
|
| <end-state name="end-state1"></end-state>
|
| </process-definition>
And this MailAssignmentHandler:
mypackage;
|
| import org.jbpm.graph.exe.ExecutionContext;
| import org.jbpm.taskmgmt.def.AssignmentHandler;
| import org.jbpm.taskmgmt.exe.Assignable;
|
| public class MailAssignmentHandler implements AssignmentHandler
| {
| private static final long serialVersionUID = 9083542019895942536L;
|
| @Override
| public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception
| {
| System.out.println("Mail assignment handler.");
| assignable.setActorId("gchanteb(a)mycompany.com");
| }
| }
I hope it helps you...
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218988#4218988
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218988
17 years, 1 month
[JBoss jBPM] - JUnit : process with timers / async=
by gchanteb
Hi,
I would like to know your methods to JUnit test process with timers and asynchronous mode enabled.
For example, if i have this basic JUnit test:
public void testProcess()
| {
| createnewProcessInstance();
| assertEquals(1, processInstance.getId());
|
| Token rootToken = processInstance.getRootToken();
| assertEquals("start-state", rootToken.getNode().getName());
|
| processInstance.signal();
|
| assertEquals("timer-state", rootToken.getNode().getName());
|
| processInstance.signal();
|
| assertEquals("end-state", rootToken.getNode().getName());
| }
for this process:
<?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="process6">
|
| <start-state name="start-state">
| <transition to="timer-state"></transition>
| </start-state>
|
| <state name="timer-state">
| <transition to="end-state" name="to end-state"></transition>
| </state>
|
| <end-state name="end-state"></end-state>
|
| </process-definition>
What should be my new JUnit test for this process:
<?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="process6">
|
| <start-state name="start-state">
| <transition to="timer-state"></transition>
| </start-state>
|
| <state name="timer-state" async="true">
| <timer name="timer" duedate="5 seconds" transition="to end-state">
| <action class="Action"></action>
| </timer>
| <transition to="end-state" name="to end-state"></transition>
| </state>
|
| <end-state name="end-state"></end-state>
|
| </process-definition>
Thx.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218965#4218965
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218965
17 years, 1 month