简体   繁体   English

Liferay kaleo工作流程无效

[英]Liferay kaleo Workflow isn't working

I am using Liferay 6.1.1 CE. 我正在使用Liferay 6.1.1 CE。 I've created a multilevel kaleo workflow, by writing a definition in a xml file and loading it to the server. 我已经创建了一个多级kaleo工作流,通过在xml文件中编写定义并将其加载到服务器。 It works fine. 它工作正常。

My problem is in the role assigning. 我的问题在于角色分配。 I have created 2 roles, project manager and hos, also assigned this roles to two users. 我创建了2个角色,项目经理和hos,还将这个角色分配给了两个用户。

But the workflow is not working. 但工作流程无效。 When i give portal content reviewer role to this users, it works. 当我向这些用户提供门户内容审阅者角色时,它可以正常工作。 My first task is review and second is recommended. 我的第一个任务是审查,第二个是推荐。

help me..thanks in advance.this is my code 帮助我..提前谢谢。这是我的代码

<?xml version="1.0"?>
<workflow-definition
xmlns="urn:liferay.com:liferay-workflow_6.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:liferay.com:liferay-workflow_6.1.0
http://www.liferay.com/dtd/liferay-workflow-definition_6_1_0.xsd">
<name>leave workflow</name>
<description>A sample multilevel approver can approve a workflow
content.</description>
<version>1</version>
<state>
<name>created</name>
<metadata>
        <![CDATA[{"xy":[36,51]}]]>
    </metadata>
<initial>true</initial>
<transitions>
    <transition>
    <name>review</name>
    <target>review</target>
    <default>true</default>
    </transition>
</transitions>
</state>
  <task>
    <name>review</name>
    <metadata>
        <![CDATA[{"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>regular</role-type>
                <name>Project Manager</name>
            </role>


        </roles>
    </assignments>
    <transitions>
        <transition>
            <name>approve</name>
            <target>recommended</target>
        </transition>
        <transition>
            <name>reject</name>
            <target>update</target>
            <default>false</default>
        </transition>
    </transitions>
 </task>


 <task>
    <name>recommended</name>
    <metadata>
        <![CDATA[{"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>regular</role-type>
                <name>Hos</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>


    <task>
    <name>update</name>
    <metadata>
        <![CDATA[{"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>
<state>
    <name>approved</name>
    <metadata>
        <![CDATA[
            {"xy":[380,51]}
        ]]>
    </metadata>
    <actions>
        <action>
            <name>approve</name>
            <script>
                <![CDATA[
                    Packages.com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil.updateStatus

  (Packages.com.liferay.portal.kernel.workflow.WorkflowConstants.toStatus("approved"), workflowContext);
                ]]>
            </script>
            <script-language>javascript</script-language>
            <execution-type>onEntry</execution-type>
        </action>
    </actions>
</state>
 </workflow-definition>

Add all the users in same group. 添加同一组中的所有用户。 Nothing wrong with your workflow. 您的工作流程没有任何问题。

Also check permissions 还要检查权限

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM