Workflow Decision activity failing when evaluates the Script when I use a token

Topics: Administration
Aug 19, 2014 at 5:12 PM
Hi all,

I'm trying to implement a Decision activity using my own token but it's not working, but if I add to Session the value that I want to evaluate is working perfectly.

I have followed the instructions of the following Thread to implement the Decision activity: https://orchard.codeplex.com/discussions/538223.

This is the Script using my token:
SetOutcome("{Reservation.AvailabilityType}");
And this is the one that finally works using Session:
WorkContext.HttpContext.Session["AvailabilityType"];
This is how I'm firing the event:
_workFlowManager.TriggerEvent(CreateReservationActivity.EventName, new ContentItem { }, () => new Dictionary<string, object> { { "Reservation", _CreateReservationViewModel } });
This is the error that it is being registered in my log files:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Orchard.Scripting.CSharp.Activities.DecisionActivity.<Execute>d__5.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Orchard.Workflows.Services.WorkflowManager.ExecuteWorkflow(WorkflowContext workflowContext, ActivityRecord activityRecord, IDictionary`2 tokens)
   at Orchard.Workflows.Services.WorkflowManager.StartWorkflow(WorkflowContext workflowContext, ActivityRecord activityRecord, IDictionary`2 tokens)
   at Orchard.Workflows.Services.WorkflowManager.TriggerEvent(String name, IContent target, Func`1 tokensContext)
   at Orchard.Events.DelegateHelper.<>c__DisplayClass31`4.<BuildAction>b__30(Object target, Object[] p) in c:\Data\Code\WEB_MEMBER_ORCHARD_1_8\src\Orchard\Events\DelegateHelper.cs:line 128
   at Orchard.Events.DefaultOrchardEventBus.TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, String messageName, String interfaceName, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in c:\Data\Code\WEB_MEMBER_ORCHARD_1_8\src\Orchard\Events\DefaultOrchardEventBus.cs:line 81
   at Orchard.Events.DefaultOrchardEventBus.TryInvoke(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in c:\Data\Code\WEB_MEMBER_ORCHARD_1_8\src\Orchard\Events\DefaultOrchardEventBus.cs:line 67
   at Orchard.Events.DefaultOrchardEventBus.TryNotifyHandler(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary`2 eventData, IEnumerable& returnValue) in c:\Data\Code\WEB_MEMBER_ORCHARD_1_8\src\Orchard\Events\DefaultOrchardEventBus.cs:line 53
Any ideas what I'm missing or what am I doing wrong?

Thanks in advance.