Nested Logic Apps in Azure - azure-logic-apps

Question about implementing nested Logic Apps in Azure: I do know Logic Apps currently doesn't support variables. Looking for other options.
I would like to pass the values back and forth between logic apps - I have seen a couple of articles on how to implement nested logic but they are not bidirectional. My challenge is to process the body that's coming from the child logic app and pass it over to another logic app as input. It's something like this I wanted to try.
ParentLogicApp:foreach(ActionName)
ParentLogicApp:Assign the Body to a variable(place holder)
ParentLogicApp:Call Specific ActionValue LogicApp
ChildLogicApp:In this logic app do the corresponding Action
ChildLogicApp:Return the updated Body to the parent logic app
ParentLogicApp:Update the Variable with the new value from Child
PartnerLogicApp:Call the next step child logic app passing the updated variable
I have tried to use Compose but was not able to update the value from the child logic app. Any ideas?
Thanks

To have a variable that's accessible from multiple logic apps, consider store it in DocDB and use DocDB connector to CRUD it.

You can pass data back-and-forth between logic apps, that is what body is for.
When calling a logic app, just put it in the request body for the call, then you can return whatever data back from that logic app in its response body.
For your scenario, you can definitely use variables and set them to a value you received from a logic app call, and use the new value to pass to a next logic app.

Related

Multi Step Form Handling using React and Django Rest Framework

I have a three step form to add a story in database
When user fills the step one form, all the step one data will be added to the story table and the user will be redirected to step two. I have written three views for step one, two, three.
My question is how should i manage step two view and step three view? How should i update the story in step two and step three? Should i send id back to front end and store it in redux? And then send that id to the backend for step two and step three?
Also how should i reuse this form in react for update?
I can provide more details if want
I believe there is no "fits all" solution, but in general your thoughts are correct. If there is data that backend knows and your frontend doesn't, you send it back as a response. So this would be like this:
Send form to backend
Backend responses with either "OK" plus the data frontend needs to know about, or with errors if something went wrong
Proceed to next step and to 1 until finished
You can also just store all the data from all three steps on frontend and then send it in one piece - in this case you don't end up with partially filled data in DB, but then you will have to think about navigation to errored fields/steps if something will go wrong and it will complicate things.
As to components reuse I have opinion: if you can keep component maintainable and replaceable - reuse it.
Edit: If you are using react you might not need to redirect user via backend, but only switch step via react (either with client-side router or with plain "step" value in state), depending on your needs.

Can I share functions between main app and web workers?

I have a React app that involves some lengthy processing. I have 30 charts to display and need to calculate the data for each one.
The code to do these calculations is fairly complex.
I'd like a web worker to do the initial calculations for all 30 (to keep app responsive when first loaded).
However, I also need to recalculate each change on demand---if someone changes a chart parameters. This can block as it's fast enough.
I have the code for all the updates, but, I've realised I can't call that from the web worker. But, if I put all that code in the web worker, then I can't call it from my main app.
The chart calcs share a lot of common code. I could build a web worker for each chart, but then could I share a single function between them? It looks like I have to have the function defined inside the web worker.
Feels like I must be confused here as surely one doesn't need to write common code inside each web worker. Is there a way I can inject the code into the web worker?

How to make React Service as Singleton, Injectable, and Redux Connected

Summary
I am writing a React-Redux application, and would like to create a service that can be accessed across multiple components, with the following characteristics:
Singleton (just gets instantiated once across the entire
application)
Injectable (can be injected into, and used by, multiple components across the application)
Redux Connected (can access the entire Redux state tree & received updates to state changes)
Code Example
The type of solution I have in mind, would allow me to inject a service int a React Component, and use in the following way:
{ featureAvailabilityService.isAvailable('myFeature') && (<MyFeature />) }
Ideas
I have read about High Order Components, Hooks, and the Context API. There are also some interesting libraries, such as Unstated, and Redux-Logic. I feel like the best answer probably lies somewhere between these, but could use some guidance to put me on the right track.
Use Case
In this instance, I would like to create a reusable service, which has methods to determine the availability of certain features. This involves relatively complex logic based on System, Tenant, and User configuration and state. It also requires the service to have access to state from several different parts of the application. It will also be reused broadly across the application.
Why Yet Another React Service Question?
I realize there are already a lot of similar questions to this, usually from people with an Angular background, looking for the React equivalent to an Angular Service. However, I have not yet found an answer that provides for the above three criteria... or at least not one that I understood.
Thanks for any input.

Can I run multiple logic app from single master logic app

Hi I have 16 logic app which load file from share point but I need to run all those separately.
Is there any way can I run all those 16 logic app from one master logic app.
Yes you could, the logic app support create the "child" Logic App. Then you could call nested Logic Apps directly from Logic Appps Designer.
If you want to run them in parallel, you could choose Add a parallel branch then call child Logic Apps.
Firstly ,your child Logic Apps need to be set with Manual – When an HTTP request is received trigger. Then go to the parent logic app add an action and search Logic App, then choose the Logic Apps you want.
About the details you could refer to this doc:Azure Logic Apps: Call nested Logic Apps directly from Logic Apps Designer.
Hope this could help you, if you still have other questions,please let me know.

Controller logic in Element View in CakePHP

I'm working on a really big project. The aspect I'm currently working on requires that email templates are sent to a user when they're added to a learning course by another user.
The controller that deals with the request, does a bunch of str_replace tasks to find variables in the text (which the user can edit before adding another user to the learning course) and then replaces it with some values in the DB.
I took over this project and I'm not happy with the way half the things are done but time costs dictate I rather just go along with it.
The email is sent using Cake's native email function. It uses a template to capture data and send to the user.
Here's the question:
Should I keep the logic in the controller or do you think it's safe to move it to the element view's .ctp file?
My first instinct is to leave it in the controller as per the usual MVC separation ideals.
Cheers
This is a very important question - what are you using exactly for the email? The old email component or the new CakeEmail class? Which CakePHP core version are you using?
Here are some plausible aproaches here. You can:
Set all those variables, pass them to the view and do all the "replacing" there.
Encapsulate this logic in a component, attach it to your controller(s) and use it.
Just leave it in a private function within the controller and call that function whenever needed. (not really MVC)

Resources