AnsweredAssumed Answered

workflow deployment failed

Question asked by kay_be_ on Jan 6, 2012
Latest reply on Sep 17, 2014 by ranaakkoub
Alfresco 3.4.d with jbpm definition and model.
Using the book Alfresco professional I'm trying to import an custom workflowmodel.

After defining the processdefinition I create the model
<?xml version="1.0" encoding="UTF-8"?>
<model name="wf:myReviewAndApproveModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>Example Review And Approve Task Model</description>
   <author>Alfresco</author>
   <version>1.0</version>
   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />
      <import uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf" />
   </imports>
   <types>
      <type name="wf:mySubmitReviewTask">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>
      <type name="wf:myReviewTask">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="wf:myCompleteReviewTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>
   </types>
</model>

I register this model in myWorkflowBootstrap-outline-context.xml:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE beans PUBLIC
'-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
   <bean id="myworkflows.workflowBootstrap" parent="workflowDeployer">
      <property name="models">
         <list>
            <!– Task Model associated with above process definition –>
            <value>alfresco/extension/workflow/myReviewAndApproveModel.xml</value>
         </list>
      </property>
      <property name="workflowDefinitions">
         <list>
            <props>
               <prop key="engineId">jbpm</prop>
               <prop key="location">
                  alfresco/extension/workflow/my_outline_review_and_approve_processdefinition.xml
               </prop>
               <prop key="mimetype">text/xml</prop>
               <prop key="redeploy">true</prop>
            </props>
         </list>
      </property>
   </bean>
</beans>

After restarting tomcat I receice errorpage 404 and the alfresco.log states:
16:34:40,228 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.alfresco.error.AlfrescoRuntimeException: 00060003 Workflow deployment failed
   at org.alfresco.repo.workflow.WorkflowDeployer.init(WorkflowDeployer.java:330)
   at org.alfresco.repo.workflow.WorkflowDeployer$1.doWork(WorkflowDeployer.java:437)
   at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
   at org.alfresco.repo.workflow.WorkflowDeployer.onBootstrap(WorkflowDeployer.java:433)
   at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
   at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:78)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:294)
   at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:858)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:419)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
   at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
   at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
   at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:519)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
   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.catalina.startup.Bootstrap.start(Bootstrap.java:289)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 00060002 Could not import bootstrap model alfresco/extension/workflow/myReviewAndApproveModel.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:158)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:105)
   at org.alfresco.repo.workflow.WorkflowDeployer.init(WorkflowDeployer.java:260)
   … 37 more
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 00060001 Failed to compile model wf:myReviewAndApproveModel
   at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:106)
   at org.alfresco.repo.dictionary.M2Model.compile(M2Model.java:128)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModel(DictionaryDAOImpl.java:270)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:154)
   … 39 more
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 00060000 Cannot define class wf:mySubmitReviewTask as namespace http://www.alfresco.org/model/workflow/1.0 is not defined by model wf:myReviewAndApproveModel
   at org.alfresco.repo.dictionary.M2ClassDefinition.<init>(M2ClassDefinition.java:88)
   at org.alfresco.repo.dictionary.M2TypeDefinition.<init>(M2TypeDefinition.java:41)
   at org.alfresco.repo.dictionary.CompiledModel.constructDefinitions(CompiledModel.java:147)
   at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:88)
   … 42 more

I follow the book but something is wrong. I'm searching for hours. It had something to do with "Cannot define class wf:mySubmitReviewTask as namespace http://www.alfresco.org/model/workflow/1.0 is not defined by model wf:myReviewAndApproveModel" but I don't get it.

What went wrong and how can it be solved?

I appreciate your help

Regards
Kris

Outcomes