Configure ERP Integration

Configure ERP Integration

The following table provides the sequence of steps that you must perform to configure ERP integration. You must provide your UAA credentials to perform these steps.
Step NumberDescriptionNotes
1Provide mapping details of a work order, process order, or material.This step is required if the work order, process order, or material details are stored in a B2MML or XML file. It is used by the ERP Transformation service to convert the file to a JSON file.
2Connect to the ERP Integration database by configuring the database settings, and insert records.This step is required. After the integration, work orders, process orders, and materials are automatically imported to the ERP Integration database.
3Configure the ERP Scheduler service parameters.This step is optional. It is used to change the default value of the time interval at which the ERP Scheduler service polls the ERP Integration database.
4Configure the ERP Import service parameters.This step is optional. It is used to change the default values of parameters used in the service (such as names of property categories and groups).

Provide Mapping Details

About This Task

If you want to send work order, process order, or material details in a B2MML or an XML file, you must map the fields using an XSL document. When you install Plant Applications, a default XSL file is provided. The supported XSL version is 1.0.

Procedure

  1. Create an XSL file.
    Tip: Create the XSL file based on the standard B2MML or XML file that you want to create. You can also refer to the sample files in the Reference section.
  2. Access the [erp].[MappingSpecification] table of the Microsoft SQL database, and perform the following steps as applicable:
    • If you want to provide the mapping details for a work order, replace the following xml code with the xml code from the XSL file that you have created.
      IF EXISTS (Select 1 from [erp].[MappingSpecification] where Resource_Type = 'WorkOrder')
      BEGIN
             UPDATE [erp].[MappingSpecification] 
             SET Specification = '<?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
          <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:template match="@* | node()">
          <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
          </xsl:copy>
        </xsl:template>
      </xsl:stylesheet>'
             where  Resource_Type = 'WorkOrder'
      END
      ELSE 
      BEGIN
             INSERT  INTO [erp].[MappingSpecification] (Specification, Resource_Type)
             VALUES 
             ('<?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
          <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:template match="@* | node()">
          <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
          </xsl:copy>
        </xsl:template>
      </xsl:stylesheet>', 'WorkOrder')
      END
      
    • If you want to provide the mapping details for a process order, replace the following xml code with the xml code from the XSL file that you have created.
      IF EXISTS (Select 1 from [erp].[MappingSpecification] where Resource_Type = 'ProcessOrder')
      BEGIN
             UPDATE [erp].[MappingSpecification] 
             SET Specification = '<?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
          <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:template match="@* | node()">
          <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
          </xsl:copy>
        </xsl:template>
      </xsl:stylesheet>'
             where  Resource_Type = 'ProcessOrder'
      END
      ELSE 
      BEGIN
             INSERT  INTO [erp].[MappingSpecification] (Specification, Resource_Type)
             VALUES 
             ('<?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
          <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:template match="@* | node()">
          <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
          </xsl:copy>
        </xsl:template>
      </xsl:stylesheet>', 'ProcessOrder')
      END
      
    • If you want to provide the mapping details for a material, replace the following xml code with the xml code from the XSL file that you have created.
      IF EXISTS (Select 1 from [erp].[MappingSpecification] where Resource_Type = 'Material')
      BEGIN
             UPDATE [erp].[MappingSpecification] 
             SET Specification = '<?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
          <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:template match="@* | node()">
          <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
          </xsl:copy>
        </xsl:template>
      </xsl:stylesheet>'
             where  Resource_Type = 'Material'
      END
      ELSE 
      BEGIN
             INSERT  INTO [erp].[MappingSpecification] (Specification, Resource_Type)
             VALUES 
             ('<?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
          <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:template match="@* | node()">
          <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
          </xsl:copy>
        </xsl:template>
      </xsl:stylesheet>', 'Material')
      END
      
  3. Run the script.

Results

When you send a B2MML or XML file, it is converted to a JSON file by the ERP Transformation service using the mapping you have specified, and then imported to Plant Applications.

ERP Integration Database Settings

You must connect the ERP system with the ERP Integration database for work order, process order, and material records to be imported automatically into the ERP Integration database. These records are stored in the erp_integration_inbound_messages table.

Refer to your ERP integration system implementation guide for details on connecting to the integration database. Provide the following details when you integrate the ERP system with the ERP Integration database:
  • Database: Microsoft SQL Server 2016
  • Default name: SOADB
  • Schema name: erp
  • Default schema: erp

Configuration Parameters in the ERP Scheduler Service

You can configure the following parameters in the ERP Scheduler service.
ParameterDescription
erp.scheduler.service.importJobPoll.millisecondsThe interval (in milliseconds) at which the ERP Schedule service polls the ERP Integration database for new inbound messages. The default value is 30000.
erp.scheduler.service.importJobStatusPoll.millisecondsThe interval (in milliseconds) at which the ERP Schedule service polls the ERP Integration database for in-process messages. The default value is 30000.

Configuration Parameters in the ERP Import Service

You can configure the following parameters in the ERP Import service.
Note: Before you configure the parameters related to custom property groups and categories, you must create them in Plant Applications. The maximum number of properties that you can create per property group is 2000. For more information, refer to Property Definition.
ParameterDescription
Workorder_post_delete_delayThe duration after which importing a work order of the same name will replace the existing work order.
Note: This parameter is applicable only for importing work orders.
Workorder_property_category_nameThe name of the category to which property groups belong. The default value is Route_Workorder_Category.
Workorder_property_group_nameThe name of the group to which work order properties belong. The default value is Route_Workorder_Group.
Material_property_category_nameThe name of the category to which material property groups belong. The default value is Route_Material_Category.
Material_property_group_nameThe name of the group to which material properties belong. The default value is Route_Material_Group.
maximumCacheSizeThe maximum number of entries that the cache can contain. The default value is 100.
cacheExpireAfterWrite
Specifies that each entry be removed from the cache after a fixed duration after one of the following events occur:
  • The entry has been created.
  • The latest value of the entry has been updated.

The default value is 5 minutes.