no consigo ejecutar codigo en workflow

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

no consigo ejecutar codigo en workflow

Buenas, estoy intentando que al realizar alguno de los pasos dentro del workflow review, por ejemplo al crearlo, o al aprobarlo
me asigne el valor de una property personalizada que me he creado en un tipo, pero no consigo hacerlo.
Alguien sabe como y en que sitio exactamente hay que ponerel código para se ejecute correctamente?

esto es lo que estoy poniendo en el review_processdefinition.xml



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

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

    <swimlane name="initiator" />

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

    <swimlane name="reviewer">
        <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{bpm_assignee}</actor>
        </assignment>   
    </swimlane>

    <task-node name="review">
        <task name="wf:reviewTask" swimlane="reviewer">
            <event type="task-create">
                <script>
            document.properties["my:dedonde"]="valorquequieroasignaralcrearelflujo";
            document.save();

                    if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
                    if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
                </script>
            </event>
        </task>
        <transition name="reject" to="rejected" />
        <transition name="approve" to="approved" />
    </task-node>

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

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

    <end-state name="end" />

</process-definition>


Gracias y saludos
22 Replies
pjcaracuel_2349
Active Member II

Re: no consigo ejecutar codigo en workflow

Puedes poster el contenido de alfresco.log para ver el error?

Gracias
giorgio
Member II

Re: no consigo ejecutar codigo en workflow

Es que no hay error en el log de alfresco, parece que esta bien puesto, pero no hace nada, no asigna el valor y tampoco parece que tire error por ningun sitio.
pjcaracuel_2349
Active Member II

Re: no consigo ejecutar codigo en workflow

Pues, entonces puedes postear el modelo donde has definido el siguiente tipo:metadato
"my:dedonde"

Saludos
giorgio
Member II

Re: no consigo ejecutar codigo en workflow

Puede que sea porque en este caso no incluyo este codigo, que es como se explica en la wiki que se hace :http://wiki.alfresco.com/wiki/WorkflowAdministration#Actions_.26_Scripting


<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
  <script>
    // some alfresco javascript
  </script>
</action>


Pero es que este código no te dice en que fichero o en que punto del fichero hay que meterlo. y yo he probado a meterlo despues de esta linea
<transition name="reject" to="rejected" />
y si lo pongo aqui, pega petardazo que ni siquiera arranca el alfresco porque dice que no puede compilar ese codigo


Saludos.
pjcaracuel_2349
Active Member II

Re: no consigo ejecutar codigo en workflow

Buenas,

Prueba esto

<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
    <script>
        <expression>
bpm_package.children[0].properties["my:dedonde"] = "valorquequieroasignaralcrearelflujo";
bpm_package.children[0].save();
        </expression>
    </script>
</action>

Debes de incluirlo dentro del nodotal como por ejemplo
<task-node name="ValidationTask">
  <transition name="reject" to="end">
   <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
    <script>
        <expression>
bpm_package.children[0].properties["my:dedonde"] = "valorquequieroasignaralcrearelflujo";
bpm_package.children[0].save();
        </expression>
    </script>
</action>
  </transition>
</task-node>
giorgio
Member II

Re: no consigo ejecutar codigo en workflow

Pues, entonces puedes postear el modelo donde has definido el siguiente tipo:metadato
"my:dedonde"

Saludos


aqui está

   <types>
  
      <!– Definition of new Content Type: Standard Operating Procedure –>
      <type name="my:not">
         <title>Nota Interna</title>
         <parent>cm:content</parent>
         <properties>
            <property name="my:publishedDate">
               <type>d:datetime</type>
            </property>
            <property name="my:authorisedBy">
               <type>d:text</type>
            </property>
            <property name="my:dedonde">
               <type>d:text</type>
      <mandatory>true</mandatory>
            </property>
            <property name="my:haciadonde">
               <type>d:text</type>
      <mandatory>true</mandatory>
            </property>
            <property name="my:prioridad">
               <type>d:text</type>
            </property>
            <property name="my:estado">
               <type>d:text</type>
            </property>
            <property name="my:tecnico">
               <type>d:text</type>
            </property>
         </properties>
      </type>

Saludos y gracias
giorgio
Member II

Re: no consigo ejecutar codigo en workflow

Si, asi es com lo incluia, y de ese modo no me arrancaba el alfresco, de todas formas voy a probarlo de nuevo con tu codigo y tal a ver.

Muchas gracias por todo y me asombra tu rapidez en contestar, saludos.
giorgio
Member II

Re: no consigo ejecutar codigo en workflow

Mira probando tu codigo en la posicion que me has comentado obtengo este log de alfresco

org.alfresco.error.AlfrescoRuntimeException: Workflow deployment failed
   at org.alfresco.repo.workflow.WorkflowDeployer.init(WorkflowDeployer.java:324)
   at org.alfresco.repo.workflow.WorkflowDeployer$1.doWork(WorkflowDeployer.java:431)
   at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:437)
   at org.alfresco.repo.workflow.WorkflowDeployer.onBootstrap(WorkflowDeployer.java:427)
   at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
   at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
   at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
   at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
   at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:448)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
   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:585)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: org.alfresco.service.cmr.workflow.WorkflowException: Failed to determine if workflow definition is already deployed
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.isDefinitionDeployed(JBPMEngine.java:353)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.isDefinitionDeployed(WorkflowServiceImpl.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:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   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:166)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy51.isDefinitionDeployed(Unknown Source)
   at org.alfresco.repo.workflow.WorkflowDeployer.init(WorkflowDeployer.java:287)
   … 36 more
Caused by: org.jbpm.JbpmException: Failed to parse process definition from jBPM xml stream
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.compileProcessDefinition(JBPMEngine.java:1822)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$2.doInJbpm(JBPMEngine.java:342)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$2.doInJbpm(JBPMEngine.java:339)
   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.isDefinitionDeployed(JBPMEngine.java:337)
   … 56 more
Caused by: org.jbpm.jpdl.JpdlException: [[ERROR] line 32: cvc-complex-type.2.4.a: Invalid content was found starting with element 'action'. One of '{"urn:jbpm.org:jpdl-3.1":task, "urn:jbpm.org:jpdl-3.1":event, "urn:jbpm.org:jpdl-3.1":exception-handler, "urn:jbpm.org:jpdl-3.1":timer, "urn:jbpm.org:jpdl-3.1":transition}' is expected., [WARNING] swimlane 'initiator' does not have an assignment]
   at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:172)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.compileProcessDefinition(JBPMEngine.java:1817)
   … 63 more
08:51:22,829 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/alfresco]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.alfresco.error.AlfrescoRuntimeException: Workflow deployment failed
   at org.alfresco.repo.workflow.WorkflowDeployer.init(WorkflowDeployer.java:324)
   at org.alfresco.repo.workflow.WorkflowDeployer$1.doWork(WorkflowDeployer.java:431)
   at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:437)
   at org.alfresco.repo.workflow.WorkflowDeployer.onBootstrap(WorkflowDeployer.java:427)
   at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
   at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
   at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
   at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
   at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:448)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
   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:585)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: org.alfresco.service.cmr.workflow.WorkflowException: Failed to determine if workflow definition is already deployed
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.isDefinitionDeployed(JBPMEngine.java:353)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.isDefinitionDeployed(WorkflowServiceImpl.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:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   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:166)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy51.isDefinitionDeployed(Unknown Source)
   at org.alfresco.repo.workflow.WorkflowDeployer.init(WorkflowDeployer.java:287)
   … 36 more
Caused by: org.jbpm.JbpmException: Failed to parse process definition from jBPM xml stream
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.compileProcessDefinition(JBPMEngine.java:1822)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$2.doInJbpm(JBPMEngine.java:342)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$2.doInJbpm(JBPMEngine.java:339)
   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.isDefinitionDeployed(JBPMEngine.java:337)
   … 56 more
Caused by: org.jbpm.jpdl.JpdlException: [[ERROR] line 32: cvc-complex-type.2.4.a: Invalid content was found starting with element 'action'. One of '{"urn:jbpm.org:jpdl-3.1":task, "urn:jbpm.org:jpdl-3.1":event, "urn:jbpm.org:jpdl-3.1":exception-handler, "urn:jbpm.org:jpdl-3.1":timer, "urn:jbpm.org:jpdl-3.1":transition}' is expected., [WARNING] swimlane 'initiator' does not have an assignment]
   at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:172)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.compileProcessDefinition(JBPMEngine.java:1817)
   … 63 more
08:51:22,831 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/alfresco]] Exception sending context initialized event to listener instance of class org.alfresco.web.app.ContextListener
org.alfresco.error.AlfrescoRuntimeException: Workflow deployment failed
   at org.alfresco.repo.workflow.WorkflowDeployer.init(WorkflowDeployer.java:324)
   at org.alfresco.repo.workflow.WorkflowDeployer$1.doWork(WorkflowDeployer.java:431)
   at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:437)
   at org.alfresco.repo.workflow.WorkflowDeployer.onBootstrap(WorkflowDeployer.java:427)
   at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
   at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
   at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
   at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
   at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:448)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
   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:585)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: org.alfresco.service.cmr.workflow.WorkflowException: Failed to determine if workflow definition is already deployed
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.isDefinitionDeployed(JBPMEngine.java:353)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.isDefinitionDeployed(WorkflowServiceImpl.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:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   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:166)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy51.isDefinitionDeployed(Unknown Source)
   at org.alfresco.repo.workflow.WorkflowDeployer.init(WorkflowDeployer.java:287)
   … 36 more
Caused by: org.jbpm.JbpmException: Failed to parse process definition from jBPM xml stream
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.compileProcessDefinition(JBPMEngine.java:1822)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$2.doInJbpm(JBPMEngine.java:342)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$2.doInJbpm(JBPMEngine.java:339)
   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.isDefinitionDeployed(JBPMEngine.java:337)
   … 56 more
Caused by: org.jbpm.jpdl.JpdlException: [[ERROR] line 32: cvc-complex-type.2.4.a: Invalid content was found starting with element 'action'. One of '{"urn:jbpm.org:jpdl-3.1":task, "urn:jbpm.org:jpdl-3.1":event, "urn:jbpm.org:jpdl-3.1":exception-handler, "urn:jbpm.org:jpdl-3.1":timer, "urn:jbpm.org:jpdl-3.1":transition}' is expected., [WARNING] swimlane 'initiator' does not have an assignment]
   at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:172)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.compileProcessDefinition(JBPMEngine.java:1817)
   … 63 more
pjcaracuel_2349
Active Member II

Re: no consigo ejecutar codigo en workflow

Bueno, entiendo que eso no es problema del codigo que has puesto sino de la definicion del modelo….

Mira los siguientes errores que esta escupiendo el log

Caused by: org.alfresco.service.cmr.workflow.WorkflowException: Failed to determine if workflow definition is already deployed

Caused by: org.jbpm.JbpmException: Failed to parse process definition from jBPM xml stream

Caused by: org.jbpm.jpdl.JpdlException: [[ERROR] line 32: cvc-complex-type.2.4.a: Invalid content was found starting with element 'action'. One of '{"urn:jbpm.org:jpdl-3.1":task, "urn:jbpm.org:jpdl-3.1":event, "urn:jbpm.org:jpdl-3.1":exception-handler, "urn:jbpm.org:jpdl-3.1":timer, "urn:jbpm.org:jpdl-3.1":transition}' is expected., [WARNING] swimlane 'initiator' does not have an assignment]

Saludos