Properties debugging Guide


NOTE:

This guide helps expose the property values for diagnosis and debugging during a development or troubleshooting phase.

 

Issue:

Let's use a scenario to represent our issue. The scenario is that we have developed an API that queries the headers passed externally inbound to the API.

 

You can query the API Headers in your API Process by accessing the values using “inheader_” as documented in this community article:

/boomi_community?id=kb_article_view&sys_kb_id=1d124a7c2533fe10ba0e94c6835b3004

 

In this scenario, we have implemented a decision shape to perform an action based on a value of the inbound header. However, the test of the value does not trigger parts of the process we expect it to.  

Possible reactions to this:

1.

Is the value not present? Is the inbound header Null?

2.

What value was tested if our decision did not trigger it? Was the value corrupt?

 

Environment:

As you can see from our scenario in our ‘Issue’ section, this can exist in all Boomi Environments.  It’s not specific to a particular runtime.

 

Cause:

In the scenario used in the ‘Issue’ section, two headers are passed into the API Call with mixed cases. This means the condition configured doesn't trigger on one of the cases that doesn’t match.

 

As you cannot see that inheader value, it is easy to assume it hasn’t been passed in.

 

Using this assumption that the value is not passed in, you would need to investigate everything that sits in front of the API.  Therefore, this means performing data capture as follows as an example:

-Replicating the problem in a lower environment.

-Capture the date and time of the test.

-Downloading logs from the Firewall.

-Downloading logs from the Load Balancer.

-Capturing a Network trace and analysing the traffic.

 

This illustrates that this is not a quick task and requires some specialist skills and possibly multiple departments within a company.

 

Resolution:

Investigating point 1 could be time-consuming and may mean investigating the infrastructure before the API, such as Load Balancer or Firewall logs.

Testing point 2 should be the first action, focusing the investigation on the correct path.


Q. How do we see what properties exist and have been passed into our API?

A. You can extract all the properties using a script or a standard notify shape.


A script would allow you to see all the properties without specifying a property by name.

Notify shape is quick and straightforward when you know what you are looking for.  However, ensure you are using the correct syntax for the property, or it can cause more confusion.

 

Try it:

Create a Data Process Step, set it to custom scripting and set it to Inline script Groovy 2.4.

Add in the following script.

 

//debug script that dumps the current Process Properties to a document.

import com.boomi.execution.ExecutionManager

execProps = ExecutionManager.getCurrent().getProperties();

NEWLINE = System.getProperty("line.separator");

StringBuilder sb = new StringBuilder();


sb.append("PROCESS PROPERTIES: " + NEWLINE);

formatProps(sb, execProps);

sb.append(NEWLINE);

outputDocProps = null;

 

for( int i = 0; i < dataContext.getDataCount(); i++ ) {

  InputStream is = dataContext.getStream(i);

  Properties props = dataContext.getProperties(i);

  if (i==0) outputDocProps = props;

  sb.append("DOCUMENT PROPERTIES: " + NEWLINE);

  formatProps(sb, props);

  sb.append(NEWLINE);

}

 

// Output single document with props

is = new ByteArrayInputStream(sb.toString().getBytes("UTF-8"));

dataContext.storeStream(is, outputDocProps);

 

def formatProps(sb, props) {

  for (k in props.keySet()) {

    sb.append(k + "=" + props.get(k) + NEWLINE);

    sb.append("*_*_* ");

  }

}

 

This script will output the properties to the document. So, I suggest adding the current document to a notify shape to see its content.

I would also add this to Branch 1 as it will override the current document and you lose the inbound document.

 

For example:



 

Additional Resources:

Good article on headers around API’s:

/boomi_community?id=kb_article_view&sys_kb_id=1d124a7c2533fe10ba0e94c6835b3004