AnsweredAssumed Answered

Is the task controller working at all ?

Question asked by rand on Nov 15, 2006
Latest reply on Nov 16, 2006 by rand
Hi there, here's my problem :

I am trying to determine if the task controller has any effect ('cause I've been having the feeling it has none for some time now). To do that, I've created a very simple task model and a test workflow.

workflow :
[size=75]
(…)
   <start-state name="Start">
      <task name="ecm:Task1" swimlane="initiator">
         <controller>
            <variable name="ecm:1" access="read,write,required" mapped-name="ecm:m11"/>
            <variable name="ecm:2" access="read" mapped-name="ecm:m12"/>
            <variable name="ecm:3" access="write" mapped-name="ecm:m13"/>
         </controller>
      </task>
      <transition name="" to="Node2"></transition>
   </start-state>

   <task-node name="Node2">
      <task name="ecm:Task2" swimlane="initiator">
         <controller>
            <variable name="ecm:1" access="read,write,required" mapped-name="ecm:m21"/>
            <variable name="ecm:2" access="read,write" mapped-name="ecm:m22"/>
            <variable name="ecm:3" access="read" mapped-name="ecm:m23"/>
         </controller>
      </task>
      <transition name="" to="end"></transition>
   </task-node>
(…)
[/size]

task model :
[size=75]
(…)
   <type name="ecm:Task1">
      <parent>bpm:startTask</parent>
        <properties>
           <property name="ecm:m11">
               <type>d:int</type>
            </property>
            <property name="ecm:m12">
               <type>d:int</type>
            </property>
            <property name="ecm:m13">
               <type>d:int</type>
            </property>
         </properties>
   </type>

   <type name="ecm:Task2">
      <parent>bpm:workflowTask</parent>
        <properties>
         <property name="ecm:m21">
               <type>d:int</type>
            </property>
            <property name="ecm:m22">
               <type>d:int</type>
            </property>
            <property name="ecm:m23">
               <type>d:int</type>
            </property>
         </properties>            
   </type>
(…)
[/size]

web-client-config-custom :
[size=75]
(…)
   <config evaluator="node-type" condition="ecm:Task2" replace="true">
      <property-sheet>
         <show-property name="ecm:m11" />
         <show-property name="ecm:m12" />
         <show-property name="ecm:m13" />
         </property-sheet>
   </config>
   
   <config evaluator="node-type" condition="ecm:Task2" replace="true">
      <property-sheet>
         <show-property name="ecm:m21" />
         <show-property name="ecm:m22" />
         <show-property name="ecm:m23" />
         </property-sheet>
   </config>
(…)
[/size]

When I test this, everything works fine as far as swimlanes and transitions are concerned, but :
- the m11 property isn't mandatory (neither in the first task nor in the second)
- in the second task, all fields are empty whereas m21 and m22 should have the values entered in the first task

Am I doing something wrong ?

Some time ago I avoided these problems by using the <mandatory> option in the task model, and the read-only="true" in the web-client-config.
Since properties with identical names in different task types are forbidden, I had defined one "base task type" of which every task in my workflow was a child.
This way, property values were passed from a task to the following without using the controller. However, it required that every task be a child from bpm:startTask, and mandatory properties were required in every task, even when the were read-only.

I guess this last part must not be very clear, but the important thing is, I know workarounds for this problem. However, using the controller would be much more simple and "clean".

Don't hesitate to ask for details, and thanks for any help you choose to offer.

Rand

Outcomes