<?xml version="1.0"?>
<workflow-definition xmlns="urn:liferay.com:liferay-workflow_7.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:liferay.com:liferay-workflow_7.0.0 http://www.liferay.com/dtd/liferay-workflow-definition_7_0_0.xsd">
	<name>Timer Example</name>
	<description>
			</description>
		<version>1</version>
		<state>
			<name>Start</name>
			<metadata>
				<![CDATA[{"xy":[100,40]}]]>
</metadata>
<initial>true</initial>
<transitions>
<transition>
<name>Review</name>
<target>Review</target>
<default>true</default>
</transition>
</transitions>
</state>
<state>
<name>Approved</name>
<metadata>
<![CDATA[{"xy":[497,35]}]]>
</metadata>
<actions>
<action>
<name>Approved</name>
<description>
</description>
<script>
<![CDATA[import com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil;
						import com.liferay.portal.kernel.workflow.WorkflowConstants;

						WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.getLabelStatus("approved"), workflowContext);]]>
			</script>
			<script-language>groovy</script-language>
			<execution-type>onEntry</execution-type>
		</action>
		<notification>
			<name>Approved Event</name>
			<description>
																				</description>
				<template>
					<![CDATA[Your submission was reviewed<#if taskComments?has_content> and the reviewer applied the following ${taskComments}</#if>.]]>
</template>
<template-language>freemarker</template-language>
<notification-type>user-notification</notification-type>
<recipients>
<user>
<user-id>20156</user-id>
</user>
</recipients>
<execution-type>onExit</execution-type>
</notification>
</actions>
</state>
<task>
<name>Review</name>
<metadata>
<![CDATA[{"xy":[286,20]}]]>
</metadata>
<actions>
<notification>
<name>Review  Event</name>
<description>
</description>
<template>
<![CDATA[${userName} sent you a ${entryType} for review in the workflow.]]>
</template>
<template-language>freemarker</template-language>
<notification-type>user-notification</notification-type>
<recipients>
<roles>
<role>
<role-type>site</role-type>
<name>Site Administrator</name>
<auto-create>false</auto-create>
</role>
</roles>
</recipients>
<execution-type>onAssignment</execution-type>
</notification>
</actions>
<assignments>
<user/>
</assignments>
<transitions>
<transition>
<name>Approve</name>
<target>Approved</target>
<default>true</default>
</transition>
<transition>
<name>Reject</name>
<target>Update</target>
<default>true</default>
</transition>
</transitions>
<task-timers>
<task-timer>
<name>30 Second</name>
<description>
</description>
<delay>
<duration>30</duration>
<scale>second</scale>
</delay>
<blocking>false</blocking>
<timer-actions>
<timer-action>
<name>Approve Cotent After 30 sec</name>
<description>
</description>
<script>
<![CDATA[import com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil;
						import com.liferay.portal.kernel.workflow.WorkflowConstants;

						WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.getLabelStatus("approved"), workflowContext);]]>
				</script>
				<script-language>groovy</script-language>
				<execution-type>onEntry</execution-type>
			</timer-action>
		</timer-actions>
	</task-timer>
</task-timers>
</task>
<task>
	<name>Update</name>
	<metadata>
		<![CDATA[{"xy":[542,284]}]]>
</metadata>
<actions>
<action>
<name>Reject</name>
<description>
</description>
<script>
<![CDATA[import com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil;
						import com.liferay.portal.kernel.workflow.WorkflowConstants;

						WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.getLabelStatus("denied"), workflowContext);
						WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.getLabelStatus("pending"), workflowContext);]]>
	</script>
	<script-language>groovy</script-language>
	<execution-type>onAssignment</execution-type>
</action>
<notification>
	<name>Rejected Event</name>
	<description>
														</description>
		<template>
			<![CDATA[${userName} sent you a ${entryType} for review in the workflow.]]>
</template>
<template-language>freemarker</template-language>
<notification-type>user-notification</notification-type>
<recipients>
<user/>
</recipients>
<execution-type>onAssignment</execution-type>
</notification>
<notification>
<name>Submit Again</name>
<description>
</description>
<template>
<![CDATA[Your submission was reviewed<#if taskComments?has_content> and the reviewer applied the following ${taskComments}</#if>.]]>
</template>
<template-language>freemarker</template-language>
<notification-type>user-notification</notification-type>
<recipients>
<roles>
<role>
<role-type>site</role-type>
<name>Site Administrator</name>
<auto-create>false</auto-create>
</role>
</roles>
</recipients>
<execution-type>onExit</execution-type>
</notification>
</actions>
<assignments>
<user>
<user-id>33503</user-id>
</user>
</assignments>
<transitions>
<transition>
<name>Submit</name>
<target>Review</target>
<default>true</default>
</transition>
</transitions>
</task>
</workflow-definition>
