[jboss-jira] [JBoss JIRA] Created: (JBPM-967) Triggered timer on task does not end task, thus leaving task in users inbox.

Dave Caruana (JIRA) jira-events at lists.jboss.org
Fri May 18 12:00:52 EDT 2007


Triggered timer on task does not end task, thus leaving task in users inbox.
----------------------------------------------------------------------------

                 Key: JBPM-967
                 URL: http://jira.jboss.com/jira/browse/JBPM-967
             Project: JBoss jBPM
          Issue Type: Bug
          Components: Core Engine
    Affects Versions: jBPM jPDL 3.2
         Environment: Windows, Mac OS.  Tomcat / MySQL 5.
            Reporter: Dave Caruana
         Assigned To: Tom Baeyens


The "timer" task in the following process definition correctly initiates the timer.  The timer is successfully is triggered after a minute (or so) and the "trigger" transition is correctly signalled.  As a result, the "triggered" task node is entered and its task assigned.

However, the task assigned in "timer" remains assigned.  It's not ended.

<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:testtimers">

    <swimlane name="initiator" />

    <start-state name="start">
        <task swimlane="initiator" />
        <transition name="" to="timer"/>
    </start-state>

    <task-node name="timer">
        <task swimlane="initiator">
           <timer duedate="1 minute" transition="trigger">
               <script>
                 System.out.println("Trigger...");
               </script>
           </timer>
        </task>
        <transition name="trigger" to="triggered" />
    </task-node>

    <task-node name="triggered">
        <event type="node-enter">
           <script>
              System.out.println("Triggered");
           </script>
        </event>
        <task swimlane="initiator"/>
        <transition name="" to="end" />
    </task-node>

    <end-state name="end" />

</process-definition>

I applied the following patch to Timer.java, but am unsure if it's the correct approach, although it fixes the above.  It determines a task instance is associated, and if so, ends the task, rather than the token directly.

Line 84:

    // then take a transition if one is specified
    if ((transitionName != null) && (exception == null)) // and if no unhandled
                                                         // exception occurred
                                                         // during the action
    {
        if (taskInstance != null)
        {
            if (taskInstance.getToken().getNode().hasLeavingTransition(transitionName))
            {
                taskInstance.end(transitionName);
            }
        }
        else if (token.getNode().hasLeavingTransition(transitionName))
        {
            token.signal(transitionName);
        }
    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list