This is the starting element containing one or more branches that will be executed as part of the workflow integration. Each Branch defines a stage of execution for the workflow.

<Branch>

This element is the basic workflow building block that enables you to group together other branches and actions. If no type is specified it will just pass the message from the message source to the child branches/actions contained within.

<Branch Name="CreateMagDelivery" B1TransactionType="A">

<Branch> Attributes

  • Name - Name describing the branch.
  • Type - Identifies the type of branch being used in the workflow section.
  • B1TransactionType - (optional) If this optional parameter is specified, then the workflow will only execute actions inside of the Branch if the transaction type equals the value specified. This is normally used with the WorkFlowEvent messages to trigger specific logic for adds vs updates.
  • SplitterXPath - (not yet implemented - optional) This defines the XPath into XML that will be used to split the data. This is an optional parameter that creates multiple messages from a message passed to the branch. Typically a splitter is used to break a large XML message into smaller transactional elements based on the specified XPath.

<Branch type=”Conditional”>

This element is a special kind of branch that allows for conditional checks to be performed before deciding which branches/actions to complete. The example below checks the existence of a BP record before requesting the information from Magento and creating a new Business Partner.

<Branch Name="ProcessBP" xsi:type="Conditional" TestValue="FALSE"  ElementName="RelatedInformation" ComparisonXpath="//B1BPLookup/querydata/data/row/EXISTS">
    <Actions>
        <Action xsi:type="B1Object" HaltOnFail="true" B1KeyXpath="xpath" Method="insert=" TransformRoot="MagentoCustomer" TransformXSLT="B1_CreateCustomer.xslt" B1ObjectType="oBusinessPartners"/>
    </Actions>
</Branch>

Attributes for Conditional Branches

  • TestValue - Defines the comparison value.</li>
  • ElementName - (optional) Set the starting XML element to simplify your comparison XPath. For example, set this value to RelatedInformation and all XPaths will be executed against that node.</li>
  • ComparisonXpath - Defines the XPath to the value inside the message XML for comparison with test value.