<Activity Id="waitCheck" Name="Approve Order">
                    <Description>A clerk accepts and approves/declines the demo</Description>
                    <Limit>12</Limit>
                    <Implementation>
                      <No/>
                    </Implementation>
                    <Performer>clerk</Performer>
                    <StartMode>
                        <Manual/>
                    </StartMode>
                    <FinishMode>
                        <Manual/>
                    </FinishMode>
                    <Priority>5</Priority>                    
                    <TransitionRestrictions>
                        <TransitionRestriction>
                            <Join Type="XOR"/>
                            <Split Type="XOR"/>
                        </TransitionRestriction>
                    </TransitionRestrictions>
                    <ExtendedAttributes>
                        <ExtendedAttribute Name="canStart" Value="N"/>
                        <ExtendedAttribute Name="limitAfterStart" Value="N"/>
                        <!--<ExtendedAttribute Name="limitService" Value="sendProcessNotification"/>-->                        
                        <ExtendedAttribute Name="inheritPriority" Value="Y"/>
                    </ExtendedAttributes>
                </Activity>
                
                <Activity Id="notifyPrimaryLeader" Name="Notify Primary Leader">
                    <Description>notify primary leader</Description>
                    <Limit>3</Limit>
                    <Implementation>
                     <!-- change the order status -->
                       <Tool Id="notifyPrimaryLeader" Type="PROCEDURE">
                            <ExtendedAttributes>                       
                                <ExtendedAttribute Name="serviceName" Value="notifyPrimaryLeader"/>                              
                                <ExtendedAttribute Name="runAsUser" Value="admin"/>
                            </ExtendedAttributes>
                        </Tool>                                                                      
                        <!-- email customer with the status change 
                        <Tool Id="emailOrderStatus" Type="PROCEDURE">
                            <ActualParameters>
                                <ActualParameter>orderId</ActualParameter>
                            </ActualParameters>
                        </Tool> -->                                    
                    </Implementation>
                    <Performer>admin</Performer>
                    <StartMode>
                        <Automatic/>
                    </StartMode>
                    <FinishMode>
                        <Automatic/>
                    </FinishMode>
                    <Priority>1</Priority>                    
                    <TransitionRestrictions>
                        <TransitionRestriction>
                            <Join Type="XOR"/>
                            <Split Type="XOR"/>
                        </TransitionRestriction>
                    </TransitionRestrictions>
                    <ExtendedAttributes>
                        <ExtendedAttribute Name="canStart" Value="N"/>
                    </ExtendedAttributes>
                </Activity>      
                          
                <Activity Id="waitVerity" Name="wait leader verity">
                    <Description>wait leader verity</Description>
                    <Limit>10</Limit>   
                    <Implementation>
                      <No/>
                    </Implementation>                 
                    <Performer>clerk</Performer>
                    <StartMode>
                        <Manual/>
                    </StartMode>
                    <FinishMode>
                        <Manual/>
                    </FinishMode>
                    <Priority>5</Priority>                    
                    <TransitionRestrictions>
                        <TransitionRestriction>
                            <Join Type="XOR"/>
                            <Split Type="XOR"/>
                        </TransitionRestriction>
                    </TransitionRestrictions>
                    <ExtendedAttributes>
                        <ExtendedAttribute Name="canStart" Value="N"/>
                    </ExtendedAttributes>
                </Activity>
                
                <Activity Id="notifyManager" Name="Notify Manager">
                    <Description>notify manager</Description>
                    <Limit>1</Limit>
                    <Implementation>             
                        <!-- change the order status -->
                        <Tool Id="notifyManager" Type="PROCEDURE">   
                            <ExtendedAttributes>                     
                                <ExtendedAttribute Name="serviceName" Value="notifyManager"/>                              
                                <ExtendedAttribute Name="runAsUser" Value="admin"/>
                            </ExtendedAttributes>
                        </Tool>                         
                        <!-- email customer with the status change 
                        <Tool Id="emailOrderStatus" Type="PROCEDURE">
                            <ActualParameters>
                                <ActualParameter>orderId</ActualParameter>
                            </ActualParameters>
                        </Tool> -->                                                                            
                    </Implementation>
                    <Performer>admin</Performer>
                    <StartMode>
                        <Automatic/>
                    </StartMode>
                    <FinishMode>
                        <Automatic/>
                    </FinishMode>
                    <Priority>5</Priority>                    
                    <TransitionRestrictions>
                        <TransitionRestriction>
                            <Join Type="XOR"/>
                            <Split Type="XOR"/>
                        </TransitionRestriction>
                    </TransitionRestrictions>
                    <ExtendedAttributes>
                        <ExtendedAttribute Name="canStart" Value="N"/>
                    </ExtendedAttributes>
                </Activity>
              </Activities> 
                                         

解决方案 »

  1.   

    <Transitions>
                    <Transition Id="trans1.0" From="startDemoWorkflow" To="waitCheck" Loop="NOLOOP" Name="Goto Demo Approve">
                        <Condition Type="CONDITION"><![CDATA[documentStatusId.equals("RUNNING")]]></Condition>                                                          
                    </Transition> 
                    <Transition Id="trans1.1" From="startDemoWorkflow" To="demoNotReady" Loop="NOLOOP" Name="Demo not ready for processing">
                        <Condition Type="OTHERWISE"/>                     
                    </Transition>                                  
                                                                                                               
                    <Transition Id="trans2.0" From="waitCheck" To="notifyPrimaryLeader" Loop="NOLOOP" Name="notify leader">
                        <Condition Type="CONDITION"><![CDATA[flag.equals("2")]]></Condition>      
                    </Transition>
                                       <Transition Id="trans3.0" From="notifyPrimaryLeader" To="waitVerity" Loop="NOLOOP" Name="wait verity">
                        <Condition Type="OTHERWISE"/>
                    </Transition>    
                                    
                    <Transition Id="trans4.0" From="waitVerity" To="notifyManager" Loop="NOLOOP" Name="Notify Manager">
                        <Condition Type="CONDITION"><![CDATA[approvalCode.equals("success")]]></Condition>     
                    </Transition>                         
                    
                                                                 
                    
                    <Transition Id="trans5.0" From="demoNotReady" To="waitCheck" Loop="NOLOOP" Name="Goto demo Approve">
                        <Condition Type="CONDITION"><![CDATA[documentStatusId.equals("RUNNING")]]></Condition>                                                                                 
                    </Transition>  
                    <Transition Id="trans5.1" From="demoNotReady" To="startDemoWorkflow" Loop="NOLOOP" Name="demo not ready for processing">
                        <Condition Type="OTHERWISE"/>                     
                    </Transition>                                                                    
                </Transitions>
                
                <ExtendedAttributes>            
                 <ExtendedAttribute Name="sourceReferenceField" Value="documentId"/>            
                </ExtendedAttributes>
            </WorkflowProcess>    </WorkflowProcesses></Package>错误是:
    The following occurred:
    Could not parse XML (invalid?) (The up in the document preceding the root element must be well-formed.) org.ofbiz.core.workflow.definition.DefinitionParserException: Could not parse XML (invalid?) (The up in the document preceding the root element must be well-formed.)