Apr 1, 2018

Control Properties in MEC

When we want to keep some parameters in the MEC we often use “.properties” file.  But alternatively we also can use Control properties in the Partner Administrator.

image


The control properties can be accessed from the MEC mapper using the following code.


String strVariable = getManifestInfo("agr:outputFolderPath");


Hint:

You can add control properties to the individual “Agreement” or to the “Group”.


Depending on the situation, we can choose the suitable method to use. Below comparison will help to choose appropriate method.


Comparison:


Control PropertiesProperties File
FormatKey,Value formatKey, Value format
DeploymentWill be ported to the environment with import/export function.

Possibility to miss the file to copy unless it is documented properly.

Code

Very easy. No explicit initiation of objects.

One line required to access the variable. 

Not very easy. Need to read the file and initiate property object. Require few extra coding to access first variable.
Usage Properties to be used in agreement or group level.

Properties to be used as common to share across all the agreements.

E.g. data base connections,

3 comments:

Andrew Kelly said...

Can I pass back a new value to Control Properties from the map?

Andrew Kelly said...

I'm not sure if my question was posted since I can't see it, but it would be good to be able to update Control Properties from the map. On accusations I want to keep the last map run date and run the map from that date, then update the date to today for the next run.

This doesn't seem to work.

setManifestInfo("agr:TestValue", "20230926");

It would be useful if the agreement and map manage this rather than having to store previous run dates in a DB table or assume the map ran yesterday so run it again for today.

Kelum Ganegoda said...

We cannot change and persist the Control Properties back from the map. setManifestInfo only allows us to alter the values created for the current instance and pass them to the next process. no backwards.

For your requirement, I would suggest using the CUGEX1 table to store the last successful run.
You can use the standard API to read/write information back to CUGEX/M3.

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 ...