Transfer parameters between train steps - database

I have a custom PL/SQL function that i am calling through a page in ADF that inserts data in a database. I want to create a train, with two steps in order to separate my parameters. In the first step put one parameter of my function and in the other step the other and then call my function. It seems that it doesn't work because it only gets the second parameter.
Any hints how to accomplish getting both?

Save your parameters to pageFlowScope as you go, and use them in the last train step

Create a 'pageFlow' scope ManagedBean and store there the attribute values that you want to save and use on different steps of the flow. I have used this approach with my ADF applications and everything is fine.

Related

How to keep square brackets in single array using Logic Apps?

I am parsing an XML document to JSON, and eventhough I have the type array declared in the json schema, if there is just one element in the array it gets transformed into an objet like this.
"ListOfCodes":{"Codes":{{"Code":"111"}}}
but I need this:
"ListOfCodes":{"Codes":[{"Code":"111"}]}
I have several arrays in the document and I only get the sqare brackets when there is a multiple array.
and adding the properties manually is not an option.
Anyone know what can i modify to fix this in the logic app?
Unfortunately, there isn't a good solution for us to implement this requirement in logic app. Here is another post which is similar to your problem. To implement the requirement, we can just:
1. Use the "Compose" action to generate the object by hand (manually put all the properties and arrays where they need, potentially using the #array() action.
2. Call an Azure Function or some external code that can more specifically craft a valid JSON.
I also try to test it in some other way, such as use json:Array="true" and use <?xml-multiple?> but they all fail in logic app. So I think the only above two solutions(mentioned in that post) can be used. Neither approach is good, though.

Is it possible to make two models in a single controller in mean stack?

I am new to the MEAN STACK and I am being asked to complete a project on the entry and exit of a user. The username of every user is stored in another collection. So, I want 2 models in a single module using the MEAN stack. Is it possible to make two models in a single module? I am using mongodb as the back end.
Kindly give a response. Thanks.
Yes you can call more than one Model & perform your queries,
Even you can try 2 collections in one collection.
Read About nested collections in MongoDB/Mongoose
http://mongoosejs.com/docs/subdocs.html

AngularJS: create single controller but use it in different parts of the page with different data

I need to write piece of code with AngularJS which will build some table with logic. The information for the table should be obtained from the server. Under the table on the page there should be a button, which will create one more table, but (possibly) with different data from the server, and so on. So, I should use the same controller (because all logic remains the same in every next table), but data, some supporting variables and objects should be different for EVERY table. Previously loaded tables should also remain on the page and support all user functions binded to them. How I can do this? As far as I know, services are singleton objects, so this way is not acceptable.
This is actually what directives are for.
If that seems too complicated, ng-repeat will create a scope for each repeated item that you can then use in ng-controller.

cakePHP, retrieving records after now

Hey, I've got an element that does a requestAction to grab records sorted by date.
What I haven't been able to workout/find is how to restrict it to only include records who's date is after now.
For example, in my element I something similar to:
$stuff = $this->requestAction('stuff/get_stuff/sort:my_date/direction:asc');
How should I go about restricting it to only records with my_date after now?
Is their another param I should add or is there something I could add into a find(...) call in my get_stuff action in controller stuff?
Advice or a friendly nudge in the right direction would be grateful!
It really depends on whether or not this will ALWAYS be the action you want to take. But here are a couple of ideas.
You can add a condition to the find query: (Complex Find Conditions)
$this->Stuff->find('all', array('condition' => array('Stuff.my_date >' => date('Y-m-d'))));
You can add a beforeFind callback method to the model that implements the same basic process. It will add the condition to every find query for the given model. (beforeFind)
You can create a new method in the controller to find the records you need and just call that, with all the custom parameters in place in the find. Then just ensure that you check it with if($this->params['requested']) to ensure it only comes from your requestAction() call, and return the dataset.
Then ensure that you cache the result, so that you aren't creating a huge overhead on your application by calling a new dispatch cycle every time someone loads the page.

Difference in Django object creation call

I'd like to know if there's a difference between the following two calls to create an object in Django
Animal.objects.create(name="cat", sound="meow")
and
Animal(name="cat", sound="meow")
I see both in test cases and I want to make sure I am not missing something.
thanks
The former also inserts a row in the database as well as creating the object.

Resources