E9.2 Simple Calculations

Hi DaveWagoner I know this is an older post but I am trying to achieve a similar concept. I have the groovy code working fine and the results come back correct but when I test in ORCH I made my "Total" var convert to string and I get the following error.

View attachment 19489

View attachment 19490
Hey!

I hate to suggest this, but as a techie I hope you understand. Have you checked to make sure your Orchestration Inputs map to the Groovy Script Inputs within the orchestration? It's something I pretty consistently find when I run into weird errors with my orchestrations :) If the mapping isn't in place, and you don't have BLANK handled in your script, you might run into a scripting exception like what you're seeing.

It's a "did you try rebooting" type question but for me it comes up a lot :)
 
@notchy

Try changing row 25 to
returnMap.put("Total",Total.toString());

I think the problem is that Total is a BigDecimal and you can't change the type of an existing variable. You could create a new String variable and set it equal to Total.toString() but that is just extra work. I don't think you can change the type of the Total variable itself.

I would also remove row 19 since that is probably not doing anything, but it probably isn't hurting anything either since it isn't being assigned.
 
Hello! Have you tried to call a native BSFN ? Like the B0000138 Accumulate Total Amount. Maybe in the Orchestrator you will need to call it 2 or more times. It depends on how many calculations you need.
In my test, I could send 2 values: 100 and 200 got the Total as 300.
1673526593108.png
So, my suggestion is to call this for the first time, send the Var1 and Var2 - get the output to the VarX, call it again, pass VarX and Var3, then get the new output as Var_Result.
1673526716469.png
Hope it helps!
 
Back
Top