Sunday, July 13, 2014

Alfresco Custom workflow based on specific time to flow between tasks

Hi Every One,

          In this post, i am going to discuss what is workflow and how to create our own custom time based workflow in alfresco share

Workflow:
workflow consists of a sequence of connected steps where each step follows without delay or gap and ends just before the subsequent step may begin. It is a depiction of a sequence of operations, declared as work of a person or group, an organization of staff, or one or more simple or complex mechanisms. Workflow may be seen as any abstraction of real work. For control purposes, workflow may be a view of real work in a chosen aspect, thus serving as a virtual representation of actual work. The flow being described may refer to a document or product that is being transferred from one step to another.
Workflows may be viewed as one primitive building block to be combined with other parts of an organisation's structure such as information silos, teams, projects, policies and hierarchies.

In simple words flow where to go what and accepts and rejects, if accept it has to go some person ,rejects some other and based on specific time flow will move between tasks. these things will be there in workflow.

Time Based Workflow:

This workflow will move the work between different users based on given specific times at usertasks.

Adding new workflow in Alfresco: 
For this you need to add some XML files and edit some XML files.

Files to be added
1)testtimebasedflow.bpmn20.xml( file name can be any thing but extension has to be .bpmn20.xml)
2)workflowTesttimebasedflowmodel-custom.xml (file name can be any thing but extension has to be .xml)
Files to Edit

3)share-workflow-form-config.xml
4)bootstrap-context.xml

Files to be added

testtimebasedflow.bpmn20.xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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.activiti.org/test">
  <process id="testtimebasedflow" name="testtimebasedflow" isExecutable="true">
    <extensionElements>
      <activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
        <activiti:field name="script">
          <activiti:string>execution.setVariable('wf_FinanceGroup', groups.getGroup('Finance').getFullName());
execution.setVariable('wf_BankingGroup', groups.getGroup('Banking').getFullName());
execution.setVariable('wf_HRGroup', groups.getGroup('HR').getFullName());
execution.setVariable('wf_MarketingGroup', groups.getGroup('Marketing').getFullName());
execution.setVariable('wf_AcademicGroup', groups.getGroup('academicunits').getFullName());
          execution.setVariable('wf_OIAGroup', groups.getGroup('OIA').getFullName());
          execution.setVariable('wf_RegistrarGroup', groups.getGroup('Registrar').getFullName());</activiti:string>
        </activiti:field>
      </activiti:executionListener>
    </extensionElements>
    <startEvent id="startevent1" name="Start" activiti:formKey="wf:testtimebasedflow"></startEvent>
    <userTask id="HR" name="HR" activiti:candidateGroups="${wf_HRGroup}" activiti:formKey="wf:HRparallel">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>execution.setVariable('wf_hrOutcome', task.getVariable('wf_hrOutcome'));
execution.setVariable('bpm_assignee', task.getVariable('bpm_assignee'));
                  execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));
                execution.setVariable('wf_manager', person);
                execution.setVariable('bpm_dueDate', task.dueDate);
                execution.setVariable('bpm_priority', task.priority);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="HR"></sequenceFlow>
    <userTask id="Finance" name="Finance" activiti:candidateGroups="${wf_FinanceGroup}" activiti:formKey="wf:Financeparallel">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>execution.setVariable('wf_financeOutcome', task.getVariable('wf_financeOutcome'));
execution.setVariable('bpm_assignee', task.getVariable('bpm_assignee'));
                  execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));
                execution.setVariable('wf_manager', person);
                execution.setVariable('bpm_dueDate', task.dueDate);
                execution.setVariable('bpm_priority', task.priority);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="Marketing" name="Marketing" activiti:candidateGroups="${wf_MarketingGroup}" activiti:formKey="wf:Marketingparallel">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>execution.setVariable('wf_marketingOutcome', task.getVariable('wf_marketingOutcome'));
execution.setVariable('bpm_assignee', task.getVariable('bpm_assignee'));
                  execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));
                execution.setVariable('wf_manager', person);
                execution.setVariable('bpm_dueDate', task.dueDate);
                execution.setVariable('bpm_priority', task.priority);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow3" sourceRef="HR" targetRef="Marketing"></sequenceFlow>
    <userTask id="usertask1" name="Banking" activiti:candidateGroups="${wf_BankingGroup}" activiti:formKey="wf:Bankingparallel">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>execution.setVariable('wf_bankingOutcome', task.getVariable('wf_bankingOutcome'));
execution.setVariable('bpm_assignee', task.getVariable('bpm_assignee'));
                  execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));
                execution.setVariable('wf_manager', person);
                execution.setVariable('bpm_dueDate', task.dueDate);
                execution.setVariable('bpm_priority', task.priority);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <endEvent id="endevent1" name="End"></endEvent>
    <boundaryEvent id="boundarytimer1" name="Timer" attachedToRef="Marketing" cancelActivity="true">
      <timerEventDefinition>
        <timeCycle>5 * * * * ?</timeCycle>
      </timerEventDefinition>
    </boundaryEvent>
    <sequenceFlow id="flow4" sourceRef="boundarytimer1" targetRef="Finance"></sequenceFlow>
    <sequenceFlow id="flow5" sourceRef="Marketing" targetRef="usertask1"></sequenceFlow>
    <sequenceFlow id="flow6" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow>
    <endEvent id="endevent2" name="End"></endEvent>
    <sequenceFlow id="flow7" sourceRef="Finance" targetRef="endevent2"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_testtimebasedflow">
    <bpmndi:BPMNPlane bpmnElement="testtimebasedflow" id="BPMNPlane_testtimebasedflow">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="90.0" y="220.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="boundarytimer1" id="BPMNShape_boundarytimer1">
        <omgdc:Bounds height="30.0" width="30.0" x="426.0" y="250.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="690.0" y="220.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="HR" id="BPMNShape_HR">
        <omgdc:Bounds height="55.0" width="105.0" x="200.0" y="210.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="Finance" id="BPMNShape_Finance">
        <omgdc:Bounds height="55.0" width="105.0" x="360.0" y="330.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="Marketing" id="BPMNShape_Marketing">
        <omgdc:Bounds height="55.0" width="105.0" x="346.0" y="210.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
        <omgdc:Bounds height="55.0" width="105.0" x="520.0" y="210.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
        <omgdc:Bounds height="35.0" width="35.0" x="510.0" y="340.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="125.0" y="237.0"></omgdi:waypoint>
        <omgdi:waypoint x="200.0" y="237.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="305.0" y="237.0"></omgdi:waypoint>
        <omgdi:waypoint x="346.0" y="237.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="441.0" y="280.0"></omgdi:waypoint>
        <omgdi:waypoint x="412.0" y="330.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
        <omgdi:waypoint x="451.0" y="237.0"></omgdi:waypoint>
        <omgdi:waypoint x="520.0" y="237.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
        <omgdi:waypoint x="625.0" y="237.0"></omgdi:waypoint>
        <omgdi:waypoint x="690.0" y="237.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
        <omgdi:waypoint x="465.0" y="357.0"></omgdi:waypoint>
        <omgdi:waypoint x="510.0" y="357.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

This is the file where we add the actual workflow this has to be there in Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\workflow

Description about this workflow: this workflow we are getting all the group names and assigning work as follows




1) flow starts from Hr and this task is move to marketing.
2)marketing user not responds till 1hour it will move ro finance for this we should written cron schedular for specific time.if marketing user responds it will move to banking
3) bankig user will end the flow.

workflowTesttimebasedflowmodel-custom.xml


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

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

<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0"
prefix="d" />
<!-- Import Alfresco System Definitions -->
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
<!-- Import User Model Definitions -->
<import uri="http://www.alfresco.org/model/user/1.0" prefix="usr" />
<import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />
</imports>

<namespaces>
<namespace uri="http://www.alfresco.org/model/workflow/1.0"
prefix="wf" />
</namespaces>

<types>
<type name="wf:testtimebasedflow">
<parent>bpm:startTask</parent>

<mandatory-aspects>
<aspect>wf:workInfo</aspect>
</mandatory-aspects>

</type>

<type name="wf:Financeparallel">
<parent>bpm:activitiOutcomeTask</parent>
<properties>
<property name="wf:financeOutcome">
<type>d:text</type>
<default>Reject</default>
<constraints>
<constraint name="wf:FinanceparallelOptions" type="LIST">
<parameter name="allowedValues">
<list>
<value>Approve</value>
<value>Reject</value>
</list>
</parameter>
</constraint>
</constraints>
</property>
</properties>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
<property name="bpm:outcomePropertyName">
<default>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome
</default>
</property>
</overrides>
<mandatory-aspects>
<!-- <aspect>bpm:assignee</aspect>-->
<aspect>wf:workInfo</aspect>
</mandatory-aspects>
</type>

<type name="wf:HRparallel">
<parent>bpm:activitiOutcomeTask</parent>
<properties>
<property name="wf:hrOutcome">
<type>d:text</type>
<default>Reject</default>
<constraints>
<constraint name="wf:HRparallelOptions" type="LIST">
<parameter name="allowedValues">
<list>
<value>Approve</value>
<value>Reject</value>
</list>
</parameter>
</constraint>
</constraints>
</property>
</properties>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
<property name="bpm:outcomePropertyName">
<default>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome
</default>
</property>
</overrides>
<mandatory-aspects>
<!-- <aspect>bpm:assignee</aspect>-->
<aspect>wf:workInfo</aspect>
</mandatory-aspects>
</type>

<type name="wf:Marketingparallel">
<parent>bpm:activitiOutcomeTask</parent>
<properties>
<property name="wf:marketingOutcome">
<type>d:text</type>
<default>Reject</default>
<constraints>
<constraint name="wf:MarketingparallelOptions" type="LIST">
<parameter name="allowedValues">
<list>
<value>Approve</value>
<value>Reject</value>
</list>
</parameter>
</constraint>
</constraints>
</property>
</properties>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
<property name="bpm:outcomePropertyName">
<default>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome
</default>
</property>
</overrides>
<mandatory-aspects>
<!-- <aspect>bpm:assignee</aspect>-->
<aspect>wf:workInfo</aspect>
</mandatory-aspects>
</type>

</types>

<aspects>

<aspect name="wf:workInfo">
<properties>
<property name="wf:workDescription">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
</aspect>

</aspects>

</model>

this model contains all the types and its's aspects this has to be there in
Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\workflow


This code needs to be added to corresponding files
share-workflow-form-config.xml

<!-- For testtimebased process Workflow -->
<config evaluator="string-compare" condition="activiti$testtimebasedflow">
<forms>
<form>
<field-visibility>
<show id="bpm:workflowDescription" />
<show id="bpm:workflowDueDate" />
<show id="bpm:workflowPriority" />
<show id="wf:workDescription" />
<show id="packageItems" />
<show id="bpm:comment" />
<show id="bpm:sendEMailNotifications" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="info" appearance=""
template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="work" appearance="title" label-id="workflow.set.work" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<set id="response" appearance="title" label-id="workflow.set.response" />

<field id="bpm:workflowDescription" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 95%</control-param>
</control>
</field>

<field id="bpm:workflowDueDate" label-id="workflow.field.due"
set="info" />
<field id="bpm:workflowPriority" label-id="workflow.field.priority"
set="info">
<control
template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
</field>


<field id="packageItems" set="items" />
<field id="wf:workDescription" set="work" />

<field id="bpm:sendEMailNotifications" set="other">
<control
template="/org/alfresco/components/form/controls/workflow/email-notification.ftl" />
</field>

<field id="bpm:comment" label-id="workflow.field.comment"
set="response">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
</appearance>
</form>
</forms>
</config>

<config evaluator="task-type" condition="wf:testtimebasedflow">
<forms>
<form>
<field-visibility>
<show id="message" />
<show id="bpm:dueDate" />
<show id="bpm:priority" />
<show id="wf:workDescription" />
<show id="packageItems" />
<show id="bpm:comment" />

<show id="transitions" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="info" appearance=""
template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="work" appearance="title" label-id="workflow.set.work" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<set id="response" appearance="title" label-id="workflow.set.response" />


<field id="message" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>

<field id="bpm:priority" label-id="workflow.field.priority"
set="info" read-only="true">
<control
template="/org/alfresco/components/form/controls/workflow/priority.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="packageItems" set="items" />

<field id="wf:workDescription" set="work">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>

<field id="bpm:comment" label-id="workflow.field.comment"
set="response">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>


<field id="transitions" set="response" />

</appearance>
</form>
</forms>
</config>
<config evaluator="task-type" condition="wf:Financeparallel">
<forms>
<form>
<field-visibility>
<show id="message" />
<show id="bpm:dueDate" />
<show id="bpm:priority" />
<show id="wf:workDescription" />
<show id="packageItems" />
<show id="bpm:comment" />
<show id="wf:financeOutcome" />
<show id="transitions" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="info" appearance=""
template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="work" appearance="title" label-id="workflow.set.work" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<set id="response" appearance="title" label-id="workflow.set.response" />


<field id="message" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>

<field id="bpm:priority" label-id="workflow.field.priority"
set="info" read-only="true">
<control
template="/org/alfresco/components/form/controls/workflow/priority.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="packageItems" set="items" />

<field id="wf:workDescription" set="work">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>

<field id="bpm:comment" label-id="workflow.field.comment"
set="response">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>

<field id="wf:financeOutcome" set="response" />
<field id="transitions" set="response" />

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

<config evaluator="task-type" condition="wf:Bankingparallel">
<forms>
<form>
<field-visibility>
<show id="message" />
<show id="bpm:dueDate" />
<show id="bpm:priority" />
<show id="wf:workDescription" />
<show id="packageItems" />
<show id="bpm:comment" />
<show id="wf:bankingOutcome" />
<show id="transitions" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="info" appearance=""
template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="work" appearance="title" label-id="workflow.set.work" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<set id="response" appearance="title" label-id="workflow.set.response" />


<field id="message" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>

<field id="bpm:priority" label-id="workflow.field.priority"
set="info" read-only="true">
<control
template="/org/alfresco/components/form/controls/workflow/priority.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="packageItems" set="items" />

<field id="wf:workDescription" set="work">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>

<field id="bpm:comment" label-id="workflow.field.comment"
set="response">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>

<field id="wf:bankingOutcome" set="response" />
<field id="transitions" set="response" />

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

<config evaluator="task-type" condition="wf:HRparallel">
<forms>
<form>
<field-visibility>
<show id="message" />
<show id="bpm:dueDate" />
<show id="bpm:priority" />
<show id="wf:workDescription" />
<show id="packageItems" />
<show id="bpm:comment" />
<show id="wf:hrOutcome" />
<show id="transitions" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="info" appearance=""
template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="work" appearance="title" label-id="workflow.set.work" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<set id="response" appearance="title" label-id="workflow.set.response" />


<field id="message" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>

<field id="bpm:priority" label-id="workflow.field.priority"
set="info" read-only="true">
<control
template="/org/alfresco/components/form/controls/workflow/priority.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="packageItems" set="items" />

<field id="wf:workDescription" set="work">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>

<field id="bpm:comment" label-id="workflow.field.comment"
set="response">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>

<field id="wf:hrOutcome" set="response" />
<field id="transitions" set="response" />

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

<config evaluator="task-type" condition="wf:Marketingparallel">
<forms>
<form>
<field-visibility>
<show id="message" />
<show id="bpm:dueDate" />
<show id="bpm:priority" />
<show id="wf:workDescription" />
<show id="packageItems" />
<show id="bpm:comment" />
<show id="wf:marketingOutcome" />
<show id="transitions" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="info" appearance=""
template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="work" appearance="title" label-id="workflow.set.work" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<set id="response" appearance="title" label-id="workflow.set.response" />


<field id="message" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>

<field id="bpm:priority" label-id="workflow.field.priority"
set="info" read-only="true">
<control
template="/org/alfresco/components/form/controls/workflow/priority.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="packageItems" set="items" />

<field id="wf:workDescription" set="work">
<control template="/org/alfresco/components/form/controls/info.ftl" />
</field>

<field id="bpm:comment" label-id="workflow.field.comment"
set="response">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>

<field id="wf:marketingOutcome" set="response" />
<field id="transitions" set="response" />

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

</config>


this file contains ShareUI for work flow, we need to add the UI components for our workflow this has to be there in Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco


bootstrap-context.xml

<!--add this props tag in <property name="workflowDefinitions">-->
              <props>
                    <prop key="engineId">activiti</prop>
                    <prop key="location">alfresco/workflow/testtimebasedflow.bpmn20.xml</prop>
                    <prop key="mimetype">text/xml</prop>
                    <prop key="redeploy">false</prop>
                </props>
<!--add this value tag in <property name="models">-->
<value>alfresco/workflow/workflowTesttimebasedflowmodel-custom.xml</value>

this file contains code to  our workflow in to server while starting the server
Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco

after making all changes restart alfresco to see new customized parallel workflow.

No comments:

Post a Comment