Scripting rules

Topics: Customizing Orchard
Aug 22, 2013 at 4:25 PM
Edited Aug 22, 2013 at 4:41 PM
Hello all,
I'm using Orchard 1.6 for an existing site and I created a custom form. Now I wish to create a rule where first action requires to user check a box and then send a mail...

I cannot operate the condition :-(

When I create a first action with condition:
           {Content.Fields.Quesiti.Privacy} == true
but orchard seems not evaluate correctly because the following action (send mail) is never executed.

Why?

Thank's in advance

Marco
Coordinator
Aug 22, 2013 at 8:14 PM
Anything in app_data\logs?
Aug 23, 2013 at 10:41 AM
I got two type of errors:

2013-08-22 12:43:44,694 [25] Orchard.Rules.Services.RulesManager - An action could not be executed.
Orchard.OrchardException: Syntax error: Unexpected token in primary expression (Token 'Invalid' (Unrecognized character) at position 7)
at Orchard.Scripting.ScriptExpressionEvaluator.Evaluate(String expression, IEnumerable1 providers)
at Orchard.Scripting.Rules.ConditionActions.Evaluate(Object context)
at Orchard.Rules.Services.RulesManager.ExecuteActions(IEnumerable
1 actions, Dictionary2 tokens)

instead if I try with only one '=' (that is {Content.Fields.Quesiti.Privacy} = true) the error is

2013-08-22 15:46:55,491 [39] Orchard.Rules.Services.RulesManager - An action could not be executed.
Orchard.OrchardException: Syntax error: Unexpected token in primary expression (Token 'Equal' at position 2)
at Orchard.Scripting.ScriptExpressionEvaluator.Evaluate(String expression, IEnumerable
1 providers)
at Orchard.Scripting.Rules.ConditionActions.Evaluate(Object context)
at Orchard.Rules.Services.RulesManager.ExecuteActions(IEnumerable1 actions, Dictionary2 tokens)

what is the syntax error?
Coordinator
Aug 23, 2013 at 8:19 PM
Not sure what kind of expression is allowed in there. You may also want to check out workflows in 1.7.
Developer
Aug 24, 2013 at 1:46 AM
Edited Aug 24, 2013 at 1:47 AM
I never knew you could actually use tokens with the default scripting engine. Cool.