Script para ejecutar un Advanced Workflow

cancel
Showing results for 
Search instead for 
Did you mean: 
universitario
Member II

Script para ejecutar un Advanced Workflow

Hola a tod@s,
Me gustaria crear un script para que cuando meta un archivo en una carpeta concreta, automaticamente se le asigne un advanced workflow (el parallelreview_group) pero ademas quisiera que ese documento una vez haya sido aprobado por toos los miembros del grupo asignado, pase a otra carpeta. No sé si esto es posible.
Otra cosa que se me ha ocurrido es crear una regla que haga que cuando un documento tenga una cadena concreta (como por ejemplo "OK" pase a otra carpeta, siendo el encargado de cambiarle el nombre el advanced workflow parallelreview_grupo, pero no consigo que el advanced workflow me cambie el nombre del archivo.

Esto es lo que le he añadido al parallelreview_grupo_processdefinition.xml:
<script>
       <!–cambio el nombre–>
            document.properties.name = document.properties.name + "*OK*";
      <document.save();

</script>

quedando el parallelreview_grupo_processdefinition.xml:

<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:parallelgroupreview">

    <swimlane name="initiator"></swimlane>

    <start-state name="start">
        <task name="wf:submitGroupReviewTask" swimlane="initiator" />
        <transition name="" to="startreview"/>
    </start-state>

    <node name="startreview">
        <action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
            <foreach>#{people.getMembers(bpm_groupAssignee)}</foreach>
            <var>reviewer</var>
        </action>
        <event type="node-enter">
            <script>
                <variable name="wf_approveCount" access="write" />
                <expression>
                    wf_approveCount = 0;
                </expression>
            </script>
        </event>
        <transition name="review" to="review" />
    </node>

    <task-node name="review">
        <task name="wf:reviewTask">
            <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
               <actor>#{reviewer}</actor>
            </assignment>
            <event type="task-create">
                <script>
                    if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
                    if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
                </script>
            </event>
        </task>
        <transition name="reject" to="endreview" />
        <transition name="approve" to="endreview">
            <script>
                <variable name="wf_approveCount" access="read,write" />
                <expression>
                    wf_approveCount = wf_approveCount +1;
                 </expression>
            </script>
        </transition>
    </task-node>

    <join name="endreview">
        <transition to="isapproved" />
    </join>

    <decision name="isapproved">
        <event type="node-enter">
           <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
              <script>
                 <variable name="wf_reviewerCount" access="write"/>
                 <expression>people.getMembers(bpm_groupAssignee).length;</expression>
              </script>
           </action>
           <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
              <script>
                 <variable name="wf_requiredPercent" access="write"/>
                 <expression>wf_requiredPercent = wf_requiredApprovePercent;</expression>
              </script>
           </action>
           <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
              <script>
                 <variable name="wf_actualPercent" access="write"/>
                 <expression>wf_actualPercent = ((wf_approveCount * 100) / people.getMembers(bpm_groupAssignee).length);</expression>
              </script>
           </action>
        </event>
        <transition name="reject" to="rejected" />
        <transition name="approve" to="approved">
            <script>
       <!–cambio el nombre–>
            document.properties.name = document.properties.name + "*OK*";
      <document.save();
         </script>
            <condition>#{wf_actualPercent >= wf_requiredApprovePercent}</condition>
        </transition>
    </decision>
              
    <task-node name="rejected">
        <task name="wf:rejectedParallelTask" swimlane="initiator" />
        <transition to="end" />
    </task-node>

    <task-node name="approved">
        <task name="wf:approvedParallelTask" swimlane="initiator" />
        <transition to="end" />
    </task-node>

    <end-state name="end"/>


y este es el log:

22:25:46,852 INFO  [org.alfresco.config.SystemPropertiesFactoryBean] Loading properties file from class path resource [alfresco/domain/hibernate-cfg.properties]
22:25:46,854 INFO  [org.alfresco.config.SystemPropertiesFactoryBean] Loading properties file from class path resource [alfresco/extension/custom-hibernate-dialect.properties]
22:25:53,894 ERROR [org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformer] ImageMagickContentTransformer not available: Failed to perform ImageMagick transformation:
Execution result:
   os:         Linux
   command:    [./ImageMagick/bin/convert, /opt/Alfresco/apache-tomcat-5.5.28/temp/Alfresco/ImageMagickContentTransformer_init_source_911172118054496741.gif[0], /opt/Alfresco/apache-tomcat-5.5.28/temp/Alfresco/ImageMagickContentTransformer_init_target_4416840871799592960.png]
   succeeded:  false
   exit code:  1
   out:       
   err:        Cannot run program "./ImageMagick/bin/convert": java.io.IOException: error=2, No such file or directory
22:25:55,423 INFO  [org.alfresco.config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
22:25:58,962 ERROR [org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer] Failed to start a runtime executable content transformer:
Execution result:
   os:         Linux
   command:    [./bin/pdf2swf, -V]
   succeeded:  false
   exit code:  1
   out:       
   err:        Cannot run program "./bin/pdf2swf": java.io.IOException: error=2, No such file or directory
22:26:04,025 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.
22:26:05,119 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] No changes were made to the schema.
22:26:05,626 DEBUG [org.alfresco.repo.avm.TransactionalLookupCache.init] preRegister called. Server=com.sun.jmx.mbeanserver.JmxMBeanServer@4383e3, name=log4j:logger=org.alfresco.repo.avm.TransactionalLookupCache.init
22:26:05,652 DEBUG [org.alfresco.web.bean.TemplateMailHelperBean] preRegister called. Server=com.sun.jmx.mbeanserver.JmxMBeanServer@4383e3, name=log4j:logger=org.alfresco.web.bean.TemplateMailHelperBean
22:26:07,698 INFO  [org.alfresco.repo.admin.ConfigurationChecker] The Alfresco root data directory ('dir.root') is: /opt/Alfresco/repositorio
22:26:07,758 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
22:26:07,924 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
22:26:07,927 INFO  [org.alfresco.repo.module.ModuleServiceImpl] Found 0 module(s).
22:26:13,053 ERROR [org.alfresco.fileserver] Failed to get local domain/workgroup name, using default of WORKGROUP
22:26:13,054 ERROR [org.alfresco.fileserver] (This may be due to firewall settings or incorrect <broadcast> setting)
22:26:13,285 WARN  [org.alfresco.util.OpenOfficeConnectionTester] An initial OpenOffice connection could not be established.
22:26:13,332 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.6.0_18-b07; maximum heap size 981,375MB
22:26:13,332 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco license: Enterprise - v3.1 granted to Intecna (does not expire)
22:26:13,332 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Enterprise): Current version 3.1.2 (390) schema 1011 - Installed version 3.1.2 (390) schema 1011
22:27:23,381 ERROR [org.jbpm.graph.def.GraphElement] action threw exception: Sourced file: inline evaluation of: ``               document.properties.name = document.properties.name + "OK";       document.sa . . . '' : Method save() not found in bsh scripted object: auto: document
Sourced file: inline evaluation of: ``               document.properties.name = document.properties.name + "OK";       document.sa . . . '' : Method save() not found in bsh scripted object: auto: document : at Line: 4 : in file: inline evaluation of: ``               document.properties.name = document.properties.name + "OK";       document.sa . . . '' : document .save ( )

   at bsh.This.invokeMethod(Unknown Source)
   at bsh.Reflect.invokeObjectMethod(Unknown Source)
   at bsh.Name.invokeMethod(Unknown Source)
   at bsh.BSHMethodInvocation.eval(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at org.jbpm.graph.action.Script.eval(Script.java:130)
   at org.jbpm.graph.action.Script.eval(Script.java:73)
   at org.jbpm.graph.action.Script.execute(Script.java:62)
   at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:264)
   at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
   at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
   at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
   at org.jbpm.graph.def.Transition.take(Transition.java:138)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:136)
   at org.jbpm.graph.node.Decision.execute(Decision.java:152)
   at org.jbpm.graph.def.Node.enter(Node.java:319)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$49892876.enter(<generated>)
   at org.jbpm.graph.def.Transition.take(Transition.java:151)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.def.Node.leave(Node.java:358)
   at org.jbpm.graph.node.Join.execute(Join.java:191)
   at org.jbpm.graph.def.Node.enter(Node.java:319)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$49892876.enter(<generated>)
   at org.jbpm.graph.def.Transition.take(Transition.java:151)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:209)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$83cf1ec0.leave(<generated>)
   at org.jbpm.graph.exe.Token.signal(Token.java:195)
   at org.jbpm.graph.exe.Token.signal(Token.java:166)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$f617cf0a.signal(<generated>)
   at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:488)
   at org.alfresco.repo.workflow.jbpm.WorkflowTaskInstance.end(WorkflowTaskInstance.java:133)
   at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:427)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$26.doInJbpm(JBPMEngine.java:1687)
   at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:87)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
   at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:80)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1655)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.endTask(WorkflowServiceImpl.java:544)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy52.endTask(Unknown Source)
   at org.alfresco.web.bean.workflow.ManageTaskDialog.transition(ManageTaskDialog.java:431)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Thread.java:619)
22:27:23,413 ERROR [org.alfresco.web.ui.common.Utils] A system error happened during the operation: Failed to signal transition 'approve' from workflow task 'jbpm$84'
org.alfresco.service.cmr.workflow.WorkflowException: Failed to signal transition 'approve' from workflow task 'jbpm$84'
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1702)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.endTask(WorkflowServiceImpl.java:544)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy52.endTask(Unknown Source)
   at org.alfresco.web.bean.workflow.ManageTaskDialog.transition(ManageTaskDialog.java:431)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Thread.java:619)
Caused by: org.jbpm.graph.def.DelegationException: Sourced file: inline evaluation of: ``               document.properties.name = document.properties.name + "OK";       document.sa . . . '' : Method save() not found in bsh scripted object: auto: document
   at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:387)
   at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:378)
   at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:281)
   at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
   at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
   at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
   at org.jbpm.graph.def.Transition.take(Transition.java:138)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:136)
   at org.jbpm.graph.node.Decision.execute(Decision.java:152)
   at org.jbpm.graph.def.Node.enter(Node.java:319)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$49892876.enter(<generated>)
   at org.jbpm.graph.def.Transition.take(Transition.java:151)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.def.Node.leave(Node.java:358)
   at org.jbpm.graph.node.Join.execute(Join.java:191)
   at org.jbpm.graph.def.Node.enter(Node.java:319)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$49892876.enter(<generated>)
   at org.jbpm.graph.def.Transition.take(Transition.java:151)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:209)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$83cf1ec0.leave(<generated>)
   at org.jbpm.graph.exe.Token.signal(Token.java:195)
   at org.jbpm.graph.exe.Token.signal(Token.java:166)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$f617cf0a.signal(<generated>)
   at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:488)
   at org.alfresco.repo.workflow.jbpm.WorkflowTaskInstance.end(WorkflowTaskInstance.java:133)
   at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:427)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$26.doInJbpm(JBPMEngine.java:1687)
   at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:87)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
   at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:80)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1655)
   … 50 more
Caused by: Sourced file: inline evaluation of: ``               document.properties.name = document.properties.name + "OK";       document.sa . . . '' : Method save() not found in bsh scripted object: auto: document : at Line: 4 : in file: inline evaluation of: ``               document.properties.name = document.properties.name + "OK";       document.sa . . . '' : document .save ( )

   at bsh.This.invokeMethod(Unknown Source)
   at bsh.Reflect.invokeObjectMethod(Unknown Source)
   at bsh.Name.invokeMethod(Unknown Source)
   at bsh.BSHMethodInvocation.eval(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at org.jbpm.graph.action.Script.eval(Script.java:130)
   at org.jbpm.graph.action.Script.eval(Script.java:73)
   at org.jbpm.graph.action.Script.execute(Script.java:62)
   at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:264)
   … 101 more

Y en la pantalla cuando acepto la tarea me aparece el siguiente mensaje:
Please correct the errors below then click OK.
   * A system error happened during the operation: Failed to signal transition 'approve' from workflow task 'jbpm$84'


Espero que alguien me pueda ayudar.
Muchas gracias
13 Replies
venzia
Senior Member

Re: Script para ejecutar un Advanced Workflow

En principio veo una errata :
            document.properties.name = document.properties.name + "*OK*";
      <document.save();
El simbolo < de antes de document.save() sobra.
Si sigues teniendo problemas comentarte que no se si te permite el uso de * en el nombre del documento. Puedes probar a añadir un aspecto X .. por ejemplo "AprobadoGeneral" y desde el script haces un "document.addAspect("prefix:AprobadoGeneral")". Queda mejor aunq la finalidad es la misma pues en la regla que mueve a otro espacio debera capturar que tiene el aspecto X en lugar de "una cadena en el nombre".
Espero haberme explicado.
Saludos,
universitario
Member II

Re: Script para ejecutar un Advanced Workflow

Gracias por contestar Javier,
Como bien dices ha sido una errata al copiarte el código. Así es como está:

<script>
   document.properties.name = document.properties.name + "OK";
   document.save();
</script>


He quitado los * y sigue sin funcionar.
Con respecto a lo de agregarle un aspecto… tambien lo he intentado, de hecho, fue mi primera opción, pero tambien me daba error, creo recordar que daba el mismo. Estoy empezando a pensar que tal vez no se le pueda poner ninguna instruccion en ese documento.
venzia
Senior Member

Re: Script para ejecutar un Advanced Workflow

y que error te da ahora? .. por lo que veo .. y no se como se me paso inicialmente utilizas el objeto document, el cual no tiene mucho sentido dentro del contexto de un workflow (piensa que puede llevar varios) .. lo que no recuerdo es como se accedia al package del flujo desde ahi .. puedes ir buscando y en caso q no lo encuentres me dices que te eche una mano (y es que voy a tope :mrgreen: )
Saludos,
universitario
Member II

Re: Script para ejecutar un Advanced Workflow

Si te refieres al que me muestra en el navegador es este:
Please correct the errors below then click OK.
  * A system error happened during the operation: Failed to signal transition 'approve' from workflow task 'jbpm$86'

Voy a intentar de nuevo el agregarle un aspecto.
Y con respecto a lo que has dicho del package … antes utilicé esto  "bpm_package.children[0].properties" y tampoco hubo suerte
venzia
Senior Member

Re: Script para ejecutar un Advanced Workflow

me refiero a alfresco.log .. ese nos dara mas detalles  :wink:
universitario
Member II

Re: Script para ejecutar un Advanced Workflow

Pues veras, lo tengo calentito, recien salido del horno. he cambiado el parallelreview_grupo y he puesto lo de addAspect, en el navegador me pone el error que te he pusto antes, y el log es el siguiente:


19:40:51,057 INFO  [org.alfresco.config.SystemPropertiesFactoryBean] Loading properties file from class path resource [alfresco/domain/hibernate-cfg.properties]
19:40:51,074 INFO  [org.alfresco.config.SystemPropertiesFactoryBean] Loading properties file from class path resource [alfresco/extension/custom-hibernate-dialect.properties]
19:40:58,491 ERROR [org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformer] ImageMagickContentTransformer not available: Failed to perform ImageMagick transformation:
Execution result:
   os:         Linux
   command:    [./ImageMagick/bin/convert, /opt/Alfresco/apache-tomcat-5.5.28/temp/Alfresco/ImageMagickContentTransformer_init_source_5078130724140249639.gif[0], /opt/Alfresco/apache-tomcat-5.5.28/temp/Alfresco/ImageMagickContentTransformer_init_target_3346312697061500145.png]
   succeeded:  false
   exit code:  1
   out:       
   err:        Cannot run program "./ImageMagick/bin/convert": java.io.IOException: error=2, No such file or directory
19:40:59,928 INFO  [org.alfresco.config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
19:41:04,173 ERROR [org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer] Failed to start a runtime executable content transformer:
Execution result:
   os:         Linux
   command:    [./bin/pdf2swf, -V]
   succeeded:  false
   exit code:  1
   out:       
   err:        Cannot run program "./bin/pdf2swf": java.io.IOException: error=2, No such file or directory
19:41:09,462 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.
19:41:10,517 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] No changes were made to the schema.
19:41:11,248 DEBUG [org.alfresco.repo.avm.TransactionalLookupCache.init] preRegister called. Server=com.sun.jmx.mbeanserver.JmxMBeanServer@1809bd3, name=log4j:logger=org.alfresco.repo.avm.TransactionalLookupCache.init
19:41:11,275 DEBUG [org.alfresco.web.bean.TemplateMailHelperBean] preRegister called. Server=com.sun.jmx.mbeanserver.JmxMBeanServer@1809bd3, name=log4j:logger=org.alfresco.web.bean.TemplateMailHelperBean
19:41:13,230 INFO  [org.alfresco.repo.admin.ConfigurationChecker] The Alfresco root data directory ('dir.root') is: /opt/Alfresco/repositorio
19:41:13,298 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
19:41:13,469 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
19:41:13,472 INFO  [org.alfresco.repo.module.ModuleServiceImpl] Found 0 module(s).
19:41:18,597 ERROR [org.alfresco.fileserver] Failed to get local domain/workgroup name, using default of WORKGROUP
19:41:18,597 ERROR [org.alfresco.fileserver] (This may be due to firewall settings or incorrect <broadcast> setting)
19:41:18,853 WARN  [org.alfresco.util.OpenOfficeConnectionTester] An initial OpenOffice connection could not be established.
19:41:18,910 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.6.0_18-b07; maximum heap size 981,375MB
19:41:18,911 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco license: Enterprise - v3.1 granted to Intecna (does not expire)
19:41:18,911 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Enterprise): Current version 3.1.2 (390) schema 1011 - Installed version 3.1.2 (390) schema 1011
19:42:50,752 ERROR [org.jbpm.graph.def.GraphElement] action threw exception: Sourced file: inline evaluation of: ``               document.addAspect("lw:Aprobado");           ;'' : Attempt to resolve method: addAspect() on undefined variable or class name: document
Sourced file: inline evaluation of: ``               document.addAspect("lw:Aprobado");           ;'' : Attempt to resolve method: addAspect() on undefined variable or class name: document : at Line: 3 : in file: inline evaluation of: ``               document.addAspect("lw:Aprobado");           ;'' : document .addAspect ( "lw:Aprobado" )

   at bsh.UtilEvalError.toEvalError(Unknown Source)
   at bsh.UtilEvalError.toEvalError(Unknown Source)
   at bsh.BSHMethodInvocation.eval(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at org.jbpm.graph.action.Script.eval(Script.java:130)
   at org.jbpm.graph.action.Script.eval(Script.java:73)
   at org.jbpm.graph.action.Script.execute(Script.java:62)
   at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:264)
   at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
   at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
   at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
   at org.jbpm.graph.def.Transition.take(Transition.java:138)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:136)
   at org.jbpm.graph.node.Decision.execute(Decision.java:152)
   at org.jbpm.graph.def.Node.enter(Node.java:319)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$49892876.enter(<generated>)
   at org.jbpm.graph.def.Transition.take(Transition.java:151)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.def.Node.leave(Node.java:358)
   at org.jbpm.graph.node.Join.execute(Join.java:191)
   at org.jbpm.graph.def.Node.enter(Node.java:319)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$49892876.enter(<generated>)
   at org.jbpm.graph.def.Transition.take(Transition.java:151)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:209)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$83cf1ec0.leave(<generated>)
   at org.jbpm.graph.exe.Token.signal(Token.java:195)
   at org.jbpm.graph.exe.Token.signal(Token.java:166)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$f617cf0a.signal(<generated>)
   at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:488)
   at org.alfresco.repo.workflow.jbpm.WorkflowTaskInstance.end(WorkflowTaskInstance.java:133)
   at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:427)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$26.doInJbpm(JBPMEngine.java:1687)
   at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:87)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
   at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:80)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1655)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.endTask(WorkflowServiceImpl.java:544)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy52.endTask(Unknown Source)
   at org.alfresco.web.bean.workflow.ManageTaskDialog.transition(ManageTaskDialog.java:431)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Thread.java:619)
19:42:50,790 ERROR [org.alfresco.web.ui.common.Utils] A system error happened during the operation: Failed to signal transition 'approve' from workflow task 'jbpm$88'
org.alfresco.service.cmr.workflow.WorkflowException: Failed to signal transition 'approve' from workflow task 'jbpm$88'
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1702)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.endTask(WorkflowServiceImpl.java:544)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy52.endTask(Unknown Source)
   at org.alfresco.web.bean.workflow.ManageTaskDialog.transition(ManageTaskDialog.java:431)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Thread.java:619)
Caused by: org.jbpm.graph.def.DelegationException: Sourced file: inline evaluation of: ``               document.addAspect("lw:Aprobado");           ;'' : Attempt to resolve method: addAspect() on undefined variable or class name: document
   at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:387)
   at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:378)
   at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:281)
   at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
   at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
   at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
   at org.jbpm.graph.def.Transition.take(Transition.java:138)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:136)
   at org.jbpm.graph.node.Decision.execute(Decision.java:152)
   at org.jbpm.graph.def.Node.enter(Node.java:319)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$49892876.enter(<generated>)
   at org.jbpm.graph.def.Transition.take(Transition.java:151)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.def.Node.leave(Node.java:358)
   at org.jbpm.graph.node.Join.execute(Join.java:191)
   at org.jbpm.graph.def.Node.enter(Node.java:319)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$49892876.enter(<generated>)
   at org.jbpm.graph.def.Transition.take(Transition.java:151)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:209)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$83cf1ec0.leave(<generated>)
   at org.jbpm.graph.exe.Token.signal(Token.java:195)
   at org.jbpm.graph.exe.Token.signal(Token.java:166)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$f617cf0a.signal(<generated>)
   at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:488)
   at org.alfresco.repo.workflow.jbpm.WorkflowTaskInstance.end(WorkflowTaskInstance.java:133)
   at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:427)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$26.doInJbpm(JBPMEngine.java:1687)
   at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:87)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
   at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:80)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1655)
   … 50 more
Caused by: Sourced file: inline evaluation of: ``               document.addAspect("lw:Aprobado");           ;'' : Attempt to resolve method: addAspect() on undefined variable or class name: document : at Line: 3 : in file: inline evaluation of: ``               document.addAspect("lw:Aprobado");           ;'' : document .addAspect ( "lw:Aprobado" )

   at bsh.UtilEvalError.toEvalError(Unknown Source)
   at bsh.UtilEvalError.toEvalError(Unknown Source)
   at bsh.BSHMethodInvocation.eval(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at org.jbpm.graph.action.Script.eval(Script.java:130)
   at org.jbpm.graph.action.Script.eval(Script.java:73)
   at org.jbpm.graph.action.Script.execute(Script.java:62)
   at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:264)
   … 101 more


No entiendo porque mete tantos espacios a la hora de mencionarme el metodo ..
Por cierto mil gracias Smiley Very Happy
venzia
Senior Member

Re: Script para ejecutar un Advanced Workflow

Esta claro que el objeto "document" no es valido en el contexto :
Attempt to resolve method: addAspect() on undefined variable or class name: document
Prueba esto mismo con lo de bpm_package a ver si cambia el error (por lo que me decias, ya lo habias probado).
Saludos,
universitario
Member II

Re: Script para ejecutar un Advanced Workflow

Hola,
He cambiado el script del workflow a esto:

<script>
      
      bpm_package.children[0].addAspect("lw:Aprobado");
      bpm_package.children[0].save();

</script>

y aquí el log:

18:49:06,859 INFO  [org.alfresco.config.SystemPropertiesFactoryBean] Loading properties file from class path resource [alfresco/domain/hibernate-cfg.properties]
18:49:06,861 INFO  [org.alfresco.config.SystemPropertiesFactoryBean] Loading properties file from class path resource [alfresco/extension/custom-hibernate-dialect.properties]
18:49:14,014 ERROR [org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformer] ImageMagickContentTransformer not available: Failed to perform ImageMagick transformation:
Execution result:
   os:         Linux
   command:    [./ImageMagick/bin/convert, /opt/Alfresco/apache-tomcat-5.5.28/temp/Alfresco/ImageMagickContentTransformer_init_source_3519122410552035978.gif[0], /opt/Alfresco/apache-tomcat-5.5.28/temp/Alfresco/ImageMagickContentTransformer_init_target_8114203818974708732.png]
   succeeded:  false
   exit code:  1
   out:       
   err:        Cannot run program "./ImageMagick/bin/convert": java.io.IOException: error=2, No such file or directory
18:49:15,629 INFO  [org.alfresco.config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
18:49:19,544 ERROR [org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer] Failed to start a runtime executable content transformer:
Execution result:
   os:         Linux
   command:    [./bin/pdf2swf, -V]
   succeeded:  false
   exit code:  1
   out:       
   err:        Cannot run program "./bin/pdf2swf": java.io.IOException: error=2, No such file or directory
18:49:24,534 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.
18:49:25,461 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] No changes were made to the schema.
18:49:26,113 DEBUG [org.alfresco.repo.avm.TransactionalLookupCache.init] preRegister called. Server=com.sun.jmx.mbeanserver.JmxMBeanServer@9bbe68, name=log4j:logger=org.alfresco.repo.avm.TransactionalLookupCache.init
18:49:26,140 DEBUG [org.alfresco.web.bean.TemplateMailHelperBean] preRegister called. Server=com.sun.jmx.mbeanserver.JmxMBeanServer@9bbe68, name=log4j:logger=org.alfresco.web.bean.TemplateMailHelperBean
18:49:27,955 INFO  [org.alfresco.repo.admin.ConfigurationChecker] The Alfresco root data directory ('dir.root') is: /opt/Alfresco/repositorio
18:49:28,029 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
18:49:28,200 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
18:49:28,205 INFO  [org.alfresco.repo.module.ModuleServiceImpl] Found 0 module(s).
18:49:33,368 ERROR [org.alfresco.fileserver] Failed to get local domain/workgroup name, using default of WORKGROUP
18:49:33,369 ERROR [org.alfresco.fileserver] (This may be due to firewall settings or incorrect <broadcast> setting)
18:49:33,638 WARN  [org.alfresco.util.OpenOfficeConnectionTester] An initial OpenOffice connection could not be established.
18:49:33,707 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.6.0_18-b07; maximum heap size 981,375MB
18:49:33,707 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco license: Enterprise - v3.1 granted to Intecna (does not expire)
18:49:33,708 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Enterprise): Current version 3.1.2 (390) schema 1011 - Installed version 3.1.2 (390) schema 1011
18:52:00,953 ERROR [org.jbpm.graph.def.GraphElement] action threw exception: Sourced file: inline evaluation of: ``               bpm_package.children[0].addAspect("lw:Aprobado");       bpm_package.children[ . . . '' : Property accessor threw exception: java.lang.NullPointerException
Sourced file: inline evaluation of: ``               bpm_package.children[0].addAspect("lw:Aprobado");       bpm_package.children[ . . . '' : Property accessor threw exception: java.lang.NullPointerException : at Line: 3 : in file: inline evaluation of: ``               bpm_package.children[0].addAspect("lw:Aprobado");       bpm_package.children[ . . . '' : bpm_package .children

   at bsh.UtilEvalError.toEvalError(Unknown Source)
   at bsh.UtilEvalError.toEvalError(Unknown Source)
   at bsh.BSHAmbiguousName.toObject(Unknown Source)
   at bsh.BSHAmbiguousName.toObject(Unknown Source)
   at bsh.BSHPrimarySuffix.doSuffix(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at org.jbpm.graph.action.Script.eval(Script.java:130)
   at org.jbpm.graph.action.Script.eval(Script.java:73)
   at org.jbpm.graph.action.Script.execute(Script.java:62)
   at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:264)
   at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
   at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
   at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
   at org.jbpm.graph.def.Transition.take(Transition.java:138)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:136)
   at org.jbpm.graph.node.Decision.execute(Decision.java:152)
   at org.jbpm.graph.def.Node.enter(Node.java:319)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$4dee9062.enter(<generated>)
   at org.jbpm.graph.def.Transition.take(Transition.java:151)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.def.Node.leave(Node.java:358)
   at org.jbpm.graph.node.Join.execute(Join.java:191)
   at org.jbpm.graph.def.Node.enter(Node.java:319)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$4dee9062.enter(<generated>)
   at org.jbpm.graph.def.Transition.take(Transition.java:151)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:209)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$883486ac.leave(<generated>)
   at org.jbpm.graph.exe.Token.signal(Token.java:195)
   at org.jbpm.graph.exe.Token.signal(Token.java:166)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$fa7d36f6.signal(<generated>)
   at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:488)
   at org.alfresco.repo.workflow.jbpm.WorkflowTaskInstance.end(WorkflowTaskInstance.java:133)
   at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:427)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$26.doInJbpm(JBPMEngine.java:1687)
   at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:87)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
   at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:80)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1655)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.endTask(WorkflowServiceImpl.java:544)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy52.endTask(Unknown Source)
   at org.alfresco.web.bean.workflow.ManageTaskDialog.transition(ManageTaskDialog.java:431)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Thread.java:619)
18:52:00,991 ERROR [org.alfresco.web.ui.common.Utils] A system error happened during the operation: Failed to signal transition 'approve' from workflow task 'jbpm$99'
org.alfresco.service.cmr.workflow.WorkflowException: Failed to signal transition 'approve' from workflow task 'jbpm$99'
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1702)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.endTask(WorkflowServiceImpl.java:544)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy52.endTask(Unknown Source)
   at org.alfresco.web.bean.workflow.ManageTaskDialog.transition(ManageTaskDialog.java:431)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Thread.java:619)
Caused by: org.jbpm.graph.def.DelegationException: Sourced file: inline evaluation of: ``               bpm_package.children[0].addAspect("lw:Aprobado");       bpm_package.children[ . . . '' : Property accessor threw exception: java.lang.NullPointerException
   at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:387)
   at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:378)
   at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:281)
   at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
   at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
   at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
   at org.jbpm.graph.def.Transition.take(Transition.java:138)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:136)
   at org.jbpm.graph.node.Decision.execute(Decision.java:152)
   at org.jbpm.graph.def.Node.enter(Node.java:319)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$4dee9062.enter(<generated>)
   at org.jbpm.graph.def.Transition.take(Transition.java:151)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.def.Node.leave(Node.java:358)
   at org.jbpm.graph.node.Join.execute(Join.java:191)
   at org.jbpm.graph.def.Node.enter(Node.java:319)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$4dee9062.enter(<generated>)
   at org.jbpm.graph.def.Transition.take(Transition.java:151)
   at org.jbpm.graph.def.Node.leave(Node.java:394)
   at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:209)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$883486ac.leave(<generated>)
   at org.jbpm.graph.exe.Token.signal(Token.java:195)
   at org.jbpm.graph.exe.Token.signal(Token.java:166)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
   at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$fa7d36f6.signal(<generated>)
   at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:488)
   at org.alfresco.repo.workflow.jbpm.WorkflowTaskInstance.end(WorkflowTaskInstance.java:133)
   at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:427)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$26.doInJbpm(JBPMEngine.java:1687)
   at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:87)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
   at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:80)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1655)
   … 50 more
Caused by: Sourced file: inline evaluation of: ``               bpm_package.children[0].addAspect("lw:Aprobado");       bpm_package.children[ . . . '' : Property accessor threw exception: java.lang.NullPointerException : at Line: 3 : in file: inline evaluation of: ``               bpm_package.children[0].addAspect("lw:Aprobado");       bpm_package.children[ . . . '' : bpm_package .children

   at bsh.UtilEvalError.toEvalError(Unknown Source)
   at bsh.UtilEvalError.toEvalError(Unknown Source)
   at bsh.BSHAmbiguousName.toObject(Unknown Source)
   at bsh.BSHAmbiguousName.toObject(Unknown Source)
   at bsh.BSHPrimarySuffix.doSuffix(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.BSHPrimaryExpression.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at bsh.Interpreter.eval(Unknown Source)
   at org.jbpm.graph.action.Script.eval(Script.java:130)
   at org.jbpm.graph.action.Script.eval(Script.java:73)
   at org.jbpm.graph.action.Script.execute(Script.java:62)
   at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:264)
   … 101 more

Y el error en el navegador sigue siendo el mismo
venzia
Senior Member

Re: Script para ejecutar un Advanced Workflow

Vale .. creo que ya se lo que pasa .. hay que declarar el action class como un AlfrescoJavaScript para que sepa que lo que metes es un JavaScript (logico no Smiley Surprisedops: ?).
Sacado del articulo de jeff potts http://ecmarchitect.com/images/articles/alfresco-workflow/advanced-workflow-article.pdf :
<transition name="transToReview" to="review">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var scAspectQName = "{http://www.someco.com/model/content/1.0}webable";
var addAspect = actions.create("addfeatures");
addAspect.parameters["aspectname"]
= scAspectQName;
for (var i = 0; i &lt; bpm_package.children.length; i++) {
if (!bpm_package.children[i].hasAspect(scAspectQName)) {
addAspect.execute(bpm_package.children[i]);
}
}
</script>
</action>
</transition>
Como ves te faltaria <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> (y el de cerrar </action> despues de </script> )
Prueba y nos dices.
Suerte!