Extracting Integers from JSON stream

I am using AET API to gather information about process execution results and some variables, that have Integer values, returns the following error:

Unexpected conversion error while converting value [total_operaciones Integer] to an Integer
class java.lang.Integer cannot be cast to class java.lang.Long (java.lang.Integer and java.lang.Long are in module java.base of loader bootstrap

The values I am trying to catch are "consumedPremiumUnits, consumeBotTimeInMinutes, successfulOperations, TotalOperations and retriedCount.

The values related to dates have no issues, extracting as Integers.
For all Integers, I am trimming the values, just in case and format “#”.

Any hints on avoiding these errors?

This is the parcial JSON stream:
“retriedCount”:2,“totalOperations”:0,“successfulOperations”:0,“createdBy”:18475,“createdDate”:1697575580551,“lastUpdatedDate”:1697577919635,“executionStartTime”:1697577898266,“completedDate”:1697577919623,“enableTermination”:false,“priority”:“DEFAULT”,“workflowVersion”:40,“consumedPremiumUnits”:4,“consumedBotTimeInMinutes”:0

Appreciate any feedback.
Thanks

1 Like

Can you get it as a String and then convert it to Integer using Rename Fields plugin?

1 Like

Hi @RosniNeto .
Yes, that is possible, but I am always trying to optimize WF and use less steps as possible because each additional step takes precious time of the agent.
And converting with Rename step, it must not have any blanks either side of the value.
And I believe, if the option exists, it should work.

1 Like