Sample Files for Material
Message that Contains a Material
Inbound messages are added to the integration database using Microsoft SQL.
Message that Contains a Material
INSERT INTO erp_integration_inbound_messages (Message_Type, Media_Type, Message, Inserted_By)
VALUES ('material', 'application/json', '{MMID}', '<user name>')
where {MMID} is a JSON document that specifies the material.
Material Master Import Document
A JSON material master import document (MMID) contains all the details of a material, including route and revision or segment definition. The MMID constitutes the body of the HTTP POST request of the ERP Import service, which posts the material to Plant Applications.
MMID
{
"schemaVersion" : 1,
"productionLines" : [ Test Line1],
"storageZone" : "Line1",
"storageUnit" : "unit1",
"material" : {
"productCode" : "Material demo 001",
"productDescription" : "Material import with json",
"productFamily" : "Automation_Products",
"propertyValues" : [ {
"propertyName" : "SERIALIZED",
"propertyValue" : "5"
}, {
"propertyName" : "ITEM_CREATION_DATE",
"propertyValue" : "2019-02-14T14:34:22.666Z"
}, {
"propertyName" : "ITEM_DRAWING",
"propertyValue" : "http://www/google.com/document1"
}, {
"propertyName" : "STORAGELOCATION",
"propertyValue" : "890"
} ]
}
}
B2MML File that Contains a Material
Instead of a JSON material master import document (MMID), you can send all the details of a work order, process order, or material in a B2MML file.
If you want to send a B2MML document, you must also provide an XSL file with the mapping details. The ERP Transformation service uses this XSL file to convert the B2MML document to a JSON file.
Special Character | Escape String |
---|---|
& | & |
< | < |
> | > |
“ | " |
‘ | ' |
B2MML File that Contains a Material
<?xml version="1.0"?>
<ProductInformation xmlns="http://www.wbf.org/xml/B2MML-V0401" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Extended="http://www.wbf.org/xml/B2MML-V0401-AllExtensions"><ID>Internal from MiddleWare</ID><Description>ITEM_MASTER</Description><Location><EquipmentID>C86</EquipmentID><EquipmentElementLevel>Site</EquipmentElementLevel></Location><PublishedDate>2016-04-06T12:43:56-04:00</PublishedDate><ProductDefinition><ID>105D6043P008</ID><Version>100</Version><Description>INDEX TUBE</Description><ProductSegment><ID>000</ID><Description>HEADER</Description><Parameter><ID>UNIT_OF_MEASURE</ID><Value><ValueString>EA</ValueString><DataType>string</DataType><UnitOfMeasure/></Value></Parameter><Parameter><ID>PRODUCT_CATEGORY</ID><Value><ValueString>Capacitor</ValueString><DataType>string</DataType><UnitOfMeasure/></Value></Parameter><Parameter><ID>SERIALIZED</ID><Value><ValueString>TRUE</ValueString><DataType>boolean</DataType><UnitOfMeasure/></Value></Parameter><Parameter><ID>REVISION_DATE</ID><Value><ValueString>2/20/2016 11:52:44 AM</ValueString><DataType>DateTime</DataType><UnitOfMeasure/></Value></Parameter><Parameter><ID>ITEM_CREATION_DATE</ID><Value><ValueString>2/19/2016 4:08:05 PM</ValueString><DataType>DateTime</DataType><UnitOfMeasure/></Value></Parameter><Parameter><ID>ITEM_DRAWING</ID><Value><ValueString>http://www/google.com/document1</ValueString><DataType>string</DataType><UnitOfMeasure/></Value><Description>Document 1</Description></Parameter><Parameter><ID>ITEM_DRAWING</ID><Value><ValueString>http://www/google.com/document2</ValueString><DataType>string</DataType><UnitOfMeasure/></Value><Description>Document 2</Description></Parameter><Parameter><ID>STORAGELOCATION</ID><Value><ValueString>STK</ValueString><DataType>string</DataType><UnitOfMeasure/></Value></Parameter><EquipmentSpecification><EquipmentId/><EquipmentSpecificationProperty><ID>ProductionLine</ID><Value><ValueString>Line1</ValueString></Value></EquipmentSpecificationProperty><EquipmentSpecificationProperty><ID>StorageZone</ID><Value><ValueString>StorageZone</ValueString></Value></EquipmentSpecificationProperty><EquipmentSpecificationProperty><ID>StorageUnit</ID><Value><ValueString>StorageUnit</ValueString></Value></EquipmentSpecificationProperty></EquipmentSpecification></ProductSegment></ProductDefinition></ProductInformation>
XSL File to Map a Material
This topic provides a sample XSL file that is used to map a material.
XSL File to Map a Material
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:h="http://www.wbf.org/xml/B2MML-V0401" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output indent="yes" method="xml" omit-xml-declaration="yes"/><xsl:strip-space elements="*"/><xsl:template match="/"><xsl:apply-templates select="h:ProductInformation"/></xsl:template><xsl:template match="h:ProductInformation"><ProductInformation><ID><xsl:value-of select="h:ID"/></ID><Description><xsl:value-of select="h:Description"/></Description><Location><EquipmentID><xsl:value-of select="h:Location/h:EquipmentID"/></EquipmentID><EquipmentElementLevel><xsl:value-of select="h:Location/h:EquipmentElementLevel"/></EquipmentElementLevel></Location><PublishedDate><xsl:value-of select="h:PublishedDate"/></PublishedDate><ProductDefinition><xsl:apply-templates select="h:ProductDefinition"/></ProductDefinition></ProductInformation></xsl:template><xsl:template match="h:ProductDefinition"><ID><xsl:value-of select="h:ID"/></ID><Version><xsl:value-of select="h:Version"/></Version><Description><xsl:value-of select="h:Description"/></Description><Location><EquipmentID/><EquipmentElementLevel/></Location><ProductProductionRule/><BillOfMaterialsID/><BillOfResourcesID/><ManufacturingBill><ID/><Description/><MaterialClassID/><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/></Quantity><BillOfMaterialID/></ManufacturingBill><ProductSegment><xsl:apply-templates select="h:ProductSegment"/></ProductSegment></xsl:template><xsl:template match="h:ProductSegment"><ID><xsl:value-of select="h:ID"/></ID><Description><xsl:value-of select="h:Description"/></Description><ProcessSegmentID/><xsl:for-each select="h:Parameter"><Parameter><ID>
<!--<xsl:value-of select="h:ID" /> -->
<xsl:apply-templates select="h:ID"/></ID><Value><ValueString><xsl:value-of select="h:Value/h:ValueString"/></ValueString><DataType><xsl:choose><xsl:when test="not(h:Value/h:DataType)"><xsl:text>string</xsl:text></xsl:when><xsl:otherwise><xsl:value-of select="h:Value/h:DataType"/></xsl:otherwise></xsl:choose></DataType><UnitOfMeasure/></Value><Description/></Parameter></xsl:for-each><PersonnelSpecification><PersonnelClassID/><PersonID/><Description/><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/></Quantity><PersonnelSpecificationProperty><ID/><Description/><Value><ValueString/><DataType>string</DataType><UnitOfMeasure> </UnitOfMeasure></Value><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/></Quantity></PersonnelSpecificationProperty></PersonnelSpecification><xsl:for-each select="h:EquipmentSpecification"><EquipmentSpecification><EquipmentClassID/><EquipmentID><xsl:value-of select="h:EquipmentId"/></EquipmentID><Description> </Description><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/></Quantity><xsl:for-each select="h:EquipmentSpecificationProperty"><EquipmentSpecificationProperty><ID><xsl:value-of select="h:ID"/></ID><Description/><Value><ValueString><xsl:value-of select="h:Value/h:ValueString"/></ValueString><DataType>string</DataType><UnitOfMeasure/></Value><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/><Key/></Quantity></EquipmentSpecificationProperty></xsl:for-each></EquipmentSpecification></xsl:for-each><MaterialSpecification><MaterialClassID/><MaterialDefinitionID/><Description/><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/></Quantity><MaterialSpecificationProperty><ID/><Description/><Value><ValueString/><DataType>string</DataType><UnitOfMeasure/></Value><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/></Quantity></MaterialSpecificationProperty></MaterialSpecification></xsl:template><xsl:template match="h:ID/text()[.='PRODUCT_CATEGORY']"> PRODUCT_FAMILY </xsl:template></xsl:stylesheet>
Standard B2MML File for a Material
This topic provides an example of a standard B2MML file that contains the details of a material.
Standard B2MML File for a Material
<?xml version="1.0"?>
<ProductInformation xmlns:h="http://www.wbf.org/xml/B2MML-V0401"><ID>Internal from MiddleWare</ID><Description>ITEM_MASTER</Description><Location><EquipmentID>C86</EquipmentID><EquipmentElementLevel>Site</EquipmentElementLevel></Location><PublishedDate>2016-04-06T12:43:56-04:00</PublishedDate><ProductDefinition><ID>105D6043P008</ID><Version>100</Version><Description>INDEX TUBE</Description><Location><EquipmentID/><EquipmentElementLevel/></Location><ProductProductionRule/><BillOfMaterialsID/><BillOfResourcesID/><ManufacturingBill><ID/><Description/><MaterialClassID/><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/></Quantity><BillOfMaterialID/></ManufacturingBill><ProductSegment><ID>000</ID><Description>HEADER</Description><ProcessSegmentID/><Parameter><ID>UNIT_OF_MEASURE</ID><Value><ValueString>EA</ValueString><DataType>string</DataType><UnitOfMeasure/></Value><Description/></Parameter><Parameter><ID>PRODUCT_FAMILY</ID><Value><ValueString>Capacitor</ValueString><DataType>string</DataType><UnitOfMeasure/></Value><Description/></Parameter><Parameter><ID>SERIALIZED</ID><Value><ValueString>TRUE</ValueString><DataType>boolean</DataType><UnitOfMeasure/></Value><Description/></Parameter><Parameter><ID>REVISION_DATE</ID><Value><ValueString>2/20/2016 11:52:44 AM</ValueString><DataType>DateTime</DataType><UnitOfMeasure/></Value><Description/></Parameter><Parameter><ID>ITEM_CREATION_DATE</ID><Value><ValueString>2/19/2016 4:08:05 PM</ValueString><DataType>DateTime</DataType><UnitOfMeasure/></Value><Description/></Parameter><Parameter><ID>ITEM_DRAWING</ID><Value><ValueString>http://www/google.com/document1</ValueString><DataType>string</DataType><UnitOfMeasure/></Value><Description/></Parameter><Parameter><ID>ITEM_DRAWING</ID><Value><ValueString>http://www/google.com/document2</ValueString><DataType>string</DataType><UnitOfMeasure/></Value><Description/></Parameter><Parameter><ID>STORAGELOCATION</ID><Value><ValueString>STK</ValueString><DataType>string</DataType><UnitOfMeasure/></Value><Description/></Parameter><PersonnelSpecification><PersonnelClassID/><PersonID/><Description/><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/></Quantity><PersonnelSpecificationProperty><ID/><Description/><Value><ValueString/><DataType>string</DataType><UnitOfMeasure/></Value><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/></Quantity></PersonnelSpecificationProperty></PersonnelSpecification><EquipmentSpecification><EquipmentClassID/><EquipmentID/><Description/><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/></Quantity><EquipmentSpecificationProperty><ID>ProductionLine</ID><Description/><Value><ValueString>Line1</ValueString><DataType>string</DataType><UnitOfMeasure/></Value><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/><Key/></Quantity></EquipmentSpecificationProperty><EquipmentSpecificationProperty><ID>StorageZone</ID><Description/><Value><ValueString>StorageZone</ValueString><DataType>string</DataType><UnitOfMeasure/></Value><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/><Key/></Quantity></EquipmentSpecificationProperty><EquipmentSpecificationProperty><ID>StorageUnit</ID><Description/><Value><ValueString>StorageUnit</ValueString><DataType>string</DataType><UnitOfMeasure/></Value><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/><Key/></Quantity></EquipmentSpecificationProperty></EquipmentSpecification><MaterialSpecification><MaterialClassID/><MaterialDefinitionID/><Description/><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/></Quantity><MaterialSpecificationProperty><ID/><Description/><Value><ValueString/><DataType>string</DataType><UnitOfMeasure/></Value><Quantity><QuantityString/><DataType>string</DataType><UnitOfMeasure/></Quantity></MaterialSpecificationProperty></MaterialSpecification></ProductSegment></ProductDefinition></ProductInformation>