AnsweredAssumed Answered

Workflow Variable Access

Question asked by adam.stortz on Jan 31, 2007
Latest reply on May 3, 2007 by jmliege
I have a workflow where there are several tasks, and in some tasks I would like to show the values provided in previous tasks in the workflow.

I have part of this working.  I can display text from previous items, but not other value types like boolean.  If I try to display a boolean value, it just shows an empty text field.  Also, when I do this, I cannot continue the workflow, because it expects values to be provided for the variables that are read only in the latter tasks.

Here is my model definition for the tasks in question:


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

<model name="sykwfqs:qualitySystemChangeWorkflow" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <namespaces>
      <namespace uri="http://inst.stryker.com/model/workflow/qualitySystem" prefix="sykwfqs"/>
   </namespaces>
     
   <types>

    
     
      <type name="sykwfqs:start">
         <parent>bpm:startTask</parent>
         <properties>
         <property name="sykwfqs:descriptionOfChange">
            <type>d:text</type>
            <mandatory enforced="false">true</mandatory>
         </property>
         <property name="sykwfqs:reasonForChangeRegulations">
            <type>d:boolean</type>
            <mandatory enforced="false">true</mandatory>
         </property>
         <property name="sykwfqs:reasonForChangeProcess">
            <type>d:boolean</type>
            <mandatory enforced="false">true</mandatory>
         </property>
         <property name="sykwfqs:reasonForChangeNew">
            <type>d:boolean</type>
            <mandatory enforced="false">true</mandatory>
         </property>
         <property name="sykwfqs:reasonForChangeIncorporation">
            <type>d:boolean</type>
            <mandatory enforced="false">true</mandatory>
         </property>
         </properties>
      </type>

      <type name="sykwfqs:assignManagementRepresentative">
         <parent>bpm:workflowTask</parent>
       <properties>
       </properties>
         <associations>

         <association name="sykwfqs:managementRepresentative">
            <source>
               <mandatory>false</mandatory>
               <many>false</many>
            </source>
            <target>
               <class>cm:person</class>
               <mandatory>true</mandatory>
               <many>false</many>
            </target>
         </association>

      </associations>
         <overrides>
            <property name="bpm:packageActionGroup">
               <default>add_package_item_actions</default>
            </property>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         <property name="sykwfqs:descriptionOfChange">
         </property>
         <property name="sykwfqs:reasonForChangeRegulations">
         </property>
         <property name="sykwfqs:reasonForChangeProcess">
         </property>
         <property name="sykwfqs:reasonForChangeNew">
         </property>
         <property name="sykwfqs:reasonForChangeIncorporation">
         </property>
         </overrides>
      </type>

      <type name="sykwfqs:managementRepresentativeApprove">
         <parent>bpm:workflowTask</parent>
       <properties>
       </properties>
         <overrides>
            <property name="bpm:packageActionGroup">
               <default>add_package_item_actions</default>
            </property>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="sykwfqs:documentControlApproveAndImplement">
         <parent>bpm:workflowTask</parent>
       <properties>
       </properties>
         <overrides>
            <property name="bpm:packageActionGroup">
               <default>add_package_item_actions</default>
            </property>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>


   </types>

</model>

Here is the process definition:


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

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

   <swimlane name="initiator"/> <!– class??  –>

   <start-state name="start">
      <task name="sykwfqs:start" swimlane="initiator">
       <controller>
            <variable name="sykwfqs_descriptionOfChange" access="read,write,required"></variable>
         </controller>
       </task>
      <transition name="complete" to="assignManagementRepresentative"/>
   </start-state>

    <task-node name="assignManagementRepresentative">
      <task name="sykwfqs:assignManagementRepresentative" swimlane="initiator">
       <controller>
            <variable name="sykwfqs_descriptionOfChange" access="read" />
            <variable name="sykwfqs_reasonForChangeRegulations" access="read" />
            <variable name="sykwfqs_reasonForChangeProcess" access="read" />
            <variable name="sykwfqs_reasonForChangeNew" access="read" />
            <variable name="sykwfqs_reasonForChangeIncorporation" access="read" />
         </controller>
      </task>
      <transition name="Send For Review" to="managementRepresentativeApprove"/>
   </task-node>
      
   <swimlane name="managementRepresentative">
      <assignment actor-id="#{sykwfqs_managementRepresentative.properties['cm:userName']}"/>
   </swimlane>
  
    <task-node name="managementRepresentativeApprove">
      <task name="sykwfqs:managementRepresentativeApprove" swimlane="managementRepresentative">
       <controller>
            <variable name="sykwfqs_descriptionOfChange" access="read" />
            <variable name="sykwfqs_reasonForChangeRegulations" access="read" />
            <variable name="sykwfqs_reasonForChangeProcess" access="read" />
            <variable name="sykwfqs_reasonForChangeNew" access="read" />
            <variable name="sykwfqs_reasonForChangeIncorporation" access="read" />
         </controller>
      </task>
      <transition name="Approve" to="documentControlApproveAndImplement"/>
   </task-node>
  
    <task-node name="documentControlApproveAndImplement">
      <task name="sykwfqs:documentControlApproveAndImplement" swimlane="initiator">
       <controller>
            <variable name="sykwfqs_descriptionOfChange" access="read" />
            <variable name="sykwfqs_reasonForChangeRegulations" access="read" />
            <variable name="sykwfqs_reasonForChangeProcess" access="read" />
            <variable name="sykwfqs_reasonForChangeNew" access="read" />
            <variable name="sykwfqs_reasonForChangeIncorporation" access="read" />
         </controller>
      </task>
      <transition name="Complete" to="end"/>
   </task-node>

   <end-state name="end"/>

</process-definition>

and finally the relavent portion of the web-client-config-custom.xml:
   <config evaluator="node-type" condition="sykwfqs:start" replace="true">
      <property-sheet>
         <separator name="general" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="sykwfqs:descriptionOfChange" component-generator="TextAreaGenerator" read-only="false"/>
         <show-property name="sykwfqs:reasonForChangeRegulations" />
         <show-property name="sykwfqs:reasonForChangeProcess" />
         <show-property name="sykwfqs:reasonForChangeNew" />
         <show-property name="sykwfqs:reasonForChangeIncorporation" />
      </property-sheet>
   </config>
  
   <config evaluator="node-type" condition="sykwfqs:assignManagementRepresentative" replace="true">
      <property-sheet>
         <separator name="user" display-label-id="user_filter_user" component-generator="HeaderSeparatorGenerator" />
         <show-association name="sykwfqs:managementRepresentative" />
         <separator name="general" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="sykwfqs:descriptionOfChange" component-generator="TextAreaGenerator" read-only="true"/>
         <show-property name="sykwfqs:reasonForChangeRegulations" read-only="true" />
         <show-property name="sykwfqs:reasonForChangeProcess" read-only="true" />
         <show-property name="sykwfqs:reasonForChangeNew" read-only="true" />
         <show-property name="sykwfqs:reasonForChangeIncorporation" read-only="true"/>
      </property-sheet>
   </config>
  
   <config evaluator="node-type" condition="sykwfqs:managementRepresentativeApprove" replace="true">
      <property-sheet>
         <separator name="general" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="sykwfqs:descriptionOfChange" read-only="true"/>
         <show-property name="sykwfqs:reasonForChangeRegulations" read-only="true" />
         <show-property name="sykwfqs:reasonForChangeProcess" read-only="true" />
         <show-property name="sykwfqs:reasonForChangeNew" read-only="true" />
         <show-property name="sykwfqs:reasonForChangeIncorporation" read-only="true"/>
      </property-sheet>
   </config>
   <config evaluator="node-type" condition="sykwfqs:documentControlApproveAndImplement" replace="true">
      <property-sheet>
         <separator name="general" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="sykwfqs:descriptionOfChange" read-only="true"/>
         <show-property name="sykwfqs:reasonForChangeRegulations" read-only="true" />
         <show-property name="sykwfqs:reasonForChangeProcess" read-only="true" />
         <show-property name="sykwfqs:reasonForChangeNew" read-only="true" />
         <show-property name="sykwfqs:reasonForChangeIncorporation" read-only="true"/>
      </property-sheet>
   </config>

It would be really useful to be able to display these values in read only mode later in the workflow.

Outcomes