Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-144384

The DefinitionExporter doesn't return the complete Workflow definition

    Details

      Description

      Steps to reproduce:

      1. Get the kaleodefinitionid of the built-in Single Approver workflow from the database (kaleodefinition table) and accordingly place it in the Groovy script below, then run the script.

       

      import com.liferay.osgi.util.ServiceTrackerFactory;
      import com.liferay.portal.scripting.groovy.internal.GroovyExecutor;
      import com.liferay.portal.workflow.kaleo.definition.export.DefinitionExporter;
      import org.osgi.framework.FrameworkUtil;
      import org.osgi.framework.Bundle;
      import org.osgi.util.tracker.ServiceTracker;
      long kaleoDefinitionId = 0; // *** Change this to the ID of the definition that you want to export
      Bundle bundle = FrameworkUtil.getBundle(GroovyExecutor.class);
      ServiceTracker serviceTracker = ServiceTrackerFactory.open(bundle,DefinitionExporter.class);
      System.out.println(serviceTracker.getService().export(kaleoDefinitionId));
      serviceTracker.close();
      

       

      Result: you get

      <?xml version="1.0"?>
       <workflow-definition xmlns="urn:liferay.com:liferay-workflow_7.2.10" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:liferay.com:liferay-workflow_7.2.10 http://www.liferay.com/dtd/liferay-workflow-definition_7_2_10.xsd">
       <name>Single Approver</name>
       <description>A single approver can approve a workflow content.</description>
       <version>1</version>
       </workflow-definition>

      You'll see that it's missing all the node information that you'd expect to be in the definition. (and which you can see if you look at the source view of the workflow from the UI)

        Attachments

          Activity

            People

            Assignee:
            feliphe.marinho Feliphe Marinho
            Reporter:
            istvan.dezsi Istvan Dezsi
            Participants of an Issue:
            Recent user:
            Clarissa Velazquez
            Engineering Assignee:
            Istvan Dezsi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              22 weeks ago

                Packages

                Version Package
                7.2.10 DXP FP17
                7.2.10.6 DXP SP6
                7.2.X