IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: jgorny
About
User Name: jgorny
Forum Rank: Newbie
Real Name:
Location
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Friday, May 17, 2019
Last Visit: Monday, January 11, 2021 8:09:23 PM
Number of Posts: 2
[0.01% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: compute-when=once for a mapping
Posted: Thursday, December 12, 2019 7:44:10 PM
Hi,

We've got a mapping that does an API call to generate an auth token, but unfortunately none of the api response tokens pass the token back. As a result, when we chain two APIs processes together the auth token API call gets re-submitted and a new token is generated.

The API owner allows new tokens to invalidate old ones, but it has to wait a few seconds before this can happen, and they have said this is not the intent. Their intent is to generate a token that has an internal kill of 30 seconds that gets extended every time an api is called using the token.

The workaround is either:

a) separate these API calls and pass through the auth token as a parameter and run each step in concert using flowforce
b) add a delete auth token api call to the original mapping that triggers when a success response is received from the first API call.

Is there a setting that allows a variable to be calculated once for an entire mapping? The problem here is that the token doesn't get passed back in the API responses and so have multiple subtargets (The email/auth call goes back to the first step despite setting compute-when to once).

Is there a way to make the first auth token generating API call fire only once per mapping run?
Topic: recursion error parsing paged REST service
Posted: Monday, May 20, 2019 7:38:10 PM
I have a rest service that responds in a JSON format. The base is an object with an array of member object that return the results of the query and a meta object that includes errors messages and the next_page integer when there are more results to load.

In the main mapping, I submit credentials to get the token, and pass the email and token to a user-defined function that I've defined as regular.

The user-defined function takes the email and token inputs and if there is no page input is assumes 1 as the rest call requires.

After performing the rest call it passes the response of the web service back out as a complex output in XML - the XML has a root object, a response > patients node and a meta node.

What I want to do is test the meta > next_page output from the function, and if it is not null, pass the value back through the user-defined function.

I was under the impression this kind of recursion was possible, but I get a circular ref encountered error.

How can I use the output of the REST response field to recursively call the regular UDF - I thought this was what they were for.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.