I am doing a custom notification for Reviewer, Administrator, any one can help me to figure it out what's wrong in my kaleo workflow?
Here's the requirements
- The Administrator can create a new account for the user for security purposes.
- The Reviewer (like as admin but only priviledge is to review, approve, and reject request from admin and users) all create new account from admin must be review if approve or not by the Reviewer before created new account from the admin
Flow:
- Admin create an account for new user then
- Notify the Reviewer to review the request from the admin then
- A. if the Reviewer reject the application request, notify the admin to resubmit for update.
- B. if the Reviewer approve the application request, notify the admin to know that request is approved.
- Done
Problem is 1 to 3 is working but in 4 after reviewer approved the application, admin did'nt receive notification
here is my code
<?xml version="1.0" encoding="UTF-8"?><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>custom-mrcos-notify</name>
<version>1</version>
<state>
<name>created</name>
<metadata>
<![CDATA[{"transitions":{"review":{"bendpoints":[]}},"xy":[30,30]}]]>
</metadata>
<initial>true</initial>
<transitions>
<transition>
<name>review</name>
<target>review</target>
</transition>
</transitions>
</state>
<task>
<name>update</name>
<metadata>
<![CDATA[{"transitions":{"resubmit":{"bendpoints":[[303,140]]}},"xy":[260,220]}]]>
</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 ${userName}, please modify and resubmit.</template>
<template-language>freemarker</template-language>
<notification-type>email</notification-type>
<notification-type>user-notification</notification-type>
<execution-type>onAssignment</execution-type>
</notification>
</actions>
<assignments>
<user>
<email-address>r@liferay.com</email-address>
</user>
</assignments>
<transitions>
<transition>
<name>resubmit</name>
<target>review</target>
</transition>
</transitions>
</task>
<task>
<name>review</name>
<metadata>
<![CDATA[{"transitions":{"approve":{"bendpoints":[[354,82]]},"reject":{"bendpoints":[]}},"xy":[160,30]}]]>
</metadata>
<actions>
<notification>
<name>Review Notification</name>
<template>${userName} sent you a ${entryType} for review.</template>
<template-language>freemarker</template-language>
<notification-type>email</notification-type>
<notification-type>user-notification</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>
<user>
<email-address>r@liferay.com</email-address>
</user>
</assignments>
<transitions>
<transition>
<name>reject</name>
<target>update</target>
<default>false</default>
</transition>
<transition>
<name>approve</name>
<target>Approved</target>
</transition>
</transitions>
</task>
<state>
<name>approved</name>
<metadata>
<![CDATA[{"xy":[740,100]}]]>
</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>Approved</name>
<metadata>
<![CDATA[{"transitions":{"Ok":{"bendpoints":[]},"ok":{"bendpoints":[]}},"xy":[470,30]}]]>
</metadata>
<actions>
<notification>
<name>notify-approved</name>
<template>The application of ${entryType} is approved by ${userName}.</template>
<template-language>freemarker</template-language>
<notification-type>email</notification-type>
<execution-type>onAssignment</execution-type>
</notification>
<action>
<name>approved</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>
<assignments>
<user>
<email-address>test@liferay.com</email-address>
</user>
</assignments>
<transitions>
<transition>
<name>Ok</name>
<target>approved</target>
</transition>
</transitions>
</task>
Note my code given above is for kaleo workflow.