Working with (Three Level) Kaleo Workflow Liferay6.2 :
I have to implement based on roles type of three level workflow.
1) Create three users
Users and Organisation -> Select add users
User 1 : workflow1@liferay.com
User 2 : Workflow2@liferay.com
User 3 : Workflow3@liferay.com
2) Create two Regulars Roles
Role 1 : approver1
Role 2 : approver2
Role 2 : approver3
3) Assign the roles to users
User 1 have assign the role appover1
User 2 have assign the role approver2
User 3 have assign the role approver3
4) Below code add to one XML file(ThreeLevel-Defination.xml)
<?xml version="1.0"?>
<workflow-definition
xmlns="urn:liferay.com:liferay-workflow_6.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:liferay.com:liferay-workflow_6.2.0 http://www.liferay.com/dtd/liferay-workflow-definition_6_2_0.xsd"
>
<name>Three Level Approval</name>
<description>Workflow assets must be approved first Level.</description>
<version>1</version>
<state>
<name>created</name>
<metadata><![CDATA[{"transitions":{"Market Review":{"bendpoints":[]},"marketing-review":{"bendpoints":[],"xy":[-60,2]}},"xy":[60,50]}]]></metadata>
<initial>true</initial>
<transitions>
<transition>
<name>Market Review</name>
<target>marketing-review</target>
<default>true</default>
</transition>
<transition>
<name>marketing-review</name>
<target>marketing-review</target>
</transition>
<transition>
<name>marketing-review</name>
<target>marketing-review</target>
</transition>
</transitions>
</state>
<task>
<name>update</name>
<metadata><![CDATA[{"transitions":{"resubmit":{"bendpoints":[[431,224]]},"Resubmit":{"bendpoints":[[80,1910]],"xy":[140,-530]}},"xy":[510,350]}]]></metadata>
<actions>
<notification>
<name>Creator Modification Notification</name>
<template>Your asset was rejected by a reviewer, please modify and resubmit.</template>
<template-language>velocity</template-language>
<notification-type>email</notification-type>
<execution-type>onAssignment</execution-type>
</notification>
</actions>
<assignments>
<user />
</assignments>
<transitions>
<transition>
<name>resubmit</name>
<target>marketing-review</target>
</transition>
</transitions>
</task>
<task>
<name>marketing-review</name>
<metadata><![CDATA[{"transitions":{"Marketing Approved":{"bendpoints":[]},"Marketing Denied":{"bendpoints":[]}},"xy":[230,50]}]]></metadata>
<actions>
<notification>
<name>Market Content Review Notification</name>
<template>You have a new asset waiting for your review in the workflow.</template>
<template-language>text</template-language>
<notification-type>email</notification-type>
<execution-type>onAssignment</execution-type>
</notification>
</actions>
<assignments>
<roles>
<role>
<role-type>regular</role-type>
<name>approver1</name>
</role>
</roles>
</assignments>
<transitions>
<transition>
<name>Marketing Approved</name>
<target>legal-review</target>
<default>true</default>
</transition>
<transition>
<name>Marketing Denied</name>
<target>update</target>
<default>false</default>
</transition>
</transitions>
</task>
<task>
<name>legal-review</name>
<metadata><![CDATA[{"transitions":{"Legal Denied":{"bendpoints":[]},"Legal Approved":{"bendpoints":[]},"Legal Approval":{"bendpoints":[]}},"xy":[650,60]}]]></metadata>
<actions>
<notification>
<name>Legal Content Review Notification</name>
<template>You have a new asset waiting for your review in the workflow.</template>
<template-language>text</template-language>
<notification-type>email</notification-type>
<execution-type>onAssignment</execution-type>
</notification>
</actions>
<assignments>
<roles>
<role>
<role-type>regular</role-type>
<name>approver2</name>
</role>
</roles>
</assignments>
<transitions>
<transition>
<name>Legal Denied</name>
<target>update</target>
<default>false</default>
</transition>
<transition>
<name>Legal Approved</name>
<target>thirdlevel</target>
</transition>
<transition>
<name>Legal Approved</name>
<target>third-level</target>
</transition>
</transitions>
</task>
<state>
<name>approved</name>
<metadata><![CDATA[{"xy":[1190,130]}]]></metadata>
<actions>
<action>
<name>approve</name>
<script>
<![CDATA[
import com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.toStatus("approved"), workflowContext);
]]>
</script>
<script-language>groovy</script-language>
<execution-type>onEntry</execution-type>
</action>
</actions>
</state>
<task>
<name>third-level</name>
<metadata><![CDATA[{"transitions":{"third Denied":{"bendpoints":[]},"approved":{"bendpoints":[]},"Legal Approved":{"bendpoints":[]},"Third Denied":{"bendpoints":[]}},"xy":[900,70]}]]></metadata>
<actions>
<notification>
<name>Thirdl Content Review Notification</name>
<template>/* specify task notification template */</template>
<template-language>text</template-language>
<notification-type>email</notification-type>
<execution-type>onAssignment</execution-type>
</notification>
</actions>
<assignments>
<roles>
<role>
<role-type>regular</role-type>
<name>approver3</name>
<auto-create>true</auto-create>
</role>
</roles>
</assignments>
<transitions>
<transition>
<name>approved</name>
<target>approved</target>
</transition>
<transition>
<name>Third Denied</name>
<target>update</target>
</transition>
</transitions>
</task>
</workflow-definition>
5) Add the two level workflow into Workflow section
Select Workflow - > Defination -> Add defination
6) Add the worflow to outofbox assets(Webcontent,Wiki,Messageboards,Blogs etc.)
7) Test it
I have to implement based on roles type of three level workflow.
1) Create three users
Users and Organisation -> Select add users
User 1 : workflow1@liferay.com
User 2 : Workflow2@liferay.com
User 3 : Workflow3@liferay.com
2) Create two Regulars Roles
Role 1 : approver1
Role 2 : approver2
Role 2 : approver3
3) Assign the roles to users
User 1 have assign the role appover1
User 2 have assign the role approver2
User 3 have assign the role approver3
4) Below code add to one XML file(ThreeLevel-Defination.xml)
<?xml version="1.0"?>
<workflow-definition
xmlns="urn:liferay.com:liferay-workflow_6.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:liferay.com:liferay-workflow_6.2.0 http://www.liferay.com/dtd/liferay-workflow-definition_6_2_0.xsd"
>
<name>Three Level Approval</name>
<description>Workflow assets must be approved first Level.</description>
<version>1</version>
<state>
<name>created</name>
<metadata><![CDATA[{"transitions":{"Market Review":{"bendpoints":[]},"marketing-review":{"bendpoints":[],"xy":[-60,2]}},"xy":[60,50]}]]></metadata>
<initial>true</initial>
<transitions>
<transition>
<name>Market Review</name>
<target>marketing-review</target>
<default>true</default>
</transition>
<transition>
<name>marketing-review</name>
<target>marketing-review</target>
</transition>
<transition>
<name>marketing-review</name>
<target>marketing-review</target>
</transition>
</transitions>
</state>
<task>
<name>update</name>
<metadata><![CDATA[{"transitions":{"resubmit":{"bendpoints":[[431,224]]},"Resubmit":{"bendpoints":[[80,1910]],"xy":[140,-530]}},"xy":[510,350]}]]></metadata>
<actions>
<notification>
<name>Creator Modification Notification</name>
<template>Your asset was rejected by a reviewer, please modify and resubmit.</template>
<template-language>velocity</template-language>
<notification-type>email</notification-type>
<execution-type>onAssignment</execution-type>
</notification>
</actions>
<assignments>
<user />
</assignments>
<transitions>
<transition>
<name>resubmit</name>
<target>marketing-review</target>
</transition>
</transitions>
</task>
<task>
<name>marketing-review</name>
<metadata><![CDATA[{"transitions":{"Marketing Approved":{"bendpoints":[]},"Marketing Denied":{"bendpoints":[]}},"xy":[230,50]}]]></metadata>
<actions>
<notification>
<name>Market Content Review Notification</name>
<template>You have a new asset waiting for your review in the workflow.</template>
<template-language>text</template-language>
<notification-type>email</notification-type>
<execution-type>onAssignment</execution-type>
</notification>
</actions>
<assignments>
<roles>
<role>
<role-type>regular</role-type>
<name>approver1</name>
</role>
</roles>
</assignments>
<transitions>
<transition>
<name>Marketing Approved</name>
<target>legal-review</target>
<default>true</default>
</transition>
<transition>
<name>Marketing Denied</name>
<target>update</target>
<default>false</default>
</transition>
</transitions>
</task>
<task>
<name>legal-review</name>
<metadata><![CDATA[{"transitions":{"Legal Denied":{"bendpoints":[]},"Legal Approved":{"bendpoints":[]},"Legal Approval":{"bendpoints":[]}},"xy":[650,60]}]]></metadata>
<actions>
<notification>
<name>Legal Content Review Notification</name>
<template>You have a new asset waiting for your review in the workflow.</template>
<template-language>text</template-language>
<notification-type>email</notification-type>
<execution-type>onAssignment</execution-type>
</notification>
</actions>
<assignments>
<roles>
<role>
<role-type>regular</role-type>
<name>approver2</name>
</role>
</roles>
</assignments>
<transitions>
<transition>
<name>Legal Denied</name>
<target>update</target>
<default>false</default>
</transition>
<transition>
<name>Legal Approved</name>
<target>thirdlevel</target>
</transition>
<transition>
<name>Legal Approved</name>
<target>third-level</target>
</transition>
</transitions>
</task>
<state>
<name>approved</name>
<metadata><![CDATA[{"xy":[1190,130]}]]></metadata>
<actions>
<action>
<name>approve</name>
<script>
<![CDATA[
import com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.toStatus("approved"), workflowContext);
]]>
</script>
<script-language>groovy</script-language>
<execution-type>onEntry</execution-type>
</action>
</actions>
</state>
<task>
<name>third-level</name>
<metadata><![CDATA[{"transitions":{"third Denied":{"bendpoints":[]},"approved":{"bendpoints":[]},"Legal Approved":{"bendpoints":[]},"Third Denied":{"bendpoints":[]}},"xy":[900,70]}]]></metadata>
<actions>
<notification>
<name>Thirdl Content Review Notification</name>
<template>/* specify task notification template */</template>
<template-language>text</template-language>
<notification-type>email</notification-type>
<execution-type>onAssignment</execution-type>
</notification>
</actions>
<assignments>
<roles>
<role>
<role-type>regular</role-type>
<name>approver3</name>
<auto-create>true</auto-create>
</role>
</roles>
</assignments>
<transitions>
<transition>
<name>approved</name>
<target>approved</target>
</transition>
<transition>
<name>Third Denied</name>
<target>update</target>
</transition>
</transitions>
</task>
</workflow-definition>
5) Add the two level workflow into Workflow section
Select Workflow - > Defination -> Add defination
6) Add the worflow to outofbox assets(Webcontent,Wiki,Messageboards,Blogs etc.)
7) Test it
No comments:
Post a Comment