0
votes

Please give me some examples on using OnEntry and OnExit action scripts in a Human Task in JBPM-5. When I write the action scripts on the node's property, it does not reflect in the bpmn2.0 XML. I understand that OnEntry and OnExit are not specifications of BPMN2.0, but if thats the case, how can we effectively use this feature on a Human task.

In my case, I want to send a notification email whenever the Human task is reached. I should be able to send a link to the process that task to the actor's email id.

Please help.

1

1 Answers

2
votes

I managed to find the solution myself. I manually added these lines in the xml within the UserTask node

    <extensionElements>
        <tns:onEntry-script scriptFormat="http://www.java.com/java">
          <script>
            System.out.println("ON ENTRY : ");          
          </script>
        </tns:onEntry-script>
        <tns:onExit-script scriptFormat="http://www.java.com/java">
          <script>
                System.out.println("ON EXIT : ");
          </script>
        </tns:onExit-script>
   </extensionElements>

For sending emails, i am passing the process ID in the link. When the link is clicked, i use a servlet to retrieve the reserved task for that process id by querying and complete that task.