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

workflow can't parse successful when using <task-timers>

    Details

      Description

      Steps to reproduce:
      1. Using DXP to generate the xml. Please refer to reproduce_step.gif. We may use default single-approver-definition xml to generate it in UI. In this gif, add task-timer for this Review task.

      <?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-test</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>
      				<default>true</default>
      			</transition>
      		</transitions>
      	</state>
      	<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.getLabelStatus("approved"), workflowContext);]]>
      				</script>
      				<script-language>groovy</script-language>
      				<execution-type>onEntry</execution-type>
      			</action>
      		</actions>
      	</state>
      	<task>
      		<name>update</name>
      		<metadata>
      			<![CDATA[{"transitions":{"resubmit":{"bendpoints":[[303,140]]}},"xy":[328,199]}]]>
      		</metadata>
      		<actions>
      			<action>
      				<name>reject</name>
      				<script>
      					<![CDATA[import com.liferay.portal.kernel.workflow.WorkflowStatusManagerUtil;
      						import com.liferay.portal.kernel.workflow.WorkflowConstants;
      
      						WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.getLabelStatus("denied"), workflowContext);
      						WorkflowStatusManagerUtil.updateStatus(WorkflowConstants.getLabelStatus("pending"), workflowContext);]]>
      				</script>
      				<script-language>groovy</script-language>
      				<execution-type>onAssignment</execution-type>
      			</action>
      			<notification>
      				<name>Creator Modification Notification</name>
      				<template>
      					<![CDATA[Your submission was rejected by ${userName}, please modify and resubmit.]]>
      				</template>
      				<template-language>freemarker</template-language>
      				<notification-type>user-notification</notification-type>
      				<recipients>
      					<user/>
      				</recipients>
      				<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>
      					<![CDATA[${userName} sent you a ${entryType} for review in the workflow.]]>
      				</template>
      				<template-language>freemarker</template-language>
      				<notification-type>user-notification</notification-type>
      				<recipients>
      					<user/>
      				</recipients>
      				<execution-type>onAssignment</execution-type>
      			</notification>
      			<notification>
      				<name>Review Completion Notification</name>
      				<template>
      					<![CDATA[Your submission was reviewed
      					<#if taskComments?has_content> and the reviewer applied the following ${taskComments}</#if>.]]>
      				</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>Administrator</name>
      					<auto-create>false</auto-create>
      				</role>
      			</roles>
      		</assignments>
      		<transitions>
      			<transition>
      				<name>approve</name>
      				<target>approved</target>
      				<default>true</default>
      			</transition>
      			<transition>
      				<name>reject</name>
      				<target>update</target>
      				<default>false</default>
      			</transition>
      		</transitions>
      		<task-timers>
      			<task-timer>
      				<name>a</name>
      				<description></description>
      				<delay>
      					<duration></duration>
      					<scale>second</scale>
      				</delay>
      				<blocking>false</blocking>
      				<timer-actions>
      					<reassignments>
      						<roles>
      							<role>
      								<role-type>site</role-type>
      								<name>Site Administrator</name>
      								<auto-create>false</auto-create>
      							</role>
      						</roles>
      					</reassignments>
      				</timer-actions>
      			</task-timer>
      		</task-timers>
      	</task>
      </workflow-definition>
      
      
      

      2. Start master bundle, go to Control Panel-> Configuration->Worfklow, define new workflow by using the generated workflow from step 1.
      3. Click Save.

      Actual Behavior: Please enter a valid definition. The error is thrown "com.liferay.portal.kernel.xml.DocumentException: Error on line 173 of document : cvc-complex-type.2.4.d: Invalid content was found starting with element 'task-timers'. No child element is expected at this point. Nested exception: cvc-complex-type.2.4.d: Invalid content was found starting with element 'task-timers'. No child element is expected at this point." from java, but it is transferred in UI.

      Expected behavior: Save successful because the workflow definition came from UI definition (kaleo-design on DXP).

        Attachments

        1. Fixed.PNG
          Fixed.PNG
          33 kB
        2. Fixed70.PNG
          Fixed70.PNG
          60 kB

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 51 weeks, 3 days ago

                Packages

                Version Package
                7.0.0 DXP FP32
                7.0.5 CE GA6
                7.0.X
                7.1.X
                Master