C# Scripting not working in Workflow

Topics: Administration, Customizing Orchard
Sep 26, 2014 at 7:10 PM
I have a custom workflow that uses the Decision activity to set the state for UserTaskDone which is then later used in the worklflow to decide whether or not to keep sending a reminder email. The problem is the workflow stops executing as soon as it hits the Decision activity. I'm using the following code to set the state and outcome on the Decision activity:

Workflow.SetState("UserTaskDone", "false");

Am I setting the state or outcome wrong?
Sep 26, 2014 at 7:25 PM
Is this Orchard 1.8.1?
Sep 26, 2014 at 7:26 PM
Edited Sep 26, 2014 at 7:47 PM
Yes, I'm actually following the youtube video of your class on workflows from the 2014 Orchard conference to create a content approval workflow.
Sep 27, 2014 at 7:47 AM
I see. Unfortunately, 1.8 doesn't support the Workflow variable - it will be part of 1.9 (and is currently part of 1.x).
Sep 27, 2014 at 6:51 PM
Is there another way around this or do I need to wait until 1.9 is released?
Sep 27, 2014 at 7:36 PM
Also, is there a way to stop a currently executing workflow? LIke a Stop or Break activity that will stop the workflow from continuing to run?
Sep 28, 2014 at 4:22 AM
The only way around this is to patch your local copy of Orchard so that it supports that variable. You would have to copy over "DecisionActivity.cs" from the Orchard.Scripting.CSharp module in 1.x to your local copy.

To stop a workflow, did you try to have execution go to a dead end in your workflow? That's how I do it anyway.