我正在为Reviewer,Administrator做自定义通知,任何人都可以帮我弄清楚我的kaleo工作流程中出了什么问题?
这是要求
流速:
问题是1到3正在运行,但是在审核人批准了申请后的4中,管理员确实没有收到通知
这是我的代码
<?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>
注意上面给出的代码适用于kaleo工作流程。
答案 0 :(得分:2)
我设法将单个审批者工作流配置为与您的方案完全一致,该方案在批准文档时使用用户通知。我应用于默认工作流程定义的一项更改是将部分通知添加到已批准的状态。以下是代码的一部分:
<state>
<name>approved</name>
<metadata>
<![CDATA[{"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>
<notification>
<name>Creator Approval Notification</name>
<template>Your submission was accepted by ${userName}.</template>
<template-language>freemarker</template-language>
<notification-type>user-notification</notification-type>
<recipients>
<user/>
</recipients>
<execution-type>onExit</execution-type>
</notification>
</actions>
</state>
在已批准节点中添加类似的通知部分。另一方面,我不确定你是否确实需要在批准状态之前批准另一个节点。
答案 1 :(得分:0)
我会试着改变执行类型:
<execution-type>onAssignment</execution-type>
到
<execution-type>onEntry</execution-type>
在任务的最后部分已批准
以下文件:
发送通知 通知需要一个执行类型,可以是onAssignment, onEntry或onExit。
onAssignment在工作流中为用户分配任务时生成并发送通知。注意:onAssignment notification
如果您希望通知不属于该用户的用户,则无效 工作流程。onEntry在进入工作流程任务或状态时生成并发送通知。
onExit在退出工作流任务或状态时生成并发送通知。