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

Unable to add/update workflow definitions with a Task Assignment of 'User'

    Details

      Description

      Steps to Reproduce in master

      1. Start Liferay and sign in as an admin user
      2. Navigate to Applications Menu > Control Panel > Users > Users & Organizations and create a new user
      3. Navigate to Applications Menu > Applications > Workflow > Process Builder and edit the Single Approver definition:
      4. In a Task node, edit the Assignment property to have the value of 'User'
      5. Search for and select the user created in step 2
      6. Publish the workflow

      Steps to Reproduce in 7.2

      1. Start Liferay and sign in as an admin user
      2. Navigate to Control Panel > Users > Users & Organizations and create a new user
      3. Navigate to Control Panel > Workflow > Process Builder and create a new workflow with the following nodes:
      Start node >> Task node >> End node
      4. In the Task node, edit the Assignment property to have the value of 'User'
      5. Search for and select the user created in step 2
      6. Publish the workflow

      For both versions the result is the same:

      Expected Behavior: Workflow publishes successfully.

      Actual Behavior: Workflow fails to publish due to the following error: Error:Please enter valid content. 

      Debugging the code or enabling the corresponding warn traces you can see the following exception message:

      2020-08-27 09:46:45.449 WARN  [http-nio-8080-exec-7][BaseKaleoDesignerMVCActionCommand:81] org.xml.sax.SAXParseException; lineNumber: 35; columnNumber: 18; cvc-complex-type.2.4.d: Invalid content was found starting with element 'screen-name'. No child element is expected at this point.
      org.xml.sax.SAXParseException; lineNumber: 35; columnNumber: 18; cvc-complex-type.2.4.d: Invalid content was found starting with element 'screen-name'. No child element is expected at this point.
              at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
              at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
              at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
              at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
              at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
              at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
              at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
              at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
              at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
              at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
              at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
              at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
              at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
              at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
              at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
              at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
              at com.liferay.portal.security.xml.StripDoctypeXMLReader.parse(StripDoctypeXMLReader.java:136)
              at org.dom4j.io.SAXReader.read(SAXReader.java:445)
              at org.dom4j.io.SAXReader.read(SAXReader.java:325)
              at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:368)
              at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:145)
              at com.liferay.portal.workflow.kaleo.definition.internal.parser.XMLWorkflowModelParser.parse(XMLWorkflowModelParser.java:80)
              at com.liferay.portal.workflow.kaleo.runtime.internal.DefaultWorkflowEngineImpl.deployWorkflowDefinition(DefaultWorkflowEngineImpl.java:152)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69)
              at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
              at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:60)
              at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
              at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
              at com.sun.proxy.$Proxy678.deployWorkflowDefinition(Unknown Source)
              at com.liferay.portal.workflow.kaleo.runtime.integration.internal.WorkflowDefinitionManagerImpl.deployWorkflowDefinition(WorkflowDefinitionManagerImpl.java:89)
      

      Note the xml (source code) that is generated, from fixack-6 (LPS-113477) related to the task's assignment section:

      <assignments> 
          <user> 
            <email-address>cris@liferay.com</email-address> 
            <screen-name>cris</screen-name> 
            <user-id>35173</user-id> 
          </user> 
      </assignments>

      The xml generated previous to LPS-113477 was:

      <assignments> 
         <user> 
            <user-id>35173</user-id> 
         </user> 
      </assignments>

      If we manually delete these 2 new properties, the workflow can be saved without errors.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rodrigo.cunha Rodrigo Cunha
              Reporter:
              cristina.rodriguez Cristina Rodriguez
              Participants of an Issue:
              Recent user:
              Yunlin "Steven" Sun
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                34 weeks, 1 day ago

                  Packages

                  Version Package
                  7.2.10 DXP FP9
                  7.2.X
                  7.3.X
                  7.3.5 CE GA6
                  7.3.10 DXP GA1
                  Master