Custom Transaction Log Fields

Default implementation of transaction log fields is provided with CO_MODULE’, ‘CUST_ID, CROSSREF_ID fields fetched from the .config file. All other fields have default values.

 

To custom implementation of transaction log fields:

 

  1. Create a class library project in Visual Studio.
  2. Assembly name of the project must be Utilities.DefaultTransactionLogFields.dll.
  3. Add a reference of DLL System.ComponentModel.Composition.dll available with .Net framework 4 and above. Add reference of DLL Utilities.ITransactionLogFields.dll and Utilities.Interfaces.dll into that project. This DLL is present in Engage folder in the build.
  4. Create a new class and implement the interface ITransactionLogFields.
  5. To create multiple instances, create a new class with interface Utilities.ITransactionLogFieldsFactory.
  6. Provide [Export (typeof (ITransactionLogFieldsFactory))] attribute on that class, implement that interface. Provide implementation for below method in that class.
     

        [Export(typeof(ITransactionLogFieldsFactory))]
              public class CustomTransactionLogFields : ITransactionLogFieldsFactory
        {
             public ITransactionLogFields CreateTransactionLogFields()
             {
                  return new CustomFields()
                  {
                     CUST_ID = "CustID", CROSSREF_ID = "1231231"
                  };
             }
        }
        public class CustomFields : ITransactionLogFields
        {
            private string _custId;
            private string _crossrefId;

            public string CUST_ID
            {
                get { return _custId; }
                set { _custId = value; }
            }

            public string CROSSREF_ID
            {
                get { return _crossrefId; }
                set { _crossrefId = value; }
            }
     }
     

  7. Build the project solution in x86 Mode.
  8. Copy the custom built DLL in MEFDLLS folder in  Engage installation directory. And remove the Utilities.DefaultTransactionLog- Fields.dll from that location.