Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I get the workflow instance, not just the instance id, from inside the running workflow?

Id instance running Workflow
0
Posted

How can I get the workflow instance, not just the instance id, from inside the running workflow?

0

You have to build your own workflow server that exposes all types of functionality to your client code. The workflow server or host handles persistence, tracking, and workflow management such as starting and stopping the workflows. The server does most of this through the workflow runtime and a lot of these things have out of the box implementations. In my server, we use an event driven model, which is fed from an MSMQ queue. We read messages from the queue and then either fire events of registered services, which then fire into workflows that subscribe to those events or interact with the runtime and workflow instances for things such as, terminate. So in my server, when we get a terminate event, we terminate the workflow associated with that event by fetching the workflow instance from the workflow runtime and then calling terminate on it. Here is my code to give you and idea. virtual public void RaiseEvent(string applicationEventName, Dictionary arguments) { Dictiona

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123