Showing posts with label Integration. Show all posts
Showing posts with label Integration. Show all posts

Dec 26, 2022

Upload a document to Infor IDM using Infor ION

You will find many posts/videos about this topic, but I intend to guide you step-by-step with more information to comprehend and also refer to this faster in your future need. You can comment on any improvements, bugs, and thoughts to get me motivated.  

This post is based on an actual requirement from my current project with Infor M3 13.4. I’m explaining the general concept aiding with my actual requirement in the project.

The Context


A User or any application in an on-premise environment needs to archive files with Infor IDM. As you are aware we can use Infor Enterprise Connector to establish a secure connection between the two environments. Explaining Enterprise Connector is out of this post and you can find more information here.  

In the actual scenario, after archiving

  1. The users want to search the archived files related to the SBU/DIVI, the Business Process (User, Application, process, etc.), and the upload date. 
  2. Purge files after a predefined retention time. 

We can facilitate these requirements using Infor IDM very easily.

Prerequisites in Infor IDM. 

Document Types

Note: To create a Document Type in IDM you need to be in the IDM-Administrator role. 

For this example, I created a Document Type with the following information.  For more information refer to the Infor IDM Guide.


Tab Field Value
  Display Name/Name BDX_FR_FILE

Document title Filename
  Rest of the Fields Keet Default values
     
Attributes SBU  
  Display Name SBU
  Data Type String
  Max. Length 3
  Other Single-value, Required
     
  UploadDate  
  Display Name UploadDate
  Data Type Date
  Other Single-value, Required
     
ACL Public (for this example)  

ION IDM API

We have the Infor ION APIs suite to integrate with Infor IDM.  The suite has a bunch of Apis but for this example, we are using only Add item API. The body parameter in the API is used to send the document types information along with the file name and file content (as bast64 string). 


The Solution

We will be creating Infor ION Document Flow to 
  1. Read the file from the location.
  2. Enrich the BOD with the necessary information for Infor IDM.
  3. Call the Infor IDM Items (to Add an item).
Login to the ION Desk. 

Configure the file location and the document (BOD)

  1. Create a File Template.
    1. Go to Connect-> File Template -> Add
    2. Add the following Information.
    3. Field Value Remark
      Name  BDX_FR_FILE_SOURCE
       
      File Type
      Binary
      Fields Format Type, Document ID Filed Name and Raw Data Field Name will automatically fill and will be added to the BOD.
      File Name Attribute FileName
      Will be added to the BOD.
      File Extension Attribute FileExtension
      Will be added to the BOD.
      File Path FilePath Will be added to the BOD.
      Document
      FRRAWDATA
      Give any meaningful name. A custom BOD will be created using this name.
    4. Save the Information.
    5. Select GENERATE METADATA. This is will create the required Custom BOD to use in the rest of the data flow.
    6. Click Yes, in the popup to accept that we are sure to generate the document with provided Document ID.
  2. Create a connection point to the File folder (refer to the context diagram above), using Enterprise Connector (EC). 
    1. Go to Connect-> Connection Points -> Add -> File 
    2. Add the following information. 
    3. Tab/ Group Field Value Remark
      Name BDX_FRFileLocation  
        Location Related Enterprise Location Please check with your System Admin to get the EC data.
      Connection Tab Transfer Protocol Shared Folder  
          Provide necessary information Host Name, User name, and Password fields  
      Document Tab Add a Scenario Click on the + icon  
        Scenario Select Read a File from a folder  
      Document Tab / File Format Template & Document Settings File Format Template BDX_FR_FILE_SOURCE Select the File Template to create in Step 1.
        Document Noun   Automatically selected.
        Document Verb Select Sync  
      Document Tab / Read File Settings Create non-existing folder(s) Tick On  
        Read Location FR_File_In Substitute your actual folder paths without the hostname only the shared folder path. For sub-folders separate with “/” as an e.g. FR_File_In/FR_File_Error.
        Error Location FR_File_In/FR_File_Error  
        Archive Location FR_File_In/FR_File_Arc  
        File Name pattern .csv Specify any pattern you need. To accept all the files in the read location you can set this as *.*.
    4. Keep the rest of the settings as it is. 
    5. Click on TEST. If all is good, subfolders will be created in the shared location.
Your final settings should look similar to the following screenshot. 

Configure the Infor IDM API Connection 

  1. Go to Connect -> Connection Points-> Add -> API.
  2. Name it BDX_FR_IDM.
  3. In the Connection, tab import the legit service account.
    1. Please contact your System Admin to get the Service Account file, which contains the Access Key, Secret Key, Description, and User Name.
  4. Go to the Documents Tab and click on the + icon to add ION API.
  5. Select Send to API option in the Scenario section as we need to post data.
  6. Select the Input Document tab.
  7. From the Document dropdown select Sync.FRRAWDATA.
  8. Select the ION API tab, enter IDM_FR_UPD as API Call Name
  9. Click on the Select button.
  10. In the Search ION API Operation dialog select Document Management as Product.
  11. Then search and select Add an Item (POST, IDM/api/items)
  12. Click OK to close the popup
  13. Click on the Request Body tab.
  14. Tick on in the Map input document to API request check box.
  15. From the Format dropdown select application/xml. Because we using Sync.FRRAWDATA BOD.
  16. In the Body EXAMPLE text box add this API Payload.  Tip: You can get the payload from Infor IDM API Suite. 
  17. Then save all the changes we made. 
  18. You can test the API by pasting the below Sync.FRRAWDATA BOD   into the Message Content of the Test ION API Call popup.

Create the Document Flow

We are going to create a very simple Document flow as follows.

  1. Go to Connect -> Data Flows -> Document Flow.
  2. Name it BDX_FR_IDM_UPD.
  3. Drag and drop the File activity to the canvas and change properties as follows.
    Property 
    Value
    Remark
    Name
    FRSourceFile  
    File Connector
    BDX_FRFileLocation
    Hit the New button to create a new file connector and the Details button to review the settings of the selected connector. 
  4. Select the File Icon after the File connector we just created and add the document by selecting FRRAWDATA from the Add Documents popup.
  5. Before calling the IDM API, we have to combine the two attributes FileName and FileExtenstion of FRRAWDATA element in the Sync.FRRAWDATA. Drag and drop the Script Activity after the File, to enrich the BOD. Alternatively, you can use the Mapping activity where the Script is not available. I will discuss it in Appendix 2.
  6. Change the Script Activity Properties as follows.
    Tab Property Value Remark
    Properties Name ChangeFileName_IDM
    Script Change_File_Name_IDM Refer to the Script section below for creation.
    Document Mapping Input Document Sync.FRRAWDATA
    Output Document Sync.FRRAWDATA Click on the Magnifier Glass icon in the Output Document column and select.
    Input Parameters Name input_var_1
    Input Input Document Content
    Output
    Document Script Parameter output_var_1
    Header Script Parameter From Input Document
  7. Drag and drop API Activity after the Script.
  8. Change the properties as follows.
    Property Value Remark
    Name IDM_AddFile
    Select ION API Connector BDX_FR_IDM
  9. Activate the Document Flow.
  10. Integration is ready to test.

Appendix 1

Sync.FRRAWDATA BOD structure

The BOD structure generated from Infor ION is as follows.

Tip: Note the FRRAWDATA (line number 19) complex element in the BOD. It generated the attributes and subelements as we instructed when creating the file template.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<SyncFRRAWDATA releaseID="9.2">
	<ApplicationArea>
		<Sender>
			<LogicalID> </LogicalID>
			<ComponentID>External</ComponentID>
			<ConfirmationCode>OnError</ConfirmationCode>
		</Sender>
		<CreationDateTime>2022-12-25T10:09:11.997Z</CreationDateTime>
		<BODID> </BODID>
	</ApplicationArea>
	<DataArea>
		<Sync>
			<AccountingEntityID/>
			<LocationID/>
			<ActionCriteria>
				<ActionExpression actionCode="Replace"/>
			</ActionCriteria>
		</Sync>
		<FRRAWDATA FileName="File name" FileExtension="csv" FilePath="FR_File_In">
			<DocumentID>RD-954584925-1670321351981</DocumentID>
			<RawData>UmVhZCBwb3N0cyBmcm9tIGh0dHBzOi8vd2FybmFqaXRoLmJsb2dzcG90LmNvbS8gYW5kIGh0dHBzOi8vd2FybmFqaXRoLndvcmRwcmVzcy5jb20v<RawData>
		</FRRAWDATA>
	</DataArea>
</SyncFRRAWDATA>
 

Infor IDM Api payload

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<item xmlns="http://infor.com/daf">
	<attrs>
		<attr>
			<name>SBU</name>
			<value>SBU1</value>
		</attr>
	<attr>
			<name>UpdalodDate</name>
			<value><IonApiRef>SyncFRRAWDATA/ApplicationArea/CreationDateTime</IonApiRef></value>
		</attr>
	</attrs>
	<resrs>
		<res>
			<filename><IonApiRef>SyncFRRAWDATA/DataArea/FRRAWDATA/@FileName</IonApiRef></filename>
			<base64><IonApiRef>SyncFRRAWDATA/DataArea/FRRAWDATA/RawData</IonApiRef></base64>
		</res>
	</resrs>
	<acl>
		<name>Public</name>
	</acl>
	<entityName>BDX_FR_FILE</entityName>
</item>

Tip: 
  • Line numbers 2 to11: There are two <attr> occurrences because we defined two mandatory attributes in the IDM Document Type.
  • <IonAPiRef> is used to map the respective BOD element or attribute.
  • Line Number 21<entityName> is the name of the IDM Document Type.

Appendix 2

Steps to create the Python script

  1. Go to Scripting - > Scripts -> Add.
  2. Change the Name to Change_File_Name_IDM.
  3. Add the following script.
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    from xml.etree import ElementTree as etree
     
    tree =  etree.fromstring(input_var_1)
    
    for node in tree.getiterator():
       
        if node.tag == 'FRRAWDATA':
             
           fn = node.attrib.get('FileName')
           fe = node.attrib.get('FileExtension')
           n_fn = fn +'.'+ fe
           node.attrib['FileName'] =n_fn
           
    root = tree
    #print (etree.tostring(root,encoding='UTF-8', method='xml', short_empty_elements=True))
    decoded = etree.tostring(root,encoding='UTF-8', method='xml', short_empty_elements=True)
    output_var_1 = decoded
    
  4. In the Property section, under the Input and Output select Edit. In the popup add the variable below. Click Update to close the popup. 
    Direction Variable Name Data Type
    Input Variables input_var_1 String
    Output Variables ouput_var_1 String


  5. And test the script by copying the same Sync.FRRAWDATA into the input_var_1. If all is well, you can see now FileName attribute includes the file extension. 
  6. Then go back to the Script home dashboard and approve the script. 

Using Mapping Activity instead of Script

  1. Go to Connect -> Mappings -> Add -> Graphical Mapping.
  2. Name the map Map_IDMFileNameChange.
  3. Select Sync.FRRAWDATA for both Source and Target.
  4. In the Modeler tab, drag Sync.FRRAWDATA element from the source and drop it onto the Sync.FRRAWDATA in the target. Then mapper will connect other elements. 


  5. Go to the XSLT Editor. Remove the highlighted code line. When you try to change it, the editor will ask you want to switch to editing mode. Click on Yes.


  6. Paste the below code into the removed line. Note line number 12 which concatenates both file name and extension.
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    <xsl:copy-of select="/*:SyncFRRAWDATA/*:ApplicationArea" copy-namespaces="no"/>
    <xsl:if test="/*:SyncFRRAWDATA/*:DataArea">
    	<xsl:element name="DataArea">
    		<xsl:copy-of select="/*:SyncFRRAWDATA/*:DataArea/*:Sync" copy-namespaces="no"/>
    		<xsl:element name="FRRAWDATA">
    			<xsl:if test="/*:SyncFRRAWDATA/*:DataArea/*:FRRAWDATA/@FileExtension">
    				<xsl:attribute name="FileExtension">
    					<xsl:value-of select="/*:SyncFRRAWDATA/*:DataArea/*:FRRAWDATA/@FileExtension"/>
    				</xsl:attribute>
    			</xsl:if>
    			<xsl:attribute name="FileName">
    				<xsl:value-of select="fn:concat(/*:SyncFRRAWDATA/*:DataArea/*:FRRAWDATA/@FileName,'.',/*:SyncFRRAWDATA/*:DataArea/*:FRRAWDATA/@FileExtension)"/>
    			</xsl:attribute>
    			<xsl:if test="/*:SyncFRRAWDATA/*:DataArea/*:FRRAWDATA/@FilePath">
    				<xsl:attribute name="FilePath">
    					<xsl:value-of select="/*:SyncFRRAWDATA/*:DataArea/*:FRRAWDATA/@FilePath"/>
    				</xsl:attribute>
    			</xsl:if>
    			<xsl:if test="/*:SyncFRRAWDATA/*:DataArea/*:FRRAWDATA/*:DocumentID">
    				<xsl:element name="DocumentID">
    					<xsl:value-of select="/*:SyncFRRAWDATA/*:DataArea/*:FRRAWDATA/*:DocumentID/text()"/>
    				</xsl:element>
    			</xsl:if>
    			<xsl:if test="/*:SyncFRRAWDATA/*:DataArea/*:FRRAWDATA/*:RawData">
    				<xsl:element name="RawData">
    					<xsl:value-of select="/*:SyncFRRAWDATA/*:DataArea/*:FRRAWDATA/*:RawData/text()"/>
    				</xsl:element>
    			</xsl:if>
    		</xsl:element>
    		<xsl:value-of select="/*:SyncFRRAWDATA/*:DataArea/text()"/>
    	</xsl:element>
    </xsl:if>
    
  7. Click on Validate to check errors. 
  8. Test the XSLT to make sure we can see the File name with the extension. 


Jan 28, 2021

How to remove the Header row of a CSV file (Infor MEC/IEC)

Integrating CSV files with MEC is a very old but frequently used method. A CSV file may have a header and the data as in the below format. If we use this file (converting FLAT To XML) directly as it is, it will feed the data with the header. In this post, I'm going to share one of the possible methods to get rid of the CSV header.

FACI,PRDCT,MO,OPERNO,MANUQTY
A01,Y3003-Y01-010,3000018,10,2
A01,Y3003-Y01-010,3000018,50,2

Using the Flat file definition tool I will define the following structure.


Then I will get the following XML message into the MEC process.

<WORKBOOK>
	<ManuObj>
		<FACI>FACI</FACI>
		<PRDCT>Product</PRDCT>
		<MO>MO</MO>
		<OPRNO>Operation No</OPRNO>
		<MANUQTY>ManuQty</MANUQTY>
	</ManuObj>
	<ManuObj>
		<FACI>A01</FACI>
		<PRDCT>Y3001-Y02-016</PRDCT>
		<MO>0003000164</MO>
		<OPRNO>0010</OPRNO>
		<MANUQTY>1</MANUQTY>
	</ManuObj>
	<ManuObj>
		<FACI>A01</FACI>
		<PRDCT>Y3001-Y02-016</PRDCT>
		<MO>0003000164</MO>
		<OPRNO>0040</OPRNO>
		<MANUQTY>1</MANUQTY>
	</ManuObj>
</WORKBOOK>

You can notice the XML message contains the header. To get rid of the header one method is;
  1. Read all the XML elements into a Java array in the Mapper.
  2. Then process the data from the first position of the Array (remember 0th position will have the header segment).
But here I will show you a different method that is using XSLT transformation. Very easy.

Steps are:

  1.  Define the XLST definition. You can reuse this definition with two small modifications. Change the "WORKBOOK" value in <xsl:element name="WORKBOOK"> to the root element of your XML message. The change the xpath of  <xsl:copy-of select=""/> to match your respetive xpath.

    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    version="1.0">
    	<xsl:output indent="yes"/>
    	<xsl:template match="/">
    		<xsl:element name="WORKBOOK">
    			<xsl:copy-of select="WORKBOOK/ManuObj[position()>1]"/>
    		</xsl:element>
    	</xsl:template>
    </xsl:stylesheet>
    
  2. Go to the Partner Admin, Manage->XSLT Definitions..,  create the new XSLT Definition.
  3. Go the Process tab in your Partner Admin. Right click and select XSL Transform.

  4. Select the XSLT definition you created in Step 2.


  5. Make sure XSL Transform process step will be after the FLAT To XML process step in the process tab and Save. (You can add XML Transform after the XSL Transform to implement the logic, transformation you want).




  6. Test the process and see messages in Admin page. 

     Happy Coding.

Sep 5, 2016

MEC: How to Set Message Counter for EDI Message


When you sending/creating EDI messages it is necessary to include unique message interchange number. This is to ensure each message that we are sending is unique.

In EANCOM/EDIFACT

Element 0020 of UNB segment:
UNB+UNOA:4+xxxxxxx:14+xxxxxx+20160905:0831+00000000000057+    +ORDERS++1'

In X12

Element ISA13 of ISA segment:
ISA*00* *00* *ZZ*167520391 *ZZ*39319445 *991201*1248*U*00200*000000001*0*P*>

This number need to be persistent. The middleware we are using for EDI transformation should cater this requirement. I used MS-BizTalk  Server for two EDI projects, which cater the same. (just by a configuration)

M3 e-Collaborator (MEC) does the same thing in a different way. In the MEC database (e.g. MEC_Storage_TST) has a table (UTIL_Message_Counters) for this purpose.

Table structure is like this:

image

Note 1: To be able to use this class you must first create this table (use the SQL script MeC_Utilities_db_script.sql).

You don’t have to enter a record or write code to save/get data. Instead, you have to write 2 lines of java code in your mapper to get the Value. ( Unique Message Interchange Number)

Note 2: Values in Key fields are case sensitive.

Steps:

  1. Initialize the message counter for the map.
    myMap is reference to the Map.
    MessageCounter mc = new MessageCounter(myMap);
    
  2. Get a new counter value using one of 3 overloads

    /*
    * getNewValue(String counterId)
    * counterID = Choose suitable name (max 20 chars)
    *
    * Returns new counter for the map
    */
     String newVal = mc.getNewValue("MsgCounter");
    

    Or
    /*
    * getNewValue(String counterId, int keyFields);
    * counterID = Choose suitable name (max 20 chars)
    *
    * Returns new counter for the map AND parnter ID
    */
     String newVal = mc.getNewValue("MsgCounter",mc.MAP_NAME + mc.PARTNER_ID);
    

    Or
    /*
    * getNewValue(String counterId, int keyFields, String cono, String divi, String date) 
    * counterID = Choose suitable name (max 20 chars)
    *
    * Returns new counter for the map AND parnter ID AND cono AND divi AND date.
    * you can omit cono and divi by setting null 
    * below code resets the counter for each day (format CCYYMMDD).
    */
     String newVal = mc.getNewValue("MsgCounter",mc.MAP_NAME + mc.PARTNER_ID, null, null, DATE);
    

If, everything OK, you will return the new counter other wise –1.

If you look at the table (UTIL_Message_Counters) , a record has been added and value will be incremented each time when getNewValue() is called.

image

Jul 22, 2016

MEC: Call Web Service in a cleaner way

Background

In the MEC mapper, calling a web service is a general scenario. There are few ways to do it. One method is build the SOAP request Payload in a string and submit via POST method. (as below code snippet)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
java.net.URL obj = new java.net.URL(iURL);
java.net.HttpURLConnection con = (java.net.HttpURLConnection) obj.openConnection();

con.setRequestMethod("POST");
con.setRequestProperty ("Content-Type","text/xml");
con.setRequestProperty ("Accept","text/xml");

String itemStr = "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
			+ "<soap:Body>"
			+ "<GetItem xmlns=\"http://tempuri.org/\">"
			+ "<itemNumber>KelumG</itemNumber>"
			+ "</GetItem>"
			+ "</soap:Body></soap:Envelope>";		
con.setDoOutput(true);
java.io.DataOutputStream wr = new java.io.DataOutputStream(con.getOutputStream());
wr.writeBytes(itemStr);
wr.flush();
wr.close();

This is very primitive and takes lot of times of developer. Also it hinders the code readability & maintainability.

From this post I’m going to tell you a cleaner way, rather simple way. We, programmers, know easy way to call web service is using Proxy objects/classes.

Proxy objects are type of representations of the web service for the programming language we are using.

Solution

  1. Create Proxy class from the web service.
    The service I’m using for this post is http://localhost:4599/HelloService.asmx?wsdl  (refer below P.S. section). There are few tools to create proxy classes in java (wsimport, axis2, java2wsdl etc. ). Here I’m using wsimport with following argument.

    -d KG : store generated class into KG folder

    wsimport -d KG http://localhost:4599/HelloService.asmx?wsdl command to create proxy classes.

    image
  2. Create jar file for the generated files.
    Using command line: https://docs.oracle.com/javase/tutorial/deployment/jar/build.html
    Using Eclipse: http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftasks-33.htm

    Note:
    There are limitations for customer JARs. ( Page # 85, Business Document Mapper, Version 11.4.3.0)
    Package
    To use a Java class from a Custom JAR in a mapping, the class has to use a package. The default package, that is no package, will not work. Note that you have to enter this package for all references to the custom class in the code for Java functions within a mapping.

    Javadoc, encoding
    If you want to get Javadoc in the mapping Java editor when using a Java class from a Custom JAR, the Java source code, that is, the .java file, must be included in the Custom JAR. The .java file must use the character encoding UTF-16, otherwise no Javadoc will be shown in the mapper. This is because the files for the mapping use that encoding.
  3. In the map add reference to this custom JAR file.
    image
  4. Simply call the service just like a method.
    1
    2
    3
    4
    5
    6
    private void callWebSvc() throws Throwable {
    	// Please implement me
    	org.tempuri.HelloService hs = new org.tempuri.HelloService(new java.net.URL(iUrl));
    	org.tempuri.HelloServiceSoap hsoap= hs.getHelloServiceSoap();
    	oItem = hsoap.getItem(iItem);
    }
    


P.S:

For this post I have created a mock web service (.asmx ) using C# and hosted in IIS. Sample code as below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
namespace WebServiceApp
{
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    public class HelloService : System.Web.Services.WebService
    {
        [WebMethod]
        public string GetItem(string itemNumber)
        {
            return new ItemService().GetItem(itemNumber);
        }
    }

    public class ItemService
    {
        public string GetItem(string itno)
        {
            return string.Format("Item {0}",itno);
        }
    }

image

Jun 30, 2016

MEC: Change out file name dynamically

Background

Manipulating the out file name generated by the middle ware is a common scenario. By default file names are generated with a GUID (13a7a838-a706-4273-b190-9d58a79bf04e). It is more practical if the file name is human readable.

Solution

  1. In the Mapper add User function to change the file name. (Note: this function should the last function in the map)
    image
  2. Add similar code to the function. This code set file name to the manifest information of the map.
    1
    2
    3
    4
    5
    6
    String date = new java.text.SimpleDateFormat("yyMMdd").format(new java.util.GregorianCalendar().getTime());
    String time = new java.text.SimpleDateFormat("HHmmss").format(new java.util.GregorianCalendar().getTime());
    
    String fileName  = "EDI_832_OUT_"+ date+time;
    
    setManifestInfo("map:FileName", fileName);
    
  3. Then, configure the relevant Send (in partner agreement) object to take the given file name.
    image
  4. And you are done. !!!

Jan 26, 2016

How MEC Message Flow Work

Like any other middle-ware application MEC has unique architectural components. Below diagram depicts them.

Sol_Consept

  1. Inbound message will be consumed by the MEC and goes through detection rules defined in the partner agreement. Detection is either channel or XML detection. If inbound message is a flat file, channel detection will be used.
    For XML detection, inbound message must have meta data to configure the detection.

    Note below payload has RequestHeader as meta data.
    <ItemInfo>
    <RequestHeader>
    <environment>A</environment>
    <program>B</program>
    <company>A</company>
    </RequestHeader>
    <RequestBody>
    <!-- Items goes here-->
    </RequestBody>
    </ItemInfo>



    detection configuration is:
    XMLDetect
    • Detection information  & rules are saved in MEC storage. MEC will evaluate all saved detections (in a order) until its find the correct one.
  2. Once the detection has passed, process the message based on the defined processing steps. (in the given order)
    mec_proc
    • These steps are also saved on the MEC Storage
  3. Generate the output message.

Jan 18, 2016

M3 Integrations (MEC)

I was able to refresh my knowledge of   M3 integration with MEC (M3 E-collaborator).  MEC is a middle-ware specifically design for M3 integration development. Over the past few years it has been evolved.

MEC has following components:
  1. Flat-File definition tool -  Using this tool you can create XML schema file. Also it can generate sample Flat File & XML file for the schema. 
  2. Flat-File Repository manger - Is the repository for the local and server definitions. 
  3. Mapper - Use to transform data to a output file or update M3 directly for the given input schema and the defined logic. It has certain functions to perform this level of transformation.  (Later, with my next posts I'm hopping to reveal them). If you are familiar with Ms-BizTalk server, it's orchestration and MEC mapper is  similar in behavior. 
  4. Partner Admin tool - Use to configure agreement for the integration such as, 
  • Detection
  • Processes
  • Error handling
  • and other admin tasks (e.g. communication, web-service definitions, EventHub subscriptions etc.) 
Its mapper look as follows, 

MEC Mapper
MEC Mapper


MEC: How to Set Message Counter for EDI Message

When you sending/creating EDI messages it is necessary to include unique message interchange number. This is to ensure each message that we ...