Workflow Tasks - XML Files


Overview

XML Workflow Tasks in MachShip provide powerful mapping capabilities for importing XML-formatted consignment data. This feature allows you to create custom mappings between your XML structure and MachShip's fields, supporting complex hierarchical data and transformations.

Key Features:

  • XML node path mapping
  • Array handling
  • Data transformation
  • Validation controls
  • Error management

Configuration

Basic Setup

  1. Access Workflow Tasks

    • Navigate to AdminOther Options
    • Select Workflow Task
  2. Create New Task

    • Click Create Workflow Task
    • Enter required information:
      • Name
      • Abbreviation
      • Company
      • Workflow Task Type (Consignment Importer)
      • Mapping Type (XML File Mapper)
  3. Enable Configuration

    • Set "Is Enabled" to Yes
    • Configure inheritance if needed
    • Set up email notifications

Property Mapping

Define XML to MachShip field mappings:

  1. Click Add Property Map Option
  2. Configure each mapping:
    • Select Location type
    • Choose Mapping Target
    • Specify XML node path
    • Set additional options

XML Node References

Node Path Syntax

  • Basic Path: Consignment.Sender.Company
  • Array Access: Consignment.Sender.AddressLine[0]
  • Multiple Nodes: Use index for repeated elements

Common Patterns

  1. Single Value

    <Consignment>
     <Reference>12345</Reference>
    </Consignment>

    Path: Consignment.Reference

  2. Nested Value

    <Consignment>
     <Sender>
       <Company>ACME</Company>
     </Sender>
    </Consignment>

    Path: Consignment.Sender.Company

  3. Array Elements

    <Consignment>
     <Sender>
       <AddressLine>Line 1</AddressLine>
       <AddressLine>Line 2</AddressLine>
     </Sender>
    </Consignment>

    Paths:

    • Line 1: Consignment.Sender.AddressLine[0]
    • Line 2: Consignment.Sender.AddressLine[1]

Required Fields

Essential fields for consignment creation:

  1. Location Information (one set required):

    • From/To Location Name
    • OR Complete address details
  2. Item Details (one set required):

    • Item SKU for saved items
    • OR Complete item specifications
  3. Optional but Recommended:

    • Carrier information
    • Reference numbers
    • Contact details

Advanced Features

  1. Date Formatting

    <DespatchDate>30/12/2023</DespatchDate>
    • Specify format (dd/MM/yyyy or MM/dd/yyyy)
    • Handle multiple date formats
    • Default to current date
  2. Constant Values

    • Set default carrier
    • Define standard service levels
    • Apply company-wide references
  3. Pattern Replacement

    • Transform carrier names
    • Standardize references
    • Clean data during import

Examples

Basic Consignment XML

<?xml version="1.0" encoding="utf-8"?>
<Consignment>
  <Sender>
    <Company>ACME</Company>
    <AddressLine>Main office</AddressLine>
    <AddressLine>123 Business St</AddressLine>
    <Suburb>Melbourne</Suburb>
    <Postcode>3000</Postcode>
    <Contact>John Smith</Contact>
    <Phone>0412345678</Phone>
    <Email>john@acme.com</Email>
  </Sender>
  <DespatchDate>30/12/2023</DespatchDate>
  <Reference>123456789</Reference>
  <Package>
    <Reference>SKU1234</Reference>
    <Length>100</Length>
    <Width>60</Width>
    <Height>10</Height>
    <Weight>10</Weight>
    <Quantity>1</Quantity>
  </Package>
</Consignment>

Property Mapping Examples

  1. Company Mapping

    Target: From Company
    Location: Body
    Map From: Consignment.Sender.Company
  2. Address Mapping

    Target: From Address Line 1
    Location: Body
    Map From: Consignment.Sender.AddressLine[0]
  3. Package Mapping

    Target: Item Length
    Location: Body
    Map From: Consignment.Package.Length

Best Practices

  1. XML Structure

    • Use consistent node naming
    • Maintain clear hierarchy
    • Include all required fields
  2. Node References

    • Use correct array indexing
    • Verify node paths
    • Handle optional nodes
  3. Data Validation

    • Validate XML schema
    • Check required fields
    • Verify data formats
  4. Error Handling

    • Monitor import logs
    • Review error notifications
    • Maintain error documentation
  5. Performance

    • Optimize XML structure
    • Minimize nested levels
    • Use appropriate data types