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:
- Create a class library project in Visual Studio.
- Assembly name of the project must be Utilities.DefaultTransactionLogFields.dll.
- 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.
- Create a new class and implement the interface ITransactionLogFields.
- To create multiple instances, create a new class with interface Utilities.ITransactionLogFieldsFactory.
- 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; }
}
}
- Build the project solution in x86 Mode.
- Copy the custom built DLL in MEFDLLS folder in Engage installation directory. And remove the Utilities.DefaultTransactionLog- Fields.dll from that location.