Workflow Variable Access
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2007 02:50 PM
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:
Here is the process definition:
and finally the relavent portion of the web-client-config-custom.xml:
It would be really useful to be able to display these values in read only mode later 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.
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2007 06:58 AM
I tried your process and it looks like there may be an issue with the handling of boolean values. Otherwise, the values are transmitted from one task to another.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2007 11:22 AM
Actually, there isn't an issue with boolean values. My test definition had an issue.
Below, I've provided updated model and process definition which will suit your needs. I made the following changes:
- compressed the model definition by introducing an aspect for all change properties
- compressed the model by defining a base type definition for all your tasks (they were mostly the same). The definition includes package actions and the change properties aspect
- removed all task controllers from process definition. By default, all task properties are pulled and pushed to the process. A task controller is only required for control over which variables are pulled from or pushed to the process
As a side note, I used the Workflow Console (http://wiki.alfresco.com/wiki/Workflow_Console) for quick testing of the definition without the need to start the Alfresco server, or UI configuration.
Below, I've provided updated model and process definition which will suit your needs. I made the following changes:
- compressed the model definition by introducing an aspect for all change properties
- compressed the model by defining a base type definition for all your tasks (they were mostly the same). The definition includes package actions and the change properties aspect
- removed all task controllers from process definition. By default, all task properties are pulled and pushed to the process. A task controller is only required for control over which variables are pulled from or pushed to the process
As a side note, I used the Workflow Console (http://wiki.alfresco.com/wiki/Workflow_Console) for quick testing of the definition without the need to start the Alfresco server, or UI configuration.
<?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> <mandatory-aspects> <aspect>sykwfqs:changeDetails</aspect> </mandatory-aspects> </type> <type name="sykwfqs:workflowTask"> <parent>bpm:workflowTask</parent> <overrides> <property name="bpm:packageActionGroup"> <default>add_package_item_actions</default> </property> <property name="bpm:packageItemActionGroup"> <default>edit_package_item_actions</default> </property> </overrides> <mandatory-aspects> <aspect>sykwfqs:changeDetails</aspect> </mandatory-aspects> </type> <type name="sykwfqs:assignManagementRepresentative"> <parent>sykwfqs:workflowTask</parent> <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> </type> <type name="sykwfqs:managementRepresentativeApprove"> <parent>sykwfqs:workflowTask</parent> </type> <type name="sykwfqs:documentControlApproveAndImplement"> <parent>sykwfqs:workflowTask</parent> </type> </types> <aspects> <aspect name="sykwfqs:changeDetails"> <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> </aspect> </aspects> </model>
<?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"/> <transition name="complete" to="assignManagementRepresentative"/> </start-state> <task-node name="assignManagementRepresentative"> <task name="sykwfqs:assignManagementRepresentative" swimlane="initiator" /> <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" /> <transition name="Approve" to="documentControlApproveAndImplement"/> </task-node> <task-node name="documentControlApproveAndImplement"> <task name="sykwfqs:documentControlApproveAndImplement" swimlane="initiator" /> <transition name="Complete" to="end"/> </task-node> <end-state name="end"/></process-definition>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2007 05:49 AM
Hi,
It seems that it does not work properly in some case.
Currently i can not display correctly a value which have a constraint of type LIST and a default value.
In fact, the value is well flushed from task variables to process variables and therefore are accessibles in the javascript (event management)
but the transient node properties are not well initialized for the manageTaskDialog.
(In my code, i check the urgency level, and send email if it is high or very high to the assigned group.)
It seems that it does not work properly in some case.
Currently i can not display correctly a value which have a constraint of type LIST and a default value.
….<constraint name="wfc:levelList" type="LIST"> <parameter name="allowedValues"> <list> <value>Low</value> <value>Medium</value> <value>High</value> <value>Very High</value> </list> </parameter></constraint>…..…..<property name="wfc:level"> <title>Urgency Level</title> <type>d:text</type> <default>Low</default> <constraints> <constraint ref="wfc:levelList" /> </constraints></property>….
In fact, the value is well flushed from task variables to process variables and therefore are accessibles in the javascript (event management)
but the transient node properties are not well initialized for the manageTaskDialog.
(In my code, i check the urgency level, and send email if it is high or very high to the assigned group.)
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <script> if (wfc_level == 'High' || wfc_level == 'Very High') { var mail = actions.create("mail"); var recipients = new Array(1); recipients[0] = "GROUP_healthEmergencyOfficers"; mail.parameters.to_many = recipients; mail.parameters.subject = "Collect information Task " + bpm_workflowDefinition; mail.parameters.text = "A collection information task requires your direct attention."; mail.execute(bpm_package); } </script> </action>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2007 06:38 AM
Ok, i see the problem.
Forget about the 'default' value, this is the problem.
It should be the way the uicomponent is initiated (default value takes over the value flushed by the JBPM)
Also, I can not use the <multiple>true</multiple>, it's impossible to set values with the standard uicomponent.
But this is not very important right now, i don't need this one…just to mention.:wink:
Best regards.
JMarc
Forget about the 'default' value, this is the problem.
It should be the way the uicomponent is initiated (default value takes over the value flushed by the JBPM)
Also, I can not use the <multiple>true</multiple>, it's impossible to set values with the standard uicomponent.
But this is not very important right now, i don't need this one…just to mention.:wink:
Best regards.
JMarc
