# parseOverflow

This action parses the event.overflow field into a JSON object and copies the resulting object into the workflowContext.overflow object. This allows unmapped event data available within the event workflows.

The event.overflow data is populated by a LAM, and contains all of the data present in the source event that was not mapped by the LAM mapping process. This overflow data is not impacted by extraction within a lambot, and is passed as a string in the event to the Event Workflows.

This action will always return true, if the parsing of the overflow data fails for any reason, an empty object ( {} ) will be copied into the workflowContext.overflow object.

This function is available for event workflows only.

## Arguments

Workflow Engine function parseOverflow has no arguments.

## Example

An event sent to the Webhook integration contains an unmapped object. We want to use conditional logic on this object to alter the severity of the event.

"errorDetails" : {
"errorCode" : 099,
"errorDescription" : "Significant error - urgent attention required"
}

This would be a string payload in the event, with other unmapped data:

"overflow":"{\"errorDetails\":{\"errorDescription\":\"Significant error - urgent attention required\",\"errorCode\":99},\"LamInstanceName\":\"DATA_SOURCE\"}"

To access this data in a workflow, you can examine and extract this data as a string. However, it is far easier to extract as a JSON object. In this case, we want to alter the severity of the event of the errorCode is 99.

In the Event Workflows, create a workflow with the following actions:

• parseOverflow

Parses and copies the overflow string to a JSON object in workflowContext.overflow. After this action the workflowContext contains:

WORKFLOW CONTEXT: EVENT: 18701BEB-DA53-4740-9F75-ABB60EA9C1AC :  :
{
"overflow": {
"errorDetails": {
"errorDescription": "Significant error - urgent attention required",
"errorCode": 99
},
"LamInstanceName": "DATA_SOURCE"
}
}
• compareFields

leftSide : \$(workflowContext.overflow.errorDetais.errorCode) -- Substitute the value from the workflowContext into the action.

operator : =

rightSide : 99

• setSeverity

severity : 5

You can also use this action to map JSON fields with a whitespace in the key — for example if you want to extract the value of [“Root Cause”].cdn:

{
"Root Cause" : {
"cdn" : "someValue"}
}

Currently the Webhook mapping does not allow keys with white spaces to be mapped (MOOG-17234 has been filed to address this omission).

Using the parseOverflow action, we can extract this data with the following workflow:

• parseOverflow

• copyFromContext

from : overflow[“Root Cause”].cdn

to : custom_info.cdn

Note the use of the [ “…”] notation for accessing a whitespace containing key.

The workflowContext would contain:

WORKFLOW CONTEXT: EVENT: 756B65AA-72FA-4C43-B818-016F1BACBC64 :  :
{
"overflow": {
"Root Cause": {
"cdn": "someValue"
}
}
}

And the resulting event would contain:

"custom_info": {
"cdn": "someValue"
}