Liferay:自定义Kaleo通知

光之坤

我正在为审阅者,管理员进行自定义通知,任何人都可以帮助我弄清我的kaleo工作流程有什么问题吗?

这是要求

  • 为了安全起见管理员可以为用户创建一个新帐户
  • 审阅(如作为管理员,但只有特权是审核,批准和拒绝从管理员和用户的要求)都创建管理新帐户必须审查,如果通过批准或者不批准审阅之前从管理员创建新帐户

流动:

  1. 管理员然后为新用户创建一个帐户
  2. 通知审阅者审阅管理员的请求,然后
  3. A.如果审阅者拒绝了申请请求,请通知管理员重新提交更新。
  4. B.如果审阅者批准了申请请求,则通知管理员知道该请求已获批准。
  5. 完毕

问题是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>[email protected]</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>[email protected]</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>[email protected]</email-address>
        </user>
    </assignments>
    <transitions>
        <transition>
            <name>Ok</name>
            <target>approved</target>
        </transition>
    </transitions>
</task>

请注意,我上面给出的代码是针对kaleo工作流程的。

托米奇

我设法配置了单个批准者工作流程,以与您的方案完全配合,当文档被批准时,该方案使用用户通知。我对默认工作流程定义应用的一项更改是将部分通知添加到批准状态。这是代码的一部分:

    <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>

将通知的类似部分添加到批准的节点。另一方面,我不确定您是否真的需要在批准状态之前批准另一个节点。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章