Hi all,
I need to kill a WF instance from another instance. I have the GUID of the instance I wish to kill.
This is because I retrived information from the instance I wish to kill and I no longer need it. Neither in memory or in the database.
I just want to get rid of it.
So, what's the best way to do this
Txs.
John

Killing WF Instance
Shammi Jayaraj
Hi John,
You cannot terminate or perform any instance operation on oneinstance from another. Only the host can attain and perform operations on instances.
To achieve what you want, you can submit a request to the host to perform this operation for you (Terminate) and pass it the target instance id.
Igor I.I.
Ok, I see.
Here's my setup: I have a State Machine WF that is hosted on IIS. This WF is working as a Web Service.
Since this is a Web App, I'm using it's Web.config file to deal with host related configuration. The Web.config contains a section for this:
<section name="WorkflowRuntime" type="System.Workflow.Runtime.Configuration.WorkflowRuntimeSection, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
If anyone cares to look at that specific section I'll be happy to post it.
Anyway, I'm confused! How do I communicate with this host in particular This is not a console app or a windows app!
Where can I find an example that deals with this kind of setup and includes instance-to-host communication (and also host-to-instance communication).
Txs.
John
satish VSKP
Hi Vignesh,
thank you for the help but I still have to deal with instance-to-host and host-to-instance communication. Please see the previous post.
Txs.
John
UNOTech
You could just terminate it like this from the host (after it receives request from WF instance that wants to kill the other WF instance):
workflowRuntime.GetWorkflow(instanceId).Terminate("Not needed anymore")
This will delete it from both in-memory and cause the persistence service to remove the workflow from the db as well (if any).
Thanks,
Vignesh