AnsweredAssumed Answered

Passing the custom control with values from task to task when its done?

Question asked by noohulalthaf on Dec 21, 2017

I have used custom ftl control in share , when workflow starts the control is visible and everything works fine in start task, when i submit the task to next assignee, i need to assign the same form with values displayed when the next assignee open the task, but now i am not getting that control in next stage. this is my code 

 

In my workflow  model i created these types and aspect, there are three levels of approval in process

 

<types>
<type name="hxwf:UserTask">
<parent>bpm:startTask</parent>
<mandatory-aspects>

<aspect>hxwf:userControlaspect</aspect>
</mandatory-aspects>
</type>

<type name="hxwf:SupervisorTask">
<parent>bpm:startTask</parent>
<mandatory-aspects>
<aspect>hxwf:userControlaspect</aspect>
</mandatory-aspects>
</type>

<type name="hxwf:ManagerTask">
<parent>bpm:startTask</parent>
<mandatory-aspects>
<aspect>hxwf:userControlaspect</aspect>
</mandatory-aspects>
</type>

</types>


<aspects>

<aspect name="hxwf:userControlaspect">
<title>Document Status</title>
<properties>
<property name="hxwf:userDetails">
<title> User Details</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>

</properties>
</aspect>
</aspects>

 

This is my process demo.bpmn20.xml code:

 

<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.mycompany.com/model/workflow/1.0/Demo">
<process id="Demo" name="Gatepass Demo" isExecutable="true">
<startEvent id="startevent1" name="Start" activiti:formKey="hxwf:UserTask"></startEvent>
<userTask id="User1" name="Employer Reveiw" activiti:async="true" activiti:assignee="shabanash" activiti:formKey="hxwf:SupervisorTask"></userTask>
<exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
<userTask id="usertask2" name="Passed" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:adhocTask"></userTask>
<userTask id="usertask3" name="Denied by Manager" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:adhocTask"></userTask>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow3" sourceRef="User1" targetRef="exclusivegateway2"></sequenceFlow>
<sequenceFlow id="flow6" sourceRef="usertask2" targetRef="endevent1"></sequenceFlow>
<sequenceFlow id="flow7" sourceRef="startevent1" targetRef="User1"></sequenceFlow>
<exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
<userTask id="user2" name="Manager Reveiw" activiti:async="true" activiti:assignee="remiz" activiti:formKey="hxwf:UserTask"></userTask>
<sequenceFlow id="flow8" sourceRef="exclusivegateway2" targetRef="user2"></sequenceFlow>
<userTask id="denieduser1" name="Denied by Employer" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:adhocTask"></userTask>
<sequenceFlow id="flow9" sourceRef="exclusivegateway2" targetRef="denieduser1"></sequenceFlow>
<sequenceFlow id="flow10" sourceRef="user2" targetRef="exclusivegateway1"></sequenceFlow>
<sequenceFlow id="flow11" sourceRef="exclusivegateway1" targetRef="usertask2"></sequenceFlow>
<sequenceFlow id="flow12" sourceRef="exclusivegateway1" targetRef="usertask3"></sequenceFlow>
<sequenceFlow id="flow14" sourceRef="usertask3" targetRef="User1"></sequenceFlow>
<sequenceFlow id="flow15" sourceRef="denieduser1" targetRef="User1"></sequenceFlow>
</process>

 

In my share config file:

 

<config evaluator="string-compare" condition="activiti$Demo">
<forms>
<form>
<field-visibility>
<show id="hxwf:userDetails" />
</field-visibility>
<appearance> <set id="" appearance="title" label-id="workflow.set.general" />

<set id="userDetails" appearance="title" label="User Details" />

<field id="hxwf:userDetails" label-id="workflow.field.userDetails">

<control template="/org/alfresco/components/form/controls/workflow/userdetails.ftl" >

<control-param name="style">width: 95%</control-param>

</control>
</field>

</appearance>
</form>
</forms>
</config>

<config evaluator="task-type" condition="hxwf:UserTask">
<forms>
<form>
<field-visibility>
<show id="hxwf:userDetails" />
</field-visibility>
<appearance> <set id="" appearance="title" label-id="workflow.set.general" />

<set id="userDetails" appearance="title" label="User Details" />

<field id="hxwf:userDetails" label-id="workflow.field.userDetails">

<control template="/org/alfresco/components/form/controls/workflow/userdetails.ftl" >

<control-param name="style">width: 95%</control-param>

</control>
</field>

</appearance>
</form>
</forms>
</config>
<config evaluator="task-type" condition="hxwf:SupervisorTask">
<forms>
<form>
<field-visibility>
<show id="hxwf:userDetails" />
</field-visibility>
<appearance> <set id="" appearance="title" label-id="workflow.set.general" />

<set id="userDetails" appearance="title" label="User Details" />

<field id="hxwf:userDetails" label-id="workflow.field.userDetails">

<control template="/org/alfresco/components/form/controls/workflow/userdetails.ftl" >

<control-param name="style">width: 95%</control-param>

</control>
</field>

</appearance>
</form>
</forms>
</config>

 

Please help me to find out what went wrong in my code?

Outcomes