2016-06-24 148 views
1

我的使用案例對於Web內容使用單一批准者工作流程非常簡單。Liferay kaleo工作流程問題

  1. 用戶創建Web內容
  2. 它去審查
  3. 如果審閱批准它得到了顯示
  4. 如果審閱者拒絕,就應該查看爲拒絕和用戶應該能夠 再次重新提交審查

我有在點問題4.

當評論家拒絕,它摹oes被拒絕。但是,當創建嘗試重新編輯Web內容和「提交發布」時,它始終保持「草稿」模式。審閱者在他們的工作流任務中沒有得到任何任務。

我正在使用liferay 6.2 ce ga 3.以下是我的工作流定義。

<?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> 
      <![CDATA[{"xy":[36,51]}]]> 
     </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":[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); 
        ]]> 
       </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 /> 
     </assignments> 
     <transitions> 
      <transition> 
       <name>resubmit</name> 
       <target>review</target> 
       <default>true</default> 
      </transition> 
     </transitions> 
    </task> 
    <task> 
     <name>review</name> 
     <metadata> 
      <![CDATA[{"xy":[168,36]}]]> 
     </metadata> 
     <actions> 
      <notification> 
       <name>Review Notification</name> 
       <template>${userName} sent you a ${entryType} for review in the workflow.</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> 
      <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> 
      <![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> 
     </actions> 
    </state> 
</workflow-definition> 

我是否需要添加任何其他狀態或動作來達到第4點?

回答

0

沒有看着你的XML(我在我的手機上回答這個問題),這個描述聽起來就像自動安裝的單一審批者工作流程。您可以下載並檢查此工作流程的XML並將其與您當前的XML進行比較。

+0

它自帶開箱即用的Liferay,當評論家拒絕在衆目睽睽之下「待定」列表視圖中的狀態,並將掛起(更新)的網頁內容是不言而喻的一個。這對普通用戶來說有點混亂。我所追求的是,​​它顯示控制面板中的「拒絕」,並從那裏用戶可以更新內容,然後重新提交。儘管默認的單一審批者工作流程與「掛起(更新)」狀態相同。 – aston

+0

我不確定我完全關注你,但它聽起來像你想改變搜索容器的行爲而不是工作流行爲。您的狀態可能正在工作流程中設置,並且搜索容器可能被配置爲僅顯示特定狀態的條目。值得一試。找到您感興趣的搜索容器配置的JSP並搜索「WorkflowConstants」。不過,我只是在猜測。 –

0

我相信您會希望將狀態設置爲「已拒絕」,因爲您已經在更新任務中完成了這些操作,但是立即在同一個操作腳本中將狀態設置爲「掛起」。

Packages.com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil.updateStatus(Packages.com.liferay.portal.kernel.workflow.WorkflowConstants.toStatus("pending"), workflowContext);