AnsweredAssumed Answered

Model workflow, DictionaryException

Question asked by cytrix on May 27, 2009
Latest reply on May 27, 2009 by jayjayecl
Hi,

I have a problem with my advanced workflow model.
When I start tomcat, i have a DictionaryException (namespace problem ?).

My workflow model :

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

<model name="alwf:myModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Imports are required to allow references to definitions in other models –>
   <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" />
   </imports>
   
   <!– Introduction of new namespaces defined by this model –>
   <namespaces>
      <namespace uri="alfresco.extension.workflows.validation-fic2-process" prefix="alwf" />
   </namespaces>

   <types>

      <type name="alwf:submitDemandeCreationTask">
         <parent>bpm:startTask</parent>
      </type>
      
      <type name="alwf:redaction">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageActionGroup">
                     <default>add_package_item_actions</default>
               </property>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>
      
      <type name="alwf:managerRelecture">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>read_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="alwf:directeurValidation">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>read_package_item_actions</default>
            </property>
         </overrides>
      </type>

   </types>

</model>

And the exception :

10:03:59,835 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in class path resource [alfresco/workflow-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/alwf_validation_fic2Model.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/alwf_validation_fic2Model.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(DictionaryBootstrap.java:147)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:108)
   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.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1240)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
   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:3843)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
   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:525)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
   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:516)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
   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:288)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Failed to compile model alwf:myModel
   at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:112)
   at org.alfresco.repo.dictionary.M2Model.compile(M2Model.java:134)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModel(DictionaryDAOImpl.java:217)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(DictionaryBootstrap.java:143)
   … 42 more
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Found duplicate property override definition bpm:packageActionGroup within class alwf:redaction
   at org.alfresco.repo.dictionary.M2ClassDefinition.<init>(M2ClassDefinition.java:154)
   at org.alfresco.repo.dictionary.M2TypeDefinition.<init>(M2TypeDefinition.java:47)
   at org.alfresco.repo.dictionary.CompiledModel.constructDefinitions(CompiledModel.java:153)
   at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:94)
   … 45 more

The processdefinition workflow :

<?xml version="1.0" encoding="utf-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1"
   name="alwf:validation_fic2">
   
   <!– processus start, creation des variables –>
   <start-state name="start">
      <task name="alwf:submitDemandeCreationTask" swimlane="initiator" />
         <transition name="" to="Redaction"></transition>
         <event type="node-leave">
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>
                  <variable name="groupe_fic2" access="write">
                     <expression>people.getGroup('GROUP_fic2');</expression>
                  </variable>
               </script>
            </action>
         </event>
   </start-state>
   
   <!– Definition des swimlanes –>
   <swimlane name="initiator">
   </swimlane>
   <swimlane name="redacteur">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <pooledactors>#{groupe_fic2}</pooledactors>
         </assignment>
   </swimlane>
   <swimlane name="directeur1">
      <assignment actor-id="directeur" />
   </swimlane>
   
   <!– Définition du processus –>
   <task-node name="Redaction">
      <task name="alwf:redaction" swimlane="redacteur"/>
      <transition name="demande de relecture" to="Manager relecture"></transition>
   </task-node>
   
   <task-node name="Manager relecture">
      <task name="alwf:managerRelecture" swimlane="initiator"/>
      <transition name="Demande de validation directeur" to="Validation directeur"/>
         <transition name="demande de modification" to="Redaction"></transition>
   </task-node>
   
   <task-node name="Validation directeur">
      <task name="alwf:directeurValidation" swimlane="directeur1"/>
      <transition name="validation" to="end1" />
   </task-node>
   
   <!– fin –>
   <end-state name="end1" />
   
</process-definition>

Thanks for your help !

Outcomes