Skip to content
Permalink
6.2.x
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
<?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>Ticket Process 2</name>
<version>1</version>
<condition>
<name>Passed QA</name>
<metadata><![CDATA[{"transitions":{"Yes":{"bendpoints":[]},"No":{"bendpoints":[],"xy":[-17,-2]}},"xy":[558,487]}]]></metadata>
<script><![CDATA[ import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
import com.liferay.portal.model.Role;
import com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil;
import com.liferay.portlet.dynamicdatalists.model.DDLRecord;
import com.liferay.portlet.dynamicdatamapping.storage.Field;
import com.liferay.portal.service.ServiceContext;
long companyId = GetterUtil.getLong((String) workflowContext.get(WorkflowConstants.CONTEXT_COMPANY_ID));
ServiceContext serviceContext = (ServiceContext) workflowContext.get(WorkflowConstants.CONTEXT_SERVICE_CONTEXT);
long ddlRecordId = GetterUtil.getLong(serviceContext.getAttribute("ddlRecordId"));
DDLRecord ddlRecord = DDLRecordLocalServiceUtil.getRecord(ddlRecordId);
Field field = ddlRecord.getField("status");
String status = GetterUtil.getString(field.getValue());
if (status.contains("closed")) {
returnValue = "Yes"
} else {
returnValue = "No"
}]]></script>
<script-language>groovy</script-language>
<transitions>
<transition>
<name>No</name>
<target>Developer</target>
<default>true</default>
</transition>
<transition>
<name>Yes</name>
<target>Project Manager Review</target>
<default>false</default>
</transition>
</transitions>
</condition>
<fork>
<name>Pass to QA</name>
<metadata><![CDATA[{"transitions":{"Audit":{"bendpoints":[],"xy":[-43,-8]},"Test":{"bendpoints":[],"xy":[18,-8]}},"xy":[600,37]}]]></metadata>
<transitions>
<transition>
<name>Audit</name>
<target>QA Management</target>
<default>true</default>
</transition>
<transition>
<name>Test</name>
<target>QA</target>
<default>false</default>
</transition>
</transitions>
</fork>
<join>
<name>Join</name>
<metadata><![CDATA[{"transitions":{"Pass QA":{"bendpoints":[]}},"xy":[558,340]}]]></metadata>
<transitions>
<transition>
<name>Pass QA</name>
<target>Passed QA</target>
<default>true</default>
</transition>
</transitions>
</join>
<state>
<name>StartNode</name>
<metadata><![CDATA[{"transitions":{"Assign":{"bendpoints":[],"xy":[-19,0]}},"xy":[50,50]}]]></metadata>
<initial>true</initial>
<transitions>
<transition>
<name>Assign</name>
<target>Developer</target>
<default>true</default>
</transition>
</transitions>
</state>
<state>
<name>EndNode</name>
<metadata><![CDATA[{"terminal":true,"xy":[870,500]}]]></metadata>
<actions>
<action>
<name>Approve</name>
<description>Approve</description>
<script> <![CDATA[Packages.com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil.updateStatus(Packages.com.liferay.portal.kernel.workflow.WorkflowConstants.toStatus("approved"), workflowContext);]]> </script>
<script-language>javascript</script-language>
<execution-type>onEntry</execution-type>
</action>
</actions>
</state>
<task>
<name>Developer</name>
<metadata><![CDATA[{"transitions":{"Submit":{"bendpoints":[],"xy":[-19,-20]}},"xy":[180,35]}]]></metadata>
<actions>
<action>
<name>Reject</name>
<script><![CDATA[Packages.com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil.updateStatus(Packages.com.liferay.portal.kernel.workflow.WorkflowConstants.toStatus("denied"), workflowContext);
Packages.com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil.updateStatus(Packages.com.liferay.portal.kernel.workflow.WorkflowConstants.toStatus("pending"), workflowContext);]]></script>
<script-language>javascript</script-language>
<execution-type>onAssignment</execution-type>
</action>
<notification>
<name>Reject</name>
<template>&lt;#assign refererPlid = serviceContext.getAttribute("refererPlid")!""&gt; &lt;#assign doAsGroupId = serviceContext.getAttribute("doAsGroupId")!""&gt; &lt;#assign comments = taskComments!""&gt; &lt;#assign comments = taskComments!""&gt; &lt;#assign portalURL = serviceContext.portalURL!""&gt; &lt;#assign pathCtx = portalUtil.pathContext!"NO_PATH_CTX"&gt; &lt;#assign wTasksURL = ""&gt; &lt;#if (portalURL?last_index_of("/") &gt; 6)&gt; &lt;#assign portalURL = portalURL?substring(0,portalURL?index_of("/", 7))&gt; &lt;/#if&gt; &lt;#if (portalURL?length &gt; 0) &amp;&amp; (refererPlid != "") &amp;&amp; (doAsGroupId != "")&gt; &lt;#if (pathCtx?length &gt; 0)&gt; &lt;#assign portalURL = portalURL+pathCtx&gt; &lt;/#if&gt; &lt;#assign wTasksURL = portalURL+"/group/control_panel/manage?p_p_id=153&amp;p_p_lifecycle=0&amp;p_p_state=maximized&amp;p_p_mode=view&amp;doAsGroupId="+doAsGroupId+"&amp;refererPlid="+refererPlid&gt; &lt;/#if&gt; &lt;!-- email body --&gt; &lt;p&gt; Your ${entryType} submission was rejected by a reviewer. &lt;#if comments != "" &gt; Rejection comment says: &lt;strong&gt;"${comments}"&lt;/strong&gt; &lt;/#if&gt; &lt;br /&gt;Please do necessary modifications to your ${entryType} and &lt;strong&gt;resubmit&lt;/strong&gt; your work. &lt;/p&gt; &lt;#if (wTasksURL?length &gt; 0)&gt; &lt;p&gt; &lt;a href="${wTasksURL}"&gt;Click here&lt;/a&gt; to see workflow tasks assigned to you. &lt;/p&gt; &lt;/#if&gt; &lt;!-- Signature --&gt; &lt;p&gt;Sincerely,&lt;br /&gt;&lt;strong&gt;Liferay Portal Workflow&lt;/strong&gt;&lt;/p&gt;</template>
<template-language>freemarker</template-language>
<notification-type>email</notification-type>
<execution-type>onEntry</execution-type>
</notification>
</actions>
<assignments>
<user/>
</assignments>
<transitions>
<transition>
<name>Submit</name>
<target>Code Review</target>
<default>true</default>
</transition>
</transitions>
</task>
<task>
<name>QA Management</name>
<metadata><![CDATA[{"transitions":{"ok":{"bendpoints":[],"xy":[-30,1]}},"xy":[690,180]}]]></metadata>
<assignments>
<user/>
</assignments>
<transitions>
<transition>
<name>ok</name>
<target>Join</target>
<default>true</default>
</transition>
</transitions>
</task>
<task>
<name>QA</name>
<metadata><![CDATA[{"transitions":{"ok":{"bendpoints":[],"xy":[7,1]}},"xy":[479,180]}]]></metadata>
<assignments>
<user/>
</assignments>
<transitions>
<transition>
<name>ok</name>
<target>Join</target>
<default>true</default>
</transition>
</transitions>
</task>
<task>
<name>Project Manager Review</name>
<metadata><![CDATA[{"transitions":{"Completed":{"bendpoints":[],"xy":[-19,10]}},"xy":[690,485]}]]></metadata>
<assignments>
<user/>
</assignments>
<transitions>
<transition>
<name>Completed</name>
<target>EndNode</target>
<default>true</default>
</transition>
</transitions>
</task>
<task>
<name>Code Review</name>
<metadata><![CDATA[{"transitions":{"Reject":{"bendpoints":[[331,125]],"xy":[-20,5]},"Pass":{"bendpoints":[],"xy":[-21,-19]},"Rollback":{"bendpoints":[[310,101]],"xy":[-20,5]}},"xy":[400,35]}]]></metadata>
<actions>
<notification>
<name>Review Notification</name>
<template>&lt;#assign refererPlid = serviceContext.getAttribute("refererPlid")!""&gt; &lt;#assign doAsGroupId = serviceContext.getAttribute("doAsGroupId")!""&gt; &lt;#assign comments = taskComments!""&gt; &lt;#assign portalURL = serviceContext.portalURL!""&gt; &lt;#assign pathCtx = portalUtil.pathContext!"NO_PATH_CTX"&gt; &lt;#assign wTasksURL = ""&gt; &lt;#if (portalURL?last_index_of("/") &gt; 6)&gt; &lt;#assign portalURL = portalURL?substring(0,portalURL?index_of("/", 7))&gt; &lt;/#if&gt; &lt;#if (portalURL?length &gt; 0) &amp;&amp; (refererPlid != "") &amp;&amp; (doAsGroupId != "")&gt; &lt;#if (pathCtx?length &gt; 0)&gt; &lt;#assign portalURL = portalURL+pathCtx&gt; &lt;/#if&gt; &lt;#assign wTasksURL = portalURL+"/group/control_panel/manage?p_p_id=153&amp;p_p_lifecycle=0&amp;p_p_state=maximized&amp;p_p_mode=view&amp;doAsGroupId="+doAsGroupId+"&amp;refererPlid="+refererPlid&gt; &lt;/#if&gt; &lt;!-- email body --&gt; &lt;#if (wTasksURL?length &gt; 0)&gt; &lt;!-- personal message to assignee --&gt; &lt;p&gt; Please review the code waiting for you in your workflow tasks. &lt;#if comments != "" &gt; &lt;br /&gt;Assignment comment says: &lt;strong&gt;${comments}&lt;/strong&gt; &lt;/#if&gt; &lt;/p&gt; &lt;p&gt; &lt;a href="${wTasksURL}"&gt;Click here&lt;/a&gt; to see workflow tasks assigned to you. &lt;/p&gt; &lt;#else&gt; &lt;!-- general message for all involved --&gt; &lt;p&gt; There is a new submission of ${entryType} waiting for review in the workflow. &lt;/p&gt; &lt;/#if&gt; &lt;!-- signature --&gt; &lt;p&gt;Sincerely,&lt;br /&gt;&lt;strong&gt;Liferay Portal Workflow&lt;/strong&gt;&lt;/p&gt;</template>
<template-language>freemarker</template-language>
<notification-type>email</notification-type>
<execution-type>onAssignment</execution-type>
</notification>
</actions>
<assignments>
<user/>
</assignments>
<transitions>
<transition>
<name>Pass</name>
<target>Pass to QA</target>
<default>true</default>
</transition>
<transition>
<name>Reject</name>
<target>Developer</target>
<default>false</default>
</transition>
</transitions>
</task>
</workflow-definition>