Import Transactions

A ProcessEvents message with either a NotifyWorkExecutedEvent or NotifyWorkReconciledEvent node can be used to move bulk material in MineMarket:

  • From a mine source to a stockpile
  • From one stockpile to another stockpile
  • From a stockpile to a train, service trip or shipment (despatch loading)
  • From a train or service trip to a stockpile (despatch unloading)
  • From one train or service trip to another train, service trip or shipment (despatch direct loading)

Unloading shipments is not supported.

If the mine sources or stockpiles do not exist, they are created. The despatches must already exist in MineMarket.

To use this B2MML adaptor with stockpile to stockpile transactions, you must be familiar with the options specified in the transaction editor. The transaction editor specifies whether transactions are standard, by truck, or by truck type. This B2MML adaptor can only be used with standard transactions. The transaction editor may limit the available process flows and stockpiles.

To use this B2MML adaptor for despatches that are based on a despatch template, you must be familiar with the options specified in the template. The despatch template may limit the available unloading process flows and stockpiles.

Train templates specify whether loading and unloading is by rake or by wagon. This B2MML adaptor cannot be used for loading or unloading by wagon.

Note: Words in coloured text refer to node names in the XML file. Words in bold refer to field names or data in MineMarket, or required text strings. Words in italics refer to field values in MineMarket.

Subscriber Name

The subscriber name must be NotifyWorkExecutedEvent or NotifyWorkReconciledEvent.

Class Name

The class names are BulkTrak.Integration.PublishSubscribe.B2MML_Classes.NotifyWorkExecutedEvent and BulkTrak.Integration.PublishSubscribe.B2MML_Classes.NotifyWorkReconciledEvent. Either class can be used; however, only the NotifyWorkReconciledEvent can process multiple transactions in the one file.

XML Example

Note: The following example has been simplified from the original. The example shows a transaction from a train rake to a barge hold, with two samples.

Copy
<?xml version="1.0" encoding="UTF-8"?>
<p:NotifyWorkExecutedEvent xmlns:p="http://www.mesa.org/xml/B2MML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <p:ApplicationArea>
    <p:Sender>
      <p:LogicalID>PFPCS</p:LogicalID>
      <p:ComponentID>TGM1</p:ComponentID>
    </p:Sender>
    <p:CreationDateTime>2019-11-19T12:00:01Z</p:CreationDateTime>
  </p:ApplicationArea>
  <p:DataArea>
    <p:Notify />
    <p:WorkExecutedEvent>
      <p:ID>OPE201</p:ID>
      <p:HierarchyScope>
        <p:EquipmentID>BusinessAreaAlias1Segment</p:EquipmentID>
        <p:EquipmentLevel>Enterprise</p:EquipmentLevel>
        <p:HierarchyScopeChild>
          <p:EquipmentID>BusinessAreaAlias1Segment</p:EquipmentID>
          <p:EquipmentLevel>Site</p:EquipmentLevel>
        </p:HierarchyScopeChild>
      </p:HierarchyScope>
      <p:AddedJobResponseRecord recordTimestamp="2019-11-19T12:00:01Z">
        <p:JobResponse>
          <p:ID>TransactionAlias1</p:ID>
          <p:StartTime>2019-11-19T12:00:00Z</p:StartTime>
          <p:EndTime>2019-11-20T12:00:00Z</p:EndTime>
          <p:WorkMasterID>ProcessFlowAlias1</p:WorkMasterID>
          <p:EquipmentActual>
            <p:ID />
            <p:EquipmentClassID>Train</p:EquipmentClassID>
            <p:EquipmentID>TrainAlias1</p:EquipmentID>
            <p:EquipmentUse>Consumed</p:EquipmentUse>
            <p:HierarchyScope>
              <p:EquipmentID>RailSidingAlias1Segment</p:EquipmentID>
              <p:EquipmentLevel>Area</p:EquipmentLevel>
            </p:HierarchyScope>
          </p:EquipmentActual>
          <p:EquipmentActual>
            <p:ID />
            <p:EquipmentClassID>Barge</p:EquipmentClassID>
            <p:EquipmentID>ServiceTripAlias1</p:EquipmentID>
            <p:EquipmentUse>Produced</p:EquipmentUse>
            <p:HierarchyScope>
              <p:EquipmentID>BargeTerminalAlias1Segment</p:EquipmentID>
              <p:EquipmentLevel>Area</p:EquipmentLevel>
            </p:HierarchyScope>
          </p:EquipmentActual>
          <p:MaterialActual>
            <p:ID />
            <p:MaterialClassID>Product</p:MaterialClassID>
            <p:MaterialDefinitionID>Product On Rail</p:MaterialDefinitionID>
            <p:MaterialLotID>TrainRakeAlias1</p:MaterialLotID>
            <p:MaterialUse>Consumed</p:MaterialUse>
            <p:AssemblyActual>
              <p:ID />
              <p:AssemblyActual>
                <p:ID />
                <p:MaterialLotID>GACG7001</p:MaterialLotID>
              </p:AssemblyActual>
              <p:AssemblyType>Logical</p:AssemblyType>
              <p:AssemblyRelationship>Transient</p:AssemblyRelationship>
            </p:AssemblyActual>
             <p:StorageLocation>
               <p:Location>StockpileCategoryAlias1Segment</p:Location>
               <p:LocationType>Operational Location</p:LocationType>
             </p:StorageLocation>
            <p:HierarchyScope>
              <p:EquipmentID>RailSidingAlias1Segment</p:EquipmentID>
              <p:EquipmentLevel>Area</p:EquipmentLevel>
            </p:HierarchyScope>
          </p:MaterialActual>
          <p:MaterialActual>
            <p:ID />
            <p:MaterialClassID>Product</p:MaterialClassID>
            <p:MaterialDefinitionID>Product On Barge</p:MaterialDefinitionID>
            <p:MaterialLotID>ServiceTripAlias1BargeHoldAlias1Suffix</p:MaterialLotID>
            <p:MaterialUse>Produced</p:MaterialUse>
            <p:Quantity>
              <p:QuantityString>10500</p:QuantityString>
              <p:DataType>Numeric</p:DataType>
              <p:UnitOfMeasure>UOMAlias1</p:UnitOfMeasure>
              <p:Key>Mass</p:Key>
            </p:Quantity>
            <p:Quantity>
              <p:QuantityString>4230</p:QuantityString>
              <p:DataType>Numeric</p:DataType>
              <p:UnitOfMeasure>UOMAlias1</p:UnitOfMeasure>
              <p:Key>Volume</p:Key>
            </p:Quantity>
            <p:StorageLocation>
              <p:Location>StockpileCategoryAlias1Segment</p:Location>
              <p:LocationType>Operational Location</p:LocationType>
            </p:StorageLocation>
            <p:HierarchyScope>
              <p:EquipmentID>BargeTerminalAlias1Segment</p:EquipmentID>
              <p:EquipmentLevel>Area</p:EquipmentLevel>
            </p:HierarchyScope>
          </p:MaterialActual>
          <p:MaterialActual>
            <p:ID />
            <p:MaterialLotID>SampleAlias1Segment</p:MaterialLotID>
            <p:MaterialUse>Destructive Sample</p:MaterialUse>
            <p:HierarchyScope>
              <p:EquipmentID>LocationAlias1Segment</p:EquipmentID>
              <p:EquipmentLevel>Area</p:EquipmentLevel>
            </p:HierarchyScope>
            <p:TestResult>
              <p:ID />
              <p:OperationsTestRequirementID>SampleTemplateName</p:OperationsTestRequirementID>
              <p:PropertyMeasurement>
                <p:ID>AnalyteAlias1</p:ID>
                <p:MeasurementDate>2019-11-19T12:00:00Z</p:MeasurementDate>
                <p:Value>
                    <p:ValueString>0.1</p:ValueString>
                    <p:UnitOfMeasure>UOMAlias1</p:UnitOfMeasure>
                </p:Value>
              </p:PropertyMeasurement>
            </p:TestResult>
          </p:MaterialActual>
          <p:MaterialActual>
            <p:ID />
            <p:MaterialLotID>SampleAlias1Segment</p:MaterialLotID>
            <p:MaterialUse>Retained Sample</p:MaterialUse>
            <p:HierarchyScope>
              <p:EquipmentID>LocationAlias1Segment</p:EquipmentID>
              <p:EquipmentLevel>Area</p:EquipmentLevel>
            </p:HierarchyScope>
            <p:TestResult>
              <p:ID />
              <p:OperationsTestRequirementID>SampleTemplateName</p:OperationsTestRequirementID>
            </p:TestResult>
          </p:MaterialActual>
        </p:JobResponse>
      </p:AddedJobResponseRecord>
    </p:WorkExecutedEvent>
  </p:DataArea>
</p:NotifyWorkExecutedEvent>

XML Nodes: Header

Node and Path

Notes

ApplicationArea » CreationDateTime

If AddedJobResponseRecord does not include a timestamp, this time is saved in each transaction's extended data in the Date7 field.

If AddedJobResponseRecord does include a timestamp, this time is ignored in processing.

Note: If used, the time must be later than existing data in MineMarket. If the time is earlier than the Date7 field in the extended data of the transaction, no data is saved.

DataArea » WorkExecutedEvent » HierarchyScope » EquipmentID

(with EquipmentLevel set to "Enterprise" or "Site")

The Alias1 segment of an existing business area.

The applicable business area is the node most nested in the XML structure.

See notes below about Alias1 segments.

HierarchyScope » EquipmentID

(with EquipmentLevel set to "Area")

The Alias1 segment of an existing stock location or mine location in the applicable business area.

The applicable location is the node most nested in the XML structure.

See notes below about Alias1 segments.

DataArea » WorkExecutedEvent » AddedJobResponseRecord

The start node for the set of transactions. Can include a timestamp for the set of transactions.

If included, this timestamp is saved in each transaction's extended data in the Date7 field.

Note: The time must be later than existing data in MineMarket. If the time is earlier than the Date7 field in the extended data of the transaction, all data in this AddedJobResponseRecord node is ignored.

AddedJobResponseRecord » JobResponse

The start node for an individual transaction.

JobResponse » ID

The Alias1 of the transaction.

If a transaction with this Alias1 exists, it is updated. If the transaction does not exist, it is created.

Note: If the transaction exists, this B2MML adaptor can be used to change the source or destination of the transaction. This functionality is not possible using the MineMarket Client. If a new source or destination is specified, the transaction is removed from the previous despatch or location, and recreated on the new despatch or location.

JobResponse » StartTime

The Start Date of the transaction.

JobResponse » EndTime

The Transaction Date of the transaction.

Note: For a transaction to or from a stockpile, if the transaction date is earlier than the opening date or later than the closing date of the stockpile, the B2MML adaptor updates the opening or closing date of the stockpile.

Also used as the Sample Date for any new samples. For existing samples, the Sample Date is only updated if the EndTime is earlier than the current Sample Date.

JobResponse » WorkMasterID

The Alias1 of an existing process flow between the source and destination.

Note: If a process flow with this Alias1 does not exist, the process flow may be able to be inferred if there is a process flow between the locations of the source and destination. For stockpile to stockpile transactions, this process flow must be in a transaction editor. There should be only one transaction editor with this combination of process flow and allowed source and destination stockpiles. If there are multiple transaction editors with this combination, the first transaction editor is used.

XML Nodes: Despatch Identification

For direct despatch loading, there will be two EquipmentActual nodes with this structure: one for the source, and one for the destination.

Node and Path

Notes

JobResponse » EquipmentActual

The start node for information about the despatch.

Not applicable to stockpiles.

EquipmentActual » EquipmentClassID

A text string for the despatch type; which must be either "Train", "Barge" or "OGV" (case-insensitive).

Note: Similar EquipmentActual nodes with an EquipmentClassID of "Train Rake", "Barge Hold" or "OGV Hold" are ignored in processing. Rake and hold information is specified on the MaterialActual nodes.

EquipmentActual » EquipmentID

The Alias1 of an existing despatch.

Note: If a despatch of the specified type with this Alias1 does not exist, and the EquipmentUse is either "Consumed" or "Produced", the XML file is rejected.

EquipmentActual » EquipmentUse

A text string that should be one of the following words (case-sensitive):

  • "Consumed"—For a source despatch
  • "Produced"—For a destination despatch

Note: If a different text string is used, the EquipmentActual node is ignored, which may result in the whole message being ignored.

EquipmentActual » HierarchyScope

Ignored in processing.

XML Nodes: Transaction Source

A MaterialActual node is required for the transaction source, even if the source is a despatch.

Node and Path

Notes

JobResponse » MaterialActual

The start node for information about the source.

MaterialActual » MaterialClassID

A text string that must be the word "Product" (case-sensitive).

MaterialActual » MaterialDefinitionID

A text string with one of the following values (case-insensitive):

  • The words "Product On Rail"—For a train unloading transaction
  • The words "Product On Barge"—For a barge unloading transaction
  • Optional or any text string; for example, "Product", if the transaction is not a despatch unloading transaction.

Note: See Import Mine Sources for requirements for this node if the mine source is created when this message is processed.

MaterialActual » MaterialLotID

The Alias1 value of the source stockpile, mine source or existing train rake. For barge holds, see notes below about Alias1 segments.

Note:
• If the source stockpile does not exist, the stockpile is created in the stockpile category that is the most nested node in the XML structure of the StorageLocation. If the stockpile category does not already exist, the stockpile category is created. See notes below about Alias1 segments.
• If the mine source does not exist and the HierarchyScope includes an EquipmentID node that has the EquipmentLevel set to "Area", the mine source is created in the stockpile category that is the most nested node in the XML structure of the StorageLocation.
• If the source train rake, barge hold or shipment hold does not exist, the XML file is rejected.

MaterialActual » MaterialUse

A text string that must be the word "Consumed" (case-sensitive).

MaterialActual » AssemblyActual

Ignored in processing.

MaterialActual » StorageLocation The start node for the stockpile category.
MaterialActual » StorageLocation » Location

The Alias1 segment of a stockpile category. See notes below about Alias1 segments.

MaterialActual » StorageLocation » LocationType

If the text string value is "Operational Location" (case-insensitive), the node represents a stockpile category. Any other values are ignored in processing.

MaterialActual » StorageLocation » LocationChild The start node for a nested stockpile (sub)category.

MaterialActual » HierarchyScope

The start node for the location of the stockpile or despatch.

Ignored in processing if the source is a despatch.

MaterialActual » HierarchyScope » EquipmentID

(with EquipmentLevel set to "Area")

The Alias1 segment of a location. See notes below about Alias1 segments.

XML Nodes: Transaction Destination

A MaterialActual node is required for the transaction destination, even if the destination is a despatch.

Node and Path

Notes

JobResponse » MaterialActual

The start node for information about the destination.

MaterialActual » MaterialClassID

A text string that must be the word "Product" (case-sensitive).

MaterialActual » MaterialDefinitionID

A text string with one of the following values (case-insensitive):

  • The words "Product On Rail"—For a train loading transaction
  • The words "Product On Barge"—For a barge loading transaction
  • The words "Product On Ship" or "Bauxite Shipped"—For a shipment loading transaction
  • Optional or any text string; for example, "Product", if the transaction is not a despatch loading transaction.

MaterialActual » MaterialLotID

The Alias1 value of the destination stockpile or existing train rake. For barge and shipment holds, see notes below about Alias1 segments.

Note:
• If the destination stockpile does not exist, the stockpile is created in the stockpile category that is the most nested node in the XML structure of the StorageLocation. Existing stockpiles are moved if they were in a different stockpile category. If the stockpile category does not already exist, the stockpile category is created. See notes below about Alias1 segments.
• If the destination train rake, barge hold or shipment hold does not exist, the XML file is rejected.

MaterialActual » MaterialUse

A text string that must be the word "Produced" (case-sensitive).

MaterialActual » AssemblyActual

Ignored in processing.

MaterialActual » Quantity

The start node for the quantity of the transaction.

Note: Only one Quantity node with a Key of "Mass" can be in the MaterialActual node. A Quantity node with a Key of "Volume" is optional. Quantity nodes with other keys are ignored in processing.

MaterialActual » Quantity » QuantityString

If the Quantity node has a Key of "Mass", the quantity is saved as the numerical quantity of the transaction.

If the Quantity node has a Key of "Volume", the quantity is saved in the Double1 extended data field of the transaction.

MaterialActual » Quantity » DataType

A text string that must be the word "Numeric" (case-sensitive).

MaterialActual » Quantity » UnitOfMeasure

The Alias1 of the unit of measure for the quantity.

If not specified, tonnes is used.

MaterialActual » Quantity » Key

A text string that must be the word "Mass" (case-insensitive) for one MaterialActual node, and may be "Volume" for another node.

MaterialActual » StorageLocation The start node for the stockpile category.
MaterialActual » StorageLocation » Location

The Alias1 segment of a stockpile category. See notes below about Alias1 segments.

MaterialActual » StorageLocation » LocationType

If the text string value is "Operational Location" (case-insensitive), the node represents a stockpile category. Any other values are ignored in processing.

MaterialActual » StorageLocation » LocationChild The start node for a nested stockpile (sub)category.

MaterialActual » HierarchyScope

The start node for the location of the stockpile or despatch.

Ignored in processing if the destination is a despatch.

MaterialActual » HierarchyScope » EquipmentID

(with EquipmentLevel set to "Area")

The Alias1 segment of a location. See notes below about Alias1 segments.

XML Nodes: Transaction Sample (Optional)

Multiple nodes with this structure can be included. Each MaterialActual node corresponds to one or more samples, depending on the number of TestResult nodes.

Node and Path

Notes

JobResponse » MaterialActual

The start node for information about a sample assigned to the transaction.

Note: The Import Sample Results can be imported in the same or another XML file.

MaterialActual » MaterialLotID

The Alias1 segment of the sample.

If the sample does not exist, it is created and assigned to the transaction. The full Alias1 of the sample has the structure SampleTemplate_Sample_ProcessFlow; that is, (Test Result ») ID + "_" + MaterialLotID + "_" + WorkMasterID.

MaterialActual » MaterialUse

A text string that must include the word "Sample" (case-sensitive).

MaterialActual » HierarchyScope

Ignored in processing.

MaterialActual » TestResult » ID

Ignored in processing.

MaterialActual » TestResult » OperationsTestRequirementID

The Name of the sample template.

If multiple TestResult nodes are included, one sample is created for each sample template.

Note: If the sample template does not exist, the XML file is rejected.

MaterialActual » TestResult » PropertyMeasurement

The start node of zero or more property measurements associated with the sample.

MaterialActual » TestResult » PropertyMeasurement » ID

The Alias1 of an analyte.

MaterialActual » TestResult » PropertyMeasurement » MeasurementDate

An optional Date of measurement.

If this node is not included, the EndTime of the JobResponse is used.

MaterialActual » TestResult » PropertyMeasurement » Value » ValueString

The numerical result for the analyte.

MaterialActual » TestResult » PropertyMeasurement » Value » UnitOfMeasure

The Alias1 of a unit of measure (UOM).

This UOM must match the UOM associated with the analyte.

Notes and Troubleshooting

Nodes not described in the table above do not correspond to MineMarket data and are ignored in processing.

Multiple instances of nodes (with their sub-nodes) can exist within the one file:

  • Multiple JobResponse nodes: For importing multiple transactions within a set of transactions, but only if using the NotifyWorkReconciledEvent class.
  • Multiple MaterialActual nodes if there are multiple samples for a transaction.
  • Multiple PropertyMeasurement nodes if there are multiple measurements for a sample.

When the B2MML adaptor processes the XML file, if one transaction causes an error, no transactions are saved.

Alias1 Segments

The Alias1 segments in the XML file are concatenated in MineMarket.

For example, in the definition of the location, note the Alias1 concatenation:

<p:HierarchyScope>
  <p:EquipmentID>Company</p:EquipmentID> (Alias1: Company)
  <p:EquipmentLevel>Enterprise</p:EquipmentLevel>
  <p:HierarchyScopeChild>
    <p:EquipmentID>Orminejo Mine</p:EquipmentID> (Alias1: Company_Orminejo Mine)
    <p:EquipmentLevel>Site</p:EquipmentLevel>
    <p:HierarchyScopeChild>
      <p:EquipmentID>Mining Area</p:EquipmentID> (Alias1: Company_Orminejo Mine_Mining Area)
      <p:EquipmentLevel>Area</p:EquipmentLevel>

Note: Nested HierarchyScope nodes are called HierarchyScopeChild.

Following on from the example above, in the stockpile category hierarchy definition, note the Alias 1 concatenation:

<p:StorageLocation>
  <p:Location>ROM Pads</p:Location> (Alias1: Company_Orminejo Mine_Mining Area_ROM Pads)
  <p:LocationType>Operational Location</p:LocationType>

The Alias1 of a new stockpile category has the structure LocationAlias1_(StorageLocation)Location. The Alias1 of a new stockpile subcategory has the structure ParentStockpileCategoryAlias1_(LocationChild)Location. The name of the new stockpile subcategory is LocationChildLocation.

Note: Nested Location nodes are called LocationChild.

For barge holds, the MaterialLotID must be a concatenation of the Alias1 of the service trip plus the suffix in the Alias1 of the hold of the assigned barge. For example, a service trip has an Alias1 of OV0073_B12. The assigned barge has an Alias1 of ALM_Aquarius. The barge hold has an Alias1 of ALM_Aquarius_01. The MaterialLotID for the service trip barge hold is OV0073_B12_01. If all barge Alias1 values have this suffix structure, a different barge can be assigned to the service trip without needing to change the value for the MaterialLotID.

For shipment holds, the MaterialLotID must be a concatenation of the Alias1 of the shipment plus the suffix in the Alias1 of the hold of the assigned vessel. For example, a shipment has an Alias1 of OV0074. The assigned vessel has an Alias1 of MV_Sunrise. The vessel hold has an Alias1 of MV_Sunrise_01. The MaterialLotID for the shipment hold is OV0074_01. If all vessel Alias1 values have this suffix structure, a different vessel can be assigned to the shipment without needing to change the value for the MaterialLotID.