How to pass multiple values into a PublishEvent
See original GitHub issueHi Daniel, I have a Step that is a WaitFor and I need to pass more than one value to the PublisEvent, how can I achive that?.
And example could be if you change the example 4 and in the MyDataClass add a second property
public string StrValue2 { get; set; }
then in the Step build you add another output
public void Build(IWorkflowBuilder<MyDataClass> builder)
{
builder
.StartWith(context => ExecutionResult.Next())
.WaitFor("MyEvent", (data, context) => context.Workflow.Id, data => DateTime.Now)
.Output(data => data.StrValue, step => step.EventData)
.Output(data => data.StrValue2, step => step.EventData)
.Then<CustomMessage>()
.Input(step => step.Message, data => "The data from the event is " + data.StrValue)
.Then(context => Console.WriteLine("workflow complete"));
}
I try to define a new instance of MyDataClass and assign values into StrValue and StrValue2 and pass that object into the publishEvent
var values = new MyDataClass(); values.StrValue=1; values.StrValue2=2; host.PublishEvent("MyEvent", workflowId, values);
the problem is that the ProcessOutputs recive in the body the entity MyDataClass and dosn’t now how to look for the values to assign in the output data.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How pass 2 parameters to EventEmitter in Angular?
If you look at the EventEmitter emit method @ angular.io, it can only take a single parameter of type T. emit(value?: T).
Read more >How to pass multiple data items from Particle device to webhook
My question though is - how can I get the webhook to dissect and understand the parts of a data string in the...
Read more >How to send multiple parameters to Event in LWC
Pass a JS Object direct into detail const selectedEvent = new CustomEvent('custevent', { detail: { type: "Fiat", model:"500", color:"white" } ...
Read more >Unity Events, passing multiple arguments
To test the event, you can add a canvas with a text component to the scene, and add the following script to the...
Read more >Send multiple parameters in LWC Events via Detial property
Our focus will be to learn how to send multiple parameters in LWC Events ... Solution – Passing multiple parameters through Events in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Have you tried casting the
EventData, like this?.Output(data => data.StrValue2, step => (step.EventData as MyDataClass).StrValue2)Hi, How could I achieve multiple Outputs in the EventData when I want to load my workflow by JSON? I don’t know how to do the “cast”, I mean this:
(step.EventData as MyDataClass).StrValue2