Foros de discusión

Kaleo Approved Notification

seynabou ndiaye, modificado hace 11 años.

Kaleo Approved Notification

New Member Mensajes: 2 Fecha de incorporación: 10/10/12 Mensajes recientes
Hello.

How can I setup the single-approver-definition.xml in a way to notify the user when the content get approved?


<!--?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>Single Approver</name>
	<description>A single approver can approve a workflow content.</description>
	<version>1</version>
	<state>
		<name>created</name>
		<metadata>
			{"xy":[36,51]}
		</metadata>
		<initial>true</initial>
		<transitions>
			<transition>
				<name>review</name>
				<target>review</target>
			</transition>
		</transitions>
	</state>
	<task>
		<name>update</name>
		<metadata>
			{"transitions":{"resubmit":{"bendpoints":[[303,140]]}},"xy":[328,199]}
		</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>Creator Modification Notification</name>
				<template>Your submission was rejected by a reviewer, please modify and resubmit.</template>
				<template-language>text</template-language>
				<notification-type>email</notification-type>
				<execution-type>onAssignment</execution-type>
			</notification>
		</actions>
		<assignments>
			<user />
		</assignments>
		<transitions>
			<transition>
				<name>resubmit</name>
				<target>review</target>
			</transition>
		</transitions>
	</task>
	<task>
		<name>review</name>
		<metadata>
			{"xy":[168,36]}
		</metadata>
		<actions>
			<notification>
				<name>Review Notification</name>
				<template>You have a new submission waiting for your review in the workflow.</template>
				<template-language>text</template-language>
				<notification-type>email</notification-type>
				<execution-type>onAssignment</execution-type>
			</notification>
			<notification>
				<name>Review Completion Notification</name>
				<template>
					Your submission has been reviewed and the reviewer has applied the following ${taskComments}.</template>
				<template-language>freemarker</template-language>
				<notification-type>email</notification-type>
				<recipients>
					<user />
				</recipients>
				<execution-type>onExit</execution-type>
			</notification>
		</actions>
		<assignments>
			<roles>
				<role>
					<role-type>organization</role-type>
					<name>Organization Administrator</name>
				</role>
				<role>
					<role-type>organization</role-type>
					<name>Organization Content Reviewer</name>
				</role>
				<role>
					<role-type>organization</role-type>
					<name>Organization Owner</name>
				</role>
				<role>
					<role-type>regular</role-type>
					<name>Administrator</name>
				</role>
				<role>
					<role-type>regular</role-type>
					<name>Portal Content Reviewer</name>
				</role>
				<role>
					<role-type>site</role-type>
					<name>Site Administrator</name>
				</role>
				<role>
					<role-type>site</role-type>
					<name>Site Content Reviewer</name>
				</role>
				<role>
					<role-type>site</role-type>
					<name>Site Owner</name>
				</role>
			</roles>
		</assignments>
		<transitions>
			<transition>
				<name>approve</name>
				<target>approved</target>
			</transition>
			<transition>
				<name>reject</name>
				<target>update</target>
				<default>false</default>
			</transition>
		</transitions>
	</task>
	<state>
		<name>approved</name>
		<metadata>
			
				{"xy":[380,51]}
			
		</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>
</workflow-definition>


Thank you,
seynabou ndiaye, modificado hace 11 años.

RE: Kaleo Approved Notification

New Member Mensajes: 2 Fecha de incorporación: 10/10/12 Mensajes recientes
Ok, I just got it. I'm going to put comments here for anyone with the same doubt - I google it a lot and I was not able to find easily a proper answer...
Taking the simple example, you need to add
<notification></notification>
under the
<actions></actions>
tag of the
<state></state>
and it will work fine.

Thank you all.