Returning parameters from FinalBuilder 7 Action Lists - finalbuilder

If I'm not mistaken, it seems that FinalBuilder 7's action list parameters only support input values. Is there any way I can simulate a workaround for return parameters? I do not want to store return parameters in a global temp variable or even a stack, because I'm calling the same action list multiple times asynchronously.
Here is sample of what I want to do. (Notice the shared use of the same action list)
Async Action Group
+-Action Group
| +-Run Action List - [Do Some Calculation]
| +-Replace variable A with return parameter from previous action list
+-Action Group
+-Run Action List - [Do Some Calculation]
+-Replace variable B with return parameter from previous action list
I'm currently using an INI file in the action list to save return values. The calling method passes a parameter to the action list specifying to which INI key to save to. The calling method then reads the value from the INI from the key.
Surely there has to be a more elegant way to do this?

I have never seen any way to return variables from action lists.
That would be an excellent suggestion to post in the FinalBuilder Wish List forum.
Many of requests in the past there are now features of the product.
I think it would require giving scope to variables to something like an Action Group to pull it off. But it would help some of my scripts as well. Update: I found that FB 7 supports Local Variables. But it still does not address the needs of this answer.

Related

How do I send a request multiple times while only changing the parameters in POSTMAN?

I'm very new to postman so please bear with me. Basically, I am trying to get data from the clinicaltrials.gov API, which can only give me 1000 studies at a time. Since the data I need is about 25000 studies, I'm querying it based on dates. So, is there any way in Postman that I can GET multiple requests at one time wherein I am only changing one parameter?
Here is my URL: ClinicalTrials.gov/api/query/study_fields??expr=AREA[LocationCountry]United States AND AREA[StudyFirstPostDate]RANGE[MIN,01/01/2017] AND AREA[OverallStatus]Recruiting
I will only be changing the RANGE field in each request but I do not want to manually change it every time. So, is there any other way in which I can maybe at a list of dates and have Postman go through them all?
There's several ways to do this.
So, is there any way in Postman that I can GET multiple requests at one time wherein I am only changing one parameter?
I'm going to assume you don't mind if the requests are sequenced or parallel, the latter is less trivial and doesn't seem to add more value to you. So I'll focus on the following problem statement.
We want to retrieve multiple pages of a resource, where the cursor is StudyFirstPostDate. On each page retrieved the cursor should increment to the latest date from the previous poge. The following is just one way to code this, but the building blocks are:
You have a collection with a single request, the GET described above
We will have a pre-request script that will read a collection variable with the next StudyFirstPostDate
We will have a test script (post-request) that will re-set the StudyFirstPostDate to the next value of the pagination.
On the test script you should save the data the same way you're doing now.
You set the next request (postman.setNextRequest("NAMEOFREQUEST")) to the same GET request we're dealing with, to effectively create a loop. When you've retrieved all pages you kill the looip with postman.setNextRequest(null) - although not calling any function should also stop it. This then goes to step (2) and loop.
This flow will only work on a collection run. Even if you code all of this, just triggering the request by itself will not initiate a loop. setNextRequest only works within a collection run.
Setting a initial value to the variable on the pre-request script
// Set the initial value on the collection variables
// You could use global or environment variables, up to you.
const startDate = pm.collectionVariables.get("startDate")
Re-setting the value on the Tests
// Loop through the results save the data and retrieve the next start date for the request
// After you have it
const startDate = pm.collectionVariables.set("startDate",variableWithDate)
// If you've reach the end you stop, if not you call the same request to loop
// nextPage is an example of a boolean that you've set before
if (nextPage) {
postman.setNextRequest("NAMEOFREQUEST")
} else
postman.setNextRequest(null)
}

How do I call a specific value from a dictionary inside a dictionary?

Currently am trying to make code which can pick out either specific or aggregate values for certain actions. I am using a nested dictionary for this, but am having issues calling specific values of nested dictionary. The code runs, but always brings the same value, not matter which key I originally tried to call
I have tried to have it print a variable set to the value of the key in the dictionary. I have also tried to use v.get() to retrieve the value from the dictionary.
properties={'lake':{'repairs':9001,'upgrades':3,'police investigations':69}
,'meadow':{'repairs':3,'upgrades':8}
,'beach':{'repairs':4,'upgrades':2}
,'country':{'repairs':5,'upgrades':54}}
choice=raw_input('Do you want to learn about a specific property or total actions? (type specific or total) ')
choice=choice.lower()
if choice[0]=='s':
for k,v in properties.items():
print(properties.keys())
properti=raw_input('Which property would you like to look at? (enter nothing to exit) ')
print properties[properti]
action=raw_input('What action is it you want to learn about? ')
result=v[action]
print('The '+properti+' property has had '+str(result)+' '+action+' completed.')
I expect when I call for a specific property, choose lake, then choose repairs, that I'd get the 9001. Or even going for meadow, I'd get 3 repairs. Currently I am always getting the country property's amounts for both repairs and upgrades.
Change the following
result=v[action]
to
result=properties[properti][action]

Django - Retain Search Parameters between Server Round Trips

I have a list page with some filter, sort and search functionality (which basically creates a QuerySet in the view that then returns the adjusted (filtered, sorted, searched) data). On this list page, I also have a detail view that displays the object details.
This all works fine, but when I navigate to another detail object, the search, filter, sort parameters get reset to their default.
How can I retain the search parameters beyond a server round trip?
Thanks!
You could store the GET parameters as session variables maybe?
To set:
request.session['my_variable'] = request.GET.get('some_get_parameter')
To get:
my_variable_value = request.session.get('my_variable')
Using .get() to retrieve parameters and session variables is a little more robust than just trying to access the dicts directly with request.session['my_variable'] for example, as if my_variable is not in the session, you'll get a key error, but get() returns None if the variable is not found.

AX2012: Capture SysInfoAction on form initialization

Situation:
I am opening a form via a SysInfoAction (SysInfoAction_FormrunQuery to be exact) from an error message (info log) as follow (Compressed a bit):
query.addDataSource(tableNum(WDPErrorLogView)).addRange(fieldNum(WDPErrorLogView, ErrorOutboundMessage)).value(SysQuery::value(resultRecId));
error("#WDP1299", '', SysInfoAction_FormrunQuery::newFormnameQuery(formStr(WDPErrorLog), query));
Problem:
The form I am calling here, has multiple tabs, since it can be opened with queries from various tables. I would like to capture this calling record to not only filter on the record passed (This already happens thanks to the SysInfoAction), but also make the appropriate tab page active.
I thought that element.args().record() would contain this calling record, but to my surprise it does not. Any ideas how to could get hold of this record... or, at least its table id?
This is easy. Just add a parmMethod for an object/caller to \Classes\SysInfoAction_FormrunQuery. Copy the static method newFormnameQuery and call it newFormnameQueryWithCaller for example and then add an extra argument, then set that argument in your parm method with the same style as newFormnameQuery.
Then in your \Classes\SysInfoAction_FormrunQuery\run, where it sets up the args record, just add args.caller(...) and set your caller object if it exists.

Struts 2 keep list values

Using struts2 how can I keep list values just after click in a jsp button, going through the action and returning to jsp again? Doing this click several times again.
I've been watching that to keep a value from a variable that isn't a list I just need to declare it in the action with it's getter and setter, and put a hidden field or textfield in the jsp, but regarding lists don't worked like that.
You are correct that we need a getter and setters for the respected property in our action class to send and receive date from Action class to JSP and in reverse order.
But since for collection, its not possible to store it in a single field, so you have few options here.
If List is a simple List of String you can create a comma separated string and can use that to go from action to JSP and in reverse order (easy to convert that to list), i will not recommend this approach.
Second option i am thinking to set the list in session and you can always retrieve the list in your action class at any time as per your choice.