google.com, pub-5747754088801811, DIRECT, f08c47fec0942fa0 Skip to main content

Liferay 6.2 multileval workflow kaleo

This example shows how to apply multilevel workflow in liferay.

  • Please copy paste below content in legal-marketing-definition.xml file.

  • Then upload it in configuration -> workflow -> defination -> upload defination

  • Create two user approver1 and approver2. 

  • Apply workflow from  configuration -> workflow -> defination -> default configuration.


<?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>Legal and Marketing Approval</name>
    <description>Workflow assets must be approved first by Marketing and then by Legal.</description>
    <version>1</version>
    <state>
        <name>created</name>
        <metadata>
            <![CDATA[{"transitions":{"Market Review":{"xy":[-46,-12]}},"xy":[62,51]}]]>
        </metadata>
        <initial>true</initial>
        <transitions>
            <transition>
                <name>Market Review</name>
                <target>marketing-review</target>
                <default>true</default>
            </transition>
        </transitions>
    </state>
    <task>
        <name>update</name>
        <metadata>
            <![CDATA[{"transitions":{"Resubmit":{"bendpoints":[[427,40]],"xy":[-27,11]}},"xy":[530,36]}]]>
        </metadata>
        <actions>
            <notification>
                <name>Creator Modification Notification</name>
                <template>Your asset was rejected by a reviewer, please modify and resubmit.</template>
                <template-language>text</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>marketing-review</target>
                <default>true</default>
            </transition>
        </transitions>
    </task>
    <task>
        <name>marketing-review</name>
        <metadata>
            <![CDATA[{"transitions":{"Marketing Approved":{"xy":[-1,-29]},"Marketing Denied":{"xy":[-34,-1]}},"xy":[260,36]}]]>
        </metadata>
        <actions>
            <notification>
                <name>Market Content Review Notification</name>
                <template>You have a new asset waiting for your review in the workflow.</template>
                <template-language>text</template-language>
                <notification-type>email</notification-type>
                <notification-type>user-notification</notification-type>
                <execution-type>onAssignment</execution-type>
            </notification>
        </actions>
        <assignments>
            <roles>
                <role>
                    <role-type>regular</role-type>
                    <name>approver1</name>
                </role>
            </roles>
        </assignments>
        <transitions>
            <transition>
                <name>Marketing Approved</name>
                <target>legal-review</target>
                <default>true</default>
            </transition>
            <transition>
                <name>Marketing Denied</name>
                <target>update</target>
                <default>false</default>
            </transition>
        </transitions>
    </task>
    <task>
        <name>legal-review</name>
        <metadata>
            <![CDATA[{"xy":[260,270]}]]>
        </metadata>
        <actions>
            <notification>
                <name>Legal Content Review Notification</name>
                <template>You have a new asset waiting for your review in the workflow.</template>
                <template-language>text</template-language>
                <notification-type>email</notification-type>
                <notification-type>user-notification</notification-type>
                <execution-type>onAssignment</execution-type>
            </notification>
        </actions>
        <assignments>
            <roles>
                <role>
                    <role-type>regular</role-type>
                    <name>approver2</name>
                </role>
            </roles>
        </assignments>
        <transitions>
            <transition>
                <name>Legal Approval</name>
                <target>approved</target>
                <default>true</default>
            </transition>
            <transition>
                <name>Legal Denied</name>
                <target>update</target>
                <default>false</default>
            </transition>
        </transitions>
    </task>
    <state>
        <name>approved</name>
        <metadata>
            <![CDATA[
                {"xy":[540,285]}
            ]]>
        </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>

Comments

Post a Comment

Popular posts from this blog

Disable cache content of browser access on back button after logout liferay dxp

Some time we have requirement where we do not want to allow back button after logout and show cached browser content. Liferay provide properties which with we are able to restrict to see content on back button after logout. If user click back button after logout it will show the login page. We require to provide below properties in portal-ext.properties. Restart the server once applying below properties browser.cache.signed.in.disabled=true

Liferay crud porrtlet with Jasper Reports.

I have used Meera Prince Crud operation demo for the Jasper reports which allow to export report in PDF , word, XLS format. It will look lie below image. Find Source code for the complete example on below location. LIFERAY JASPER REPORT INTEGRATION 1 I have available PhoneManger Crud Portlet which have pagination and crud functionality. 2 I create report-listing-mobile.jrxml  file with help of Ireport tool. <?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report-listing" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin=&q