Launching a workflow within a workflow using javascript
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 07:33 AM
Hi,
I want to launch a workflow from within another workflow.
I have this code that will create a workflow correctly if I run it through the javascript console addin.
If put the code into my activiti:taskListener on the workflow I get an error "failed to execute supplied script : null"
It seems to fail on the workflow.execute(doc) line.
Does anyone know what I am doing wrong, Is it not possible to launch a workflow from within a workflow? Perhaps there is a better way to do this.
Thanks,
I want to launch a workflow from within another workflow.
I have this code that will create a workflow correctly if I run it through the javascript console addin.
var doc = userhome.createFile("testing1.txt"); doc.content = "original text"; var workflow = actions.create("start-workflow"); workflow.parameters.workflowName = "activiti$ps_New_Post_Workflow"; workflow.parameters["bpm:workflowDescription"] = "Please index test" ; workflow.execute(doc);
If put the code into my activiti:taskListener on the workflow I get an error "failed to execute supplied script : null"
It seems to fail on the workflow.execute(doc) line.
Does anyone know what I am doing wrong, Is it not possible to launch a workflow from within a workflow? Perhaps there is a better way to do this.
Thanks,
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 03:37 AM
It seems something is null,please paste your alfresco.log here.
I haven't ever launched a workflow within a workflow,can't you use activiti Sub-Process as instead?
And you'd better not use "workflow" as variable name,there is a root object named "workflow" in alfresco
I haven't ever launched a workflow within a workflow,can't you use activiti Sub-Process as instead?
And you'd better not use "workflow" as variable name,there is a root object named "workflow" in alfresco
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 05:44 AM
Hi,
Here is the alfresco log
I have found this post which seems to suggest it is a problem with a new release of activiti - https://forums.alfresco.com/forum/developer-discussions/workflow/problem-start-workflow-script-writt...
I have tried using the code in that post and get the same issue, also my code runs fine from the javascript console. I have also tried my code using different variable names as I know some are already root objects like you suggested.
I haven't tried the sub process. Our workflow processes can be quite long so I want to split the process up into 3 smaller workflows to make things simpler I actually want the code to run at the very end of the workflow to start the next one. I am not sure if a sub process is the right idea for that. Is there another way that may you think I should try?
Thanks,
Here is the alfresco log
10:36:42,885 DEBUG [org.alfresco.repo.workflow.activiti.properties.ActivitiPropertyConverter] [http-apr-8080-exec-8] Task priority value (50) was invalid so it was set to the default value of 2. Task:Alfresco User Task10:36:42,899 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] [http-apr-8080-exec-8] Imports resolved, adding resource '_root10:36:42,929 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor.calls] [http-apr-8080-exec-8] string script Start10:36:43,062 DEBUG [org.alfresco.repo.workflow.activiti.properties.ActivitiPropertyConverter] [http-apr-8080-exec-8] Task priority value (50) was invalid so it was set to the default value of 2. Task:Alfresco User Task10:36:43,064 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] [http-apr-8080-exec-8] Imports resolved, adding resource 'root10:36:43,066 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor.calls] [http-apr-8080-exec-8] string script Start10:36:43,067 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor.calls] [http-apr-8080-exec-8] string script End 1 ms10:36:43,070 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor.calls] [http-apr-8080-exec-8] string script Exceptionorg.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (AlfrescoJS#18) at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1757) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:170) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243) at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66) at org.mozilla.javascript.gen.c1._c0(AlfrescoJS:18) at org.mozilla.javascript.gen.c1.call(AlfrescoJS) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834) at org.mozilla.javascript.gen.c1.call(AlfrescoJS) at org.mozilla.javascript.gen.c1.exec(AlfrescoJS) at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:502) at org.alfresco.repo.jscript.RhinoScriptProcessor.executeString(RhinoScriptProcessor.java:276) at org.alfresco.repo.processor.ScriptServiceImpl.executeString(ScriptServiceImpl.java:286) at org.alfresco.repo.processor.ScriptServiceImpl.executeScriptString(ScriptServiceImpl.java:193) at org.alfresco.repo.processor.ScriptServiceImpl.executeScriptString(ScriptServiceImpl.java:183) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:164) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.sun.proxy.$Proxy328.executeScriptString(Unknown Source) at org.alfresco.repo.workflow.activiti.script.ActivitiScriptBase.executeScript(ActivitiScriptBase.java:105) at org.alfresco.repo.workflow.activiti.script.ActivitiScriptBase$1.doWork(ActivitiScriptBase.java:89) at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:548) at org.alfresco.repo.workflow.activiti.script.ActivitiScriptBase.executeScriptAsUser(ActivitiScriptBase.java:85) at org.alfresco.repo.workflow.activiti.script.ActivitiScriptBase.executeScript(ActivitiScriptBase.java:77) at org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener.notify(ScriptTaskListener.java:78) at org.activiti.engine.impl.delegate.TaskListenerInvocation.invoke(TaskListenerInvocation.java:34) at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37) at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25) at org.activiti.engine.impl.bpmn.helper.ClassDelegate.notify(ClassDelegate.java:93) at org.activiti.engine.impl.delegate.TaskListenerInvocation.invoke(TaskListenerInvocation.java:34) at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37) at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25) at org.activiti.engine.impl.persistence.entity.TaskEntity.fireEvent(TaskEntity.java:533) at org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior.execute(UserTaskActivityBehavior.java:92) at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:66) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:116) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:367) at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:105) at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:54) at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44) at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36) at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527) at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStartInitial.eventNotificationsCompleted(AtomicOperationProcessStartInitial.java:46) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527) at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStart.eventNotificationsCompleted(AtomicOperationProcessStart.java:45) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:322) at org.activiti.engine.impl.cmd.SubmitStartFormCmd.execute(SubmitStartFormCmd.java:57) at org.activiti.engine.impl.cmd.SubmitStartFormCmd.execute(SubmitStartFormCmd.java:30) at org.activiti.engine.impl.cmd.NeedsActiveProcessDefinitionCmd.execute(NeedsActiveProcessDefinitionCmd.java:53) at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:61) at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40) at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31) at org.activiti.engine.impl.FormServiceImpl.submitStartFormData(FormServiceImpl.java:62) at org.activiti.explorer.ui.process.ProcessDefinitionDetailPanel$1.handleFormSubmit(ProcessDefinitionDetailPanel.java:76) at org.activiti.explorer.ui.form.FormPropertiesEventListener.componentEvent(FormPropertiesEventListener.java:39) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510) at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164) at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219) at org.activiti.explorer.ui.form.FormPropertiesForm.access$000(FormPropertiesForm.java:45) at org.activiti.explorer.ui.form.FormPropertiesForm$1.buttonClick(FormPropertiesForm.java:139) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510) at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164) at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219) at com.vaadin.ui.Button.fireClick(Button.java:567) at com.vaadin.ui.Button.changeVariables(Button.java:223) at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1460) at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1404) at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1329) at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:761) at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:325) at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:68) at sun.reflect.GeneratedMethodAccessor489.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:125) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.sun.proxy.$Proxy325.doFilter(Unknown Source) at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)Caused by: java.lang.NullPointerException at org.alfresco.repo.workflow.activiti.ActivitiTypeConverter.convert(ActivitiTypeConverter.java:300) at org.alfresco.repo.workflow.activiti.ActivitiTypeConverter.convert(ActivitiTypeConverter.java:280) at org.alfresco.repo.workflow.activiti.ActivitiWorkflowEngine.startWorkflow(ActivitiWorkflowEngine.java:995) at org.alfresco.repo.workflow.WorkflowServiceImpl.startWorkflow(WorkflowServiceImpl.java:438) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.alfresco.service.cmr.workflow.WorkflowPermissionInterceptor.invoke(WorkflowPermissionInterceptor.java:54) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:164) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.sun.proxy.$Proxy61.startWorkflow(Unknown Source) at org.alfresco.repo.workflow.StartWorkflowActionExecuter.executeImpl(StartWorkflowActionExecuter.java:145) at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:265) at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:838) at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:738) at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:572) at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:558) at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:847) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:164) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.sun.proxy.$Proxy47.executeAction(Unknown Source) at org.alfresco.repo.jscript.ScriptAction.executeImpl(ScriptAction.java:166) at org.alfresco.repo.jscript.ScriptAction.execute(ScriptAction.java:136) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155) … 174 more10:36:43,089 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor.calls] [http-apr-8080-exec-8] string script End 159 ms
I have found this post which seems to suggest it is a problem with a new release of activiti - https://forums.alfresco.com/forum/developer-discussions/workflow/problem-start-workflow-script-writt...
I have tried using the code in that post and get the same issue, also my code runs fine from the javascript console. I have also tried my code using different variable names as I know some are already root objects like you suggested.
I haven't tried the sub process. Our workflow processes can be quite long so I want to split the process up into 3 smaller workflows to make things simpler I actually want the code to run at the very end of the workflow to start the next one. I am not sure if a sub process is the right idea for that. Is there another way that may you think I should try?
Thanks,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2014 09:28 PM
It might be a bug of your activiti version ,can you download a newer alfresco version (for example 5.0 which will use activiti 5.16) and test whether it works ?
