02-20-2015 10:17 AM
var orderMatOwner = null;
<sequenceFlow id="flow3" name="Traveller Resubmitted" sourceRef="submitCPMTraveller" targetRef="orderMaterial"></sequenceFlow>
<userTask id="orderMaterial" name="Order Materials" activiti:candidateGroups="GROUP_WF_CPMCustomerService" activiti:formKey="cpmwf:CPMOrdermaterial">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
<![CDATA[
if (typeof orderMatOwner != null) bpm_assignee = orderMatOwner) (also have tried task.owner, task.Owner, and task.getOwner)
execution.setVariable('cpmwf_previousComment', bpm_comment);
execution.setVariable('cpmwf_wfName', bpm_workflowDescription);
execution.setVariable('bpm_comment', bpm_comment);
if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
]]>
</activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[
execution.setVariable('orderMatOwner', bpm_assignee) (also have tried task.owner, task.Owner, and task.getOwner)
execution.setVariable('wf_reviewOutcome', task.getVariable('cpmwf_CPMorderMaterialOutcome'));
execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));]]></activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
02-27-2015 02:28 PM
<type name="putwf:baseWF">
<parent>wf:activitiReviewTask</parent>
<properties>
<property name="putwf:previousComment">
<title>Placeholder to display comment from previous task at Task Level</title>
<type>d:text</type>
</property>
<property name="putwf:wfName">
<title>Placeholder to display comment from previous task at Task Level</title>
<type>d:text</type>
</property>
<property name="putwf:EngineerOwner">
<title>Placeholder to display the assignee(claimer) of the Order Material Task</title>
<type>d:text</type>
</property>
</properties>
<overrides>
<property name="bpm:packageActionGroup">
<default>add_package_item_actions</default>
</property>
<property name="bpm:packageItemActionGroup">
<default>edit_and_remove_package_item_actions</default>
</property>
</overrides>
</type>
<config evaluator="task-type" condition="putwf:EngineeringRedraw2">
<forms>
<form>
<field-visibility>
<show id="putwf:wfName" />
<show id="putwf:previousComment" />
<show id="taskOwner" />
<show id="putwf:EngineerOwner" />
<show id="bpm:priority" />
<show id="bpm:dueDate" />
<show id="bpm:status" />
<show id="packageItems" />
<show id="bpm:comment" />
<show id="putwf:engineeringOutcome2" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.task.info" />
<set id="info" appearance="" template="/org/alfresco/components/form/3-column-set.ftl" />
<set id="progress" appearance="title" label-id="workflow.set.task.progress" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="response" appearance="title" label-id="workflow.set.response" />
<field id="putwf:wfName" label-id="name.workflow.field.message" description-id="name.workflow.field.message">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>
<field id="putwf:previousComment" label-id="name.workflow.field.prevcomment">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>
<field id="taskOwner" set="info" />
<field id="putwf:EngineerOwner" label-id="pennUnited.workflow.field.engineerowner">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>
<field id="bpm:priority" set="info" read-only="true">
<control template="/org/alfresco/components/form/controls/workflow/ftkpriority.ftl" />
</field>
<field id="bpm:dueDate" set="info" label-id="workflow.field.due">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>
<field id="bpm:status" set="progress" />
<field id="packageItems" set="items" />
<field id="bpm:comment" label-id="workflow.field.comment" set="response">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 95%</control-param>
</control>
</field>
<field id="putwf:engineeringOutcome2" label-id="workflow.field.outcome" set="response">
<control template="/org/alfresco/components/form/controls/workflow/activiti-transitions.ftl" />
</field>
</appearance>
</form>
</forms>
</config>
<userTask id="EngineeringRedraw" name="Redraw Engineering Part" activiti:candidateGroups="GROUP_WF_Engineering" activiti:formKey="putwf:EngineeringRedraw">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[
if (typeof putwf_EngineerOwner != 'undefined')
{
task.setAssignee(putwf_EngineerOwner);
}
else
{
task.setAssignee(null);
}
execution.setVariable('putwf_previousComment', bpm_comment);
execution.setVariable('putwf_wfName', bpm_workflowDescription);
execution.setVariable('bpm_comment', bpm_comment);
if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;]]></activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[var children = bpm_package.getChildren();
var localengTaskRes = null;
for( var i=0; i<children.length; i++)
{
var thisNode = children;
var engResult = thisNode.properties['putwf:engResult'];
if ( engResult != null && engResult.length != 0 )
{
localengTaskRes = thisNode.properties['putwf:engResult'];
}
thisNode.properties['putwf:engResult'] = null;
thisNode.save();
}
if( localengTaskRes == "Automatically Completed" )
{
task.setVariableLocal('putwf_engineeringOutcome', "Engineering Finished");
task.setVariableLocal('bpm_comment', "Engineering drawing has been uploaded.");
execution.setVariable('wf_reviewOutcome', "Engineering Finished");
//execution.setVariable('bpm_comment', "Engineering drawing has been uploaded.");
}
else
{
putwf_EngineerOwner = task.getAssignee();
execution.setVariable('wf_reviewOutcome', task.getVariable('putwf_engineeringOutcome'));
execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));
execution.setVariable('putwf_EngineerOwner', task.getAssignee());
}]]></activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.