Use Expression to compare two value in ParameterDic, and run different command based on the result.

IScriptCommand greaterThanCommand =   
  ScriptCommands.IfValue(ComparsionOperator.GreaterThan, "{Variable1}", "{Variable2}", 
    ScriptCommands.PrintDebug("{Variable1} is Greater than {Variable2}"),
	ScriptCommands.PrintDebug("{Variable1} is Smaller than {Variable2}"));
	
await ScriptRunner.RunScriptAsync(new ParameterDic() { 
                { "Variable1", 1 },
		{ "Variable2", 2 }
            }, greaterThanCommand); 


Result:
1 is Smaller than 2

Last edited Jul 25, 2014 at 2:46 PM by lycj, version 1

Comments

No comments yet.