Comments (5)
Have you tried casting the EventData
, like this?
.Output(data => data.StrValue2, step => (step.EventData as MyDataClass).StrValue2)
from workflow-core.
Hi Daniel, I try what you suggest, but doesn't work.
When ProcessOutputs its call the body have the WaitFor object and when try to get the resolvedValue from the body the output is the values object that I pass in the PublishEvent.
When the function try to set the value for the output it fails because resolvedValue its and object and not a string.
I make a change in the ProcessOutputs function to look if resolvedValue get properties and in that case get the value of that property and if not resolve as before.
Could you please look at this,
`private void ProcessOutputs(WorkflowInstance workflow, WorkflowStep step, IStepBody body)
{
foreach (var output in step.Outputs)
{
var member = (output.Target.Body as MemberExpression);
var resolvedValue = output.Source.Compile().DynamicInvoke(body);
var data = workflow.Data;
if (resolvedValue.GetType().GetProperties().Count() > 0)
{
var resolvedData = resolvedValue.GetType().GetProperty(member.Member.Name).GetValue(resolvedValue);
data.GetType().GetProperty(member.Member.Name).SetValue(data, resolvedData);
}
else
{
data.GetType().GetProperty(member.Member.Name).SetValue(data, resolvedValue);
}
}
}`
from workflow-core.
Could attach the project where you tried to do the cast?
from workflow-core.
Hi Daniel your past solution was correct, I was loading the workflow from a Dll and didn't realize that the proyect with that dll wasn't compiling in the solution. So I was using and old definition of the Workflow.
Thanks for your time.
from workflow-core.
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
from workflow-core.
Related Issues (20)
- [Proposal] Add IServiceScope support so that steps can get same service instances from this scope HOT 1
- How to write Waitfor in JSON ? HOT 1
- Start workflow but it does not in run steps function
- Whether there is a way to use memory mode without memory leaks
- How can I define UserTask using JSON file? HOT 1
- Parallel tasks run in sequence not parallel HOT 2
- What should I do if it is rejected to the specified node that has been executed
- Why can'not I use constructor function in workflow step function HOT 1
- Multiple processes are multi-threaded in parallel? HOT 1
- Can I use the library to implement a fallback mechanism?
- How to achieve a better process rollback workflow HOT 4
- How to achieve exponential backoff retry policy HOT 1
- Facing issue to use Mongo as persistance storage HOT 2
- On wpf application workflow doesn't run at first HOT 3
- How to rollback service Transaction
- host.Start()启动后的host对象和从容器获取的IWorkflowHost对象不一样
- How to register workflows on every node with Multi-node clusters?
- Clear terminated workflow instances
- 7k requests a minute to azure blob storage
- Memory leak
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from workflow-core.