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

Workflow fails to parse groovy assignment script

    Details

      Description

      Steps to Reproduce:

      1. Navigate to Product Menu > Control Panel > Configuration > Workflow Definition
      2. Upload attached definition
      3. Navigate to Product Menu > Control Panel > Users > Users and Organizations
      4. Add Organization
      5. Add Organization site
      6. Add Organization page
      7. Add User1 and assign to Organization
      8. Assign User1 to "Organization Content Reviewer" role
      9. Add User2 and assign to Liferay site
      10. Assign User2 to "Site Content Reviewer" role
      11. Go to Organization Site
      12. Go to Documents and Media
      13. Enable Scripted Assignment definition to the Documents and Media home folder workflow
      14. Add Document
      15. Submit for Publication

      Expected Result:
      Document assigned with groovy script in the workflow definition.

      Actual Result:
      Assign fails and error is thrown:

      23:32:10,015 ERROR [liferay/kaleo_graph_walker-2][ParallelDestination:55] Unable to process message {destinationName=liferay/kaleo_graph_walker, response=null, responseDestinationName=null, responseId=null, payload=com.liferay.portal.workflow.kaleo.runtime.graph.PathElement@5086f4a7, values={defaultLocale=en_US, companyId=20113, groupId=0, principalName=20153, permissionChecker=com.liferay.portal.kernel.util.TransientValue@29cfdcb4, siteDefaultLocale=en_US, themeDisplayLocale=en_US}}
      com.liferay.portal.kernel.messaging.MessageListenerException: com.liferay.portal.kernel.scripting.ScriptingException: startup failed:_Script1.groovy: 1: expecting EOF, found 'user' @ line 1, column 956._   eviewer"); roles.add(role); } user = nul_                                 ^__1 error__Line 1: import com.liferay.portal.kernel.model.Group; import com.liferay.portal.kernel.model.Role; import com.liferay.portal.kernel.service.GroupLocalServiceUtil; import com.liferay.portal.kernel.service.RoleLocalServiceUtil; import com.liferay.portal.kernel.util.GetterUtil; import com.liferay.portal.kernel.workflow.WorkflowConstants; long companyId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_COMPANY_ID)); long groupId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_GROUP_ID)); Group group = GroupLocalServiceUtil.getGroup(groupId); roles = new ArrayList<Role>(); Role adminRole = RoleLocalServiceUtil.getRole(companyId, "Administrator"); roles.add(adminRole); if (group.isOrganization()) { Role role = RoleLocalServiceUtil.getRole(companyId, "Organization Content Reviewer"); roles.add(role); } else { Role role = RoleLocalServiceUtil.getRole(companyId, "Site Content Reviewer"); roles.add(role); } user = null;_ [Sanitized]
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:52)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:756)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: com.liferay.portal.kernel.scripting.ScriptingException: startup failed:_Script1.groovy: 1: expecting EOF, found 'user' @ line 1, column 956._   eviewer"); roles.add(role); } user = nul_                                 ^__1 error__Line 1: import com.liferay.portal.kernel.model.Group; import com.liferay.portal.kernel.model.Role; import com.liferay.portal.kernel.service.GroupLocalServiceUtil; import com.liferay.portal.kernel.service.RoleLocalServiceUtil; import com.liferay.portal.kernel.util.GetterUtil; import com.liferay.portal.kernel.workflow.WorkflowConstants; long companyId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_COMPANY_ID)); long groupId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_GROUP_ID)); Group group = GroupLocalServiceUtil.getGroup(groupId); roles = new ArrayList<Role>(); Role adminRole = RoleLocalServiceUtil.getRole(companyId, "Administrator"); roles.add(adminRole); if (group.isOrganization()) { Role role = RoleLocalServiceUtil.getRole(companyId, "Organization Content Reviewer"); roles.add(role); } else { Role role = RoleLocalServiceUtil.getRole(companyId, "Site Content Reviewer"); roles.add(role); } user = null;_ [Sanitized]
      	at com.liferay.portal.scripting.internal.ScriptingImpl.eval(ScriptingImpl.java:91)
      	at com.liferay.portal.workflow.kaleo.runtime.scripting.internal.util.KaleoScriptingEvaluator.execute(KaleoScriptingEvaluator.java:58)
      	at com.liferay.portal.workflow.kaleo.runtime.scripting.internal.assignment.ScriptingLanguagesTaskAssignmentSelector.calculateTaskAssignments(ScriptingLanguagesTaskAssignmentSelector.java:59)
      	at com.liferay.portal.workflow.kaleo.runtime.internal.assignment.MultiLanguageTaskAssignmentSelector.calculateTaskAssignments(MultiLanguageTaskAssignmentSelector.java:81)
      	at com.liferay.portal.workflow.kaleo.runtime.internal.node.TaskNodeExecutor.createTaskInstanceToken(TaskNodeExecutor.java:122)
      	at com.liferay.portal.workflow.kaleo.runtime.internal.node.TaskNodeExecutor.doEnter(TaskNodeExecutor.java:159)
      	at com.liferay.portal.workflow.kaleo.runtime.node.BaseNodeExecutor.enter(BaseNodeExecutor.java:51)
      	at com.liferay.portal.workflow.kaleo.runtime.internal.graph.DefaultGraphWalker.follow(DefaultGraphWalker.java:65)
      	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.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:163)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
      	at com.sun.proxy.$Proxy424.follow(Unknown Source)
      	at com.liferay.portal.workflow.kaleo.runtime.internal.graph.messaging.PathElementMessageListener.doReceive(PathElementMessageListener.java:57)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      	... 5 more
      Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:_Script1.groovy: 1: expecting EOF, found 'user' @ line 1, column 956._   eviewer"); roles.add(role); } user = nul_                                 ^__1 error_ [Sanitized]
      	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
      	at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:150)
      	at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:120)
      	at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:132)
      	at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:360)
      	at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:145)
      	at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:111)
      	at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:237)
      	at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:167)
      	at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931)
      	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593)
      	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
      	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
      	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:694)
      	at groovy.lang.GroovyShell.parse(GroovyShell.java:706)
      	at groovy.lang.GroovyShell.parse(GroovyShell.java:742)
      	at groovy.lang.GroovyShell.parse(GroovyShell.java:733)
      	at com.liferay.portal.scripting.groovy.internal.GroovyExecutor.eval(GroovyExecutor.java:58)
      	at com.liferay.portal.scripting.internal.ScriptingImpl.eval(ScriptingImpl.java:87)
      	... 24 more
      

        Attachments

          Activity

            People

            • Assignee:
              victor.ware Victor Ware
              Reporter:
              victor.ware Victor Ware
              Participants of an Issue:
              Recent user:
              Jason Pince
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 8 weeks, 4 days ago

                Packages

                Version Package
                7.1.X
                Master