-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.2.X
-
Fix Version/s: 7.2.10 DXP FP17, 7.2.10.6 DXP SP6, 7.2.X
-
Component/s: Workflow
-
Branch Version/s:7.2.x
-
Backported to Branch:Committed
-
Fix Priority:3
-
Git Pull Request:
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)