Params submitted via a taskform tied to the start activity cant be referenced in
expressions till a task halt has been added to the workflow
--------------------------------------------------------------------------------------------------------------------------------------------
Key: JBPM-2471
URL:
https://jira.jboss.org/jira/browse/JBPM-2471
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: jBPM 4.0
Environment: Win XP, Jboss 5.0 GA, JBPM4, HSQL (bundled)
Reporter: Lalit Mathwani
See :http://www.jboss.org/index.html?module=bb&op=viewtopic&t=159414 for a
description of the issue.
Here's a process description snippet:
<?xml version="1.0" encoding="UTF-8"?>
<process name="GTRIHelpRequest"
xmlns="http://jbpm.org/4.0/jpdl">
<on event="start">
<event-listener class="gtri.jbpm.pilot.LogListener">
<field name="msg"><string value="starting the process
GTRIHelpRequest"/></field>
</event-listener>
</on>
<start form="gtri/jbpm/pilot/demo/request_help.ftl" g="0,0,80,40"
name="start">
<on event="start">
<event-listener class="gtri.jbpm.pilot.LogListener">
<field name="msg"><string value="In the start activity -
start event - of GTRIHelpRequest process"/></field>
</event-listener>
</on>
<transition to="debug_variables"/>
</start>
<script expr="Just dumping process variables" g="66,10,80,40"
name="debug_variables" var="processVarABC">
<on event="start">
<event-listener class="gtri.jbpm.pilot.LogListener">
<field name="msg"><string value="In the debug variables
activity - start event - of GTRIHelpRequest process"/></field>
</event-listener>
</on>
<transition to="is_lab_approval_needed"/>
</script>
<decision g="354,85,80,40" name="is_lab_approval_needed">
<on event="start">
<event-listener class="gtri.jbpm.pilot.LogListener">
<field name="msg"><string value="In the is_lab_approval
activity - start event - of GTRIHelpRequest process"/></field>
</event-listener>
</on>
<transition to="in_lab_approval_email">
<condition expr="#{(hr_subcategory=='newhire') ||
(hr_subcategory=='newconst') || (hr_subcategory=='badge') }"/>
</transition>
<transition to="in_request_handling_email"/>
</decision>
We have a form tied to the start activity. In this form(request_help.ftl) , we submit a
param hr_subcategory:
<tr>
<td>Sub-categories:</td>
<td>
<select name="hr_subcategory">
<option value="newhire">New Hire</option>
<option value="others">Others</option>
</select>
</td>
<tr>
We transition to the is_lab_approval_needed decision after a debug activity. In the
decision, is_lab_approval_needed, we try to reference the hr_subcategory value as follows
in one of the conditions:
<condition expr="#{(hr_subcategory=='newhire') ||
(hr_subcategory=='newconst') || (hr_subcategory=='badge') }"/>
This reference causes a Null pointer to be thrown back on the BPM workflow console.
Now introduce a halt in the workflow before the decision eg :
<script expr="Just dumping process variables" g="66,10,80,40"
name="debug_variables" var="processVarABC">
<on event="start">
<event-listener class="gtri.jbpm.pilot.LogListener">
<field name="msg"><string value="In the debug variables
activity - start event - of GTRIHelpRequest process"/></field>
</event-listener>
</on>
<transition to="manager_approval"/>
</script>
<task candidate-users="peter,mary"
form="gtri/jbpm/pilot/demo/manager_approval.ftl" g="163,10,131,40"
name="manager_approval">
<on event="start">
<event-listener class="gtri.jbpm.pilot.LogListener">
<field name="msg"><string value="In the
manager_approval_test activity - start event - of GTRIHelpRequest
process"/></field>
</event-listener>
</on>
<notification/>
<transition g="-38,-18" name="Allowed"
to="is_lab_approval_needed"/>
<transition g="-38,-18" name="Sorry"
to="request_rejected"/>
</task>
<decision g="354,85,80,40" name="is_lab_approval_needed">
<on event="start">
<event-listener class="gtri.jbpm.pilot.LogListener">
<field name="msg"><string value="In the is_lab_approval
activity - start event - of GTRIHelpRequest process"/></field>
</event-listener>
</on>
<transition to="in_lab_approval_email">
<condition expr="#{(hr_subcategory=='newhire') ||
(hr_subcategory=='newconst') || (hr_subcategory=='badge') }"/>
</transition>
<transition to="in_request_handling_email"/>
</decision>
The NPE is resolved - the hr_subcategory is now visible in the decision after the manager
approval.
The params submitted via the taskform linked with the start activity should be available
in any subsequent activity for reference in a expression ..without having to impose a halt
in the workflow like we had to.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira