AnsweredAssumed Answered

Advanced Workflow picking up wrong startTask metadata

Question asked by pmahoney on Jan 6, 2009
Latest reply on Jan 15, 2009 by pmahoney
I've been working through the Alfresco Developers Guide and have come unstuck in chaper 7 "Step-by-Step: Grabbing the Hello World Argument from the User"

This is where an Advances Workflow is set up with a start task configured to require a mandatory user name be entered through the UI. I have follwed the steps, just changing the namespace from scwf: to xactwf: and see no errors when deploying or opening the workflow. But when I try to run the workflow, the "Workflow Options" (Step 2) shows the workflow metadata for another workflow (Site Invite I think) and not mine.  :(  I've being stdying my config files all day and trying out ideas, but nothing works.

Can the team help?

xactWorkflowModel.xact

<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="xactwf:xactWorkflowModel"
   xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>X-Act Workflow Model</description>
   <author>Paul Mahoney</author>
   <version>1.0</version>

   <!– 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="http://www.xact.co.uk/model/workflow/1.0" prefix="xactwf" />
   </namespaces>

   <types>
      <type name="xactwf:submitHelloWorldTask">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="xactwf:helloName">
               <type>d:text</type>
               <mandatory>true</mandatory>
               <multiple>false</multiple>
            </property>
         </properties>
      </type>      
   </types>
</model>

xact-model-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>
    <!– Registration of new models –>
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/model/xactModel.xml</value>
                <value>alfresco/extension/model/xactWorkflowModel.xml</value>
            </list>
        </property>
    </bean>   

    <!– Registration of resource bundles –>
    <bean id="extension.workflowBootstrap" parent="workflowDeployer">
        <property name="labels">
            <list>
                <value>alfresco.extension.xactWorkflow</value>
            </list>
        </property>
    </bean>
</beans>

helloWorldUI/processdefinition.xml

<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="xactwf:helloWorldUI">
   <start-state name="start">
      <task name="xactwf:submitHelloWorldTask"></task>
      <transition name="" to="hello"></transition>
   </start-state>
   <node name="hello">
      <transition name="" to="end1">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               <variable name="xactwf_helloName" access="read"/>
               <expression>
                  logger.log("Hello, " +  xactwf_helloName + "!");
               </expression>
            </script>
         </action>      
      </transition>
   </node>
   <end-state name="end1"></end-state>
</process-definition>

Outcomes