cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced Workflow picking up wrong startTask metadata

pmahoney
Champ in-the-making
Champ in-the-making
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.  Smiley Sad  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>
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
Paul,

Thanks for reading. Your model and process definition look okay to me. I noticed in your spring config you are using extension.bootstrap. Could it be that you've got another spring config somewhere (or in an AMP) that also uses extension.bootstrap and is therefore overwriting your model change?

You probably want to use "xact.dictionaryBootstrap" and "xact.workflowBootstrap" instead of "extension." to keep that from happening.

Another thought is, have you used the workflow console to verify that the version of the process definition you think is deployed is actually the one that got deployed?

Jeff

pmahoney
Champ in-the-making
Champ in-the-making
Found the problem. I had not added the following to alfresco/extension/web-client-config-custom.xml


<!–  workflow property sheets –>
<config evaluator="node-type" condition="xactwf:submitHelloWorldTask" replace="true">
   <property-sheet>
      <show-property name="xactwf:helloName" />
   </property-sheet>
</config>