AnsweredAssumed Answered

workflow fails to set aspect

Question asked by purohitsumit on Apr 3, 2014
Latest reply on Apr 18, 2014 by purohitsumit
I am following "http://ecmarchitect.com/alfresco-developer-series-tutorials" and have new workflow in my share's web app.

I have reused "http://ecmarchitect.com/alfresco-developer-series-tutorials/workflow/tutorial/tutorial.html#someco-whitepaper-submission-example" example and on "approve" action I am trying to set webable aspect. But I am getting following error.

org.activiti.engine.ActivitiException: Exception while invoking TaskListener: Exception while invoking TaskListener: 03020110 Failed to execute supplied script: null



somewhere deep in the error stack I find  following lines :



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:92)
   … 189 more
Caused by: java.lang.UnsupportedOperationException
   at java.util.Collections$UnmodifiableMap.put(Collections.java:1342)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.addAspectsAndProperties(DbNodeServiceImpl.java:546)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.addAspectsAndProperties(DbNodeServiceImpl.java:466)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.addAspect(DbNodeServiceImpl.java:834)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:601)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.jav



I am suing exactly same "extensionElements" in my bmpn.xml file


<extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
            <activiti:field name="script">
                <activiti:string>
                    var setWebFlagAction = actions.create("set-web-flag");
                    setWebFlagAction.parameters["active"] = true;
                    for (var i = 0; i &lt; bpm_package.children.length; i++) {
                        logger.log("Approving node:" + bpm_package.children.nodeRef);
                        setWebFlagAction.execute(bpm_package.children);
                    }
                </activiti:string>
            </activiti:field>
        </activiti:taskListener>
    </extensionElements>



and I am using SetWebFlag.java from "action" tutorial.


If someone can suggest me cause AND/OR fix of this issue, I will be thankful.

Thanks

Outcomes