You are here:
OdinAttributeFormatter Interface
Formats an input attribute value and returns the formatted value in an output map.
Signature
Loosely typed
public Boolean invokeMethod(String methodName, Map<String, Object> input, Map<String, Object> output, Map<String, Object> options)Usage
This interface is triggered when preparing a submit request payload to be sent to Vlocity Order Management.
Methods
Method | Description |
|---|---|
DefaultOdinFormatterImpl:getFormattedAttributeValue Method |
Gets the formatted value of the input attribute. |
Example Implementation
This example changes the attribute value of attribute data type DATE. If the date is in GMT timezone, it formats the date to the user's timezone.
global class SampleOdinAttributeFormatterImpl implements vlocity_cmt.VlocityOpenInterface {
public Boolean invokeMethod(String methodName,
Map < String, Object > input,
Map < String, Object > output,
Map < String, Object > options) {
if (methodName == 'getFormattedAttributeValue') {
getFormattedAttributeValue(input, output, options);
return true;
}
return false;
}
private void getFormattedAttributeValue(Map < String, Object > input,
Map < String, Object > output,
Map < String, Object > options) {
//write your own logic
}
}
