Dynamic Flex Workflow in Studio - twilio-studio

As part of my Twilio Studio flow I am using the HTTP request step to get data from an external database that responds back with the agent skill to be used when routing the call however I am unable to figure out how to use this variable in the send to flex step. Is it possible to dynamically set the workflow in the send to flex step from a variable?

I found the solution passing Json in the send to flex step and using filters at the workflow level.

Related

hide or show an element on client with using signalR

I'm trying to hide or show an element on the client by updating a parameter on db. Is that possible with signalR? Or is there any other way to do it?
Note: my application is based on asp.net core mvc (entity framework)
Asp.net core SignalR is used to create real-time web functionality, are you sure you want to achieve this behavior?
"hide or show an element on the client by updating a parameter on db."
For this question, it depends on how you want to hide or show the element, real time or just one time?
If you just want to hide or show the element when page load (one time per page load), you can query the database and get the condition (parameter from the database), and then use an if-else statement to hide or show the element.
If you want to change the element status real-time, you can use SignalR.
Create a scheduled task on the back end and trace the database parameter status, if the parameter changes, call the client method and show or hide the element.
Reference:
Background tasks with hosted services
How can I execute a method every year using BackgroundService in ASP.NET core Application?
Send messages from outside a hub

Is There a way to resume a download using Flurl framework?

I am using the Flurl framework to call web service methods.
One of this method returns a file content as a Stream using FileStreamActionResult as a return value of my web service.
On the client side I am using the DownloadFileAsync extension method implemented in Flurl.
All is working good..
Now in case of very big file, I want the process to be able to resume at a point where the download could have been stopped (because loose of network...or even because the user has closed the app).
Is this possible with Flurl ?
Regards.
No, Flurl doesn't provide that functionality.

Adding correlation id to automatically generated telemetry with App Insights

I'm very new to Application Insights, and I'm thinking of using it for a set of services I plan on implementing with asp.net webapi. I was able to get the basic telemetry up and running very easily (right-clicking on a project on VS, Add Application Insights), but then I hit a block. I plan to have a correlation id set in the request headers for calls to downstream services, and I would like to tag all the telemetry related to one outside call with the same correlation id.
So far I've found that there is a way to configure a TelemetryInitializer, but if I understood correctly, this is run before I get to access the request, meaning I can't check if there is a correlation id that I should attach.
So I guess there might be 2 ways to solve this: 1) if I can somehow actually get access to the request headers before the initializer, that would obviously solver the problem, or 2) somehow get a hold of the TelemetryClient instance that is used to report the automatically generated telemetry.
Perhaps the last resort would be to turn off all of the automatic stuff and do all of it manually, when I could of course control what properties are set on the TelemetryClient. But this would be quite a lot more work, so I'd prefer to find some other solution.
You were rights saying that you should use TelemetryInitializer. All TelemetryInitializers are called when Track method is called on any telemetry item. Autogenerated request telemetry is "tracked" on request OnEnd, you should have all your custom headers available for you at that time.
Please also have a look at OperationId - this is part of the standard context managed by App Inisghts and is used exactly for the purpose of correlating requests with downstream execution. This is created and passed automatically, including traces (if you use trackTrace).
Moreover, we have built-in support in our UX for easily seeing all telemetry for a particular operation - it can be found in "Search->Details-->Related Items-->All telemetry for this operation"

CDA Broker API : Get ComponentPresentations by list of component IDs

I am trying to see if there is a way to get the ComponentPresentations by passing the list of ComponentIDs in one single API instead of passing each one in a loop. In my case all the DCPs are using the same template as well.
When I checked the API I could not find any method which could accept the list of tcmids or something in those lines. The use case I am trying to solve is getting all the DCPs in one single API call vs. looping through 10-15 (in my case) and get each DCP independently which is not effective when the first time we hit the broker db.
I was able to get the same using OData web service, but we not yet ready to use the Odata. Not sure if Odata and broker API are slightly different, but could not find any documentation that explain API vs Odata difference in capabilities from query point.
Any help will be appreciated.
ENV: Tridion 2011 SP1, Java API.
OData and Broker API are very different. If you want information on OData I'd recommend checking here and here.
No, you can't do that operation through the Content Delivery API. With a properly configured cache you will be hitting the database only once per component presentation, so the impact is minimized...

Accessing workflowArguments in a hosted workflow

We are mixing workflows, a workflow using receive activity's more at the end. But at the start we want to pass in some arguments (not using a receive activity!)
Our workflows are already being created and resumed using a dynamic endpoint with IWorkflowCreation and a class derived from WorkflowHostingEndpoint. In the OnGetCreationContext the creationgContext is filled with WorkflowArguments and the workflow runs. At a later part the receive activity's are creating a bookmark which can be resumed with a message. All seems nice.
But in a xamlx there are no WorkflowArguments, i understand why, except that i want them anyway. I though about an activity in which i can write some code to get the Arguments myself, but i do need some help here.
Or is there another way to pass along the WorkflowArguments into a xamls without using Messaging?
You can't pass arguments into a starting workflow service except through the SOAP message that starts it. But there is nothing preventing you from reading any properties in your workflow service. So it is perfectly fine to do read settings or something similar instead of passing them in at startup.
We have solved this exact situation by creating another WCF service which sits alongside our xamlx service on a slightly different url (e.g. /WorkflowMetadata) and this is where we implement a service method that returns a dictionary of string, type.
In the implementation of this service we simply read the xamlx and determine the arguments.
This is what we use to interrogate a target workflow in an activity designer when creating something like a launch-workflow activity.
Creating an activity will not work as that activity will need an instance in order to run. All you want is some metadata about the xamlx service. And if you are using a WorkflowCreationEndpoint to construct a creation context then you are probably only allowing a dictionary of string, object as the start parameters. Therefore standard metadata will not work. This left us with the only option being to provide another service beside the workflow which serves metadata.
Background here: http://blog.petegoo.com/index.php/2011/09/02/building-an-enterprise-workflow-system-with-wf4/

Resources