How to run a workflow with parameters - elsa-workflows

I'm new using Elsa and I try to run a hello world example.
When we need to call the workflow, we just need to call this sentence:
await runner.BuildAndStartWorkflowAsync<HelloWorld>()
I'm wondering for example how I can call the HelloWorld class but sending some parameters that are coming from outside.
BuildAndStartWorkflowAsync has some parameters, one of them is input of type WorkflowInput, which I assume is used to send values to the workflow. Once I call the workflow, it goes to the HelloWorld/Build method, how can I read this input from there?

The way of calling the workflow with initial parameters it is:
await runner.BuildAndStartWorkflowAsync<HelloWorld>(input: new WorkflowInput(yourobject));
where "yourobject" is whatever you want, a class for example with some properties.

Related

Dialogflow update context in the console

I have a requirment where I want to append the parameter to context in the frontend screen.
I can do it via webhook as :
1. Get Context Param1 and Parameters Param1
2. Append Context Param1 with Parameters Param1
3. Set Context
But is it possible to do it from the frontend? We can access the context variable using #contextA.variableB. But can we write groovy or some other expression in the Argument section like $variableB+#contextA.variableB ?
I hope you got my ask, let me know if the question is not yet clear, I will try to give brief example as well.
Thanks in advance.
No.
Through the console alone, context parameters are set to the value of the parameters set from the sample phrases.
If you need to set context parameters to something else, you need to use fulfillment. You can use the built-in fulfillment editor, but you'll need to use something.

How do I call a c function on each occurrence in LoadRunner?

So there is this HUGE JSON that I am loading from a file and than I run it through lr_eval_string and save it to a parameter. This parameter is later used as a body in one of my REST calls.
I use lr_eval_string to dynamically replace different values in that JSON.
Now here is the problem, one of the values that I replace is unique and generated by a c function. This value appears numerous times in that JSON and needs to be unique each time, yet I am only able to call that c function once at the beginning of the action. The result is that all values end up being equal...
So my question is: how can I call my function each time this unique value appears? I am talking about functionality similar to "Update value on: Each occurrence" that is available on the Parameters section.
I see an option called "User Defined Function" in parameters which I guess could do what I am looking for yet I couldn't find any good tutorial on how to actually use this functionality. Is user defined action the way to go, is there any other solution?
Any help would be highly appreciated! :)

Passing values between cucumber statements

I'm running in to an issue in that I need to get one value in a cucumber statement, and then give that value to another statement.
Specifically I am getting a JSON object from one page (where that object gets sent to an api endpoint as a preference) and then using information out of that after I query the api, which happens in a completely separate step.
I am suspecting that I have to write the value somewhere, and then pull that value when the step that needs it comes up, but I'm kind of at a loss for doing that as well.
I can provide any further needed details, thanks for any help!
Definitely a rookie question - to which the answer is to use instance variables - #variable_name = get_method in the helper method your step calls.

Coded UI Test data driven in UIMap.cs

I have a lot of codeduitest. There are common test step in each test method. For example; this.UImap.navigatetourl(); I have moved it in UIMap.cs. Because I have changed code for navigatetourl().I want to run the same test method for different urls. I can use data driven test in CodedUITest but I want to use data driven test in UIMap.cs. What can I do?
Thanks,
Take your UIMap.NavigateToUrl() method and add a parameter to it for the URL you want to go to. Use that value to set the appropriate *Params property in your UIMap before actually doing the the navigation. (I'm assuming you recorded a navigation action of some kind?)
In your CodedUI test, take the relevant value from your data source and pass it through to the UIMap.NavigateTo() method as the URL parameter value.

How to call an action inside another action in Yii?

I've a situation where i get some information from database and based on the data , i want to do/forward to some other controller & action.
How can i do this using Yii? Its like an ajax request..
If i can use the CController->forward() , then how can use the post values for actions?
I shall assume that the reason why redirect() didn't work for you was because you can't sent post variables with it. If that's the case, then let me show you how to overcome the lack of POST support in redirect(). You can use setState(). It creates variables that simulate POST variables. This is the code to store or set a variable:
Yii::app()->user->setState('var', 'value');
And, in order to trace the value you just code as follows:
Yii::app()->user->getState('param1');
It would equally work with forward, but I'm not sure why you want to use it instead of redirect().

Resources