Related Topics
ConditionSet Class
This object represents a Condition Set used for a Process Director object.
Properties
PROPERTY NAME |
DATA TYPE |
DESCRIPTION |
---|---|---|
ID |
String |
The string ID of the ConditionSet. |
In addition to Properties, Condition Sets use the SystemVariableContext object to specify the various context properties for the Condition Set. Please see the SystemVariableContext topic for more information. Additionally, the Condition struct object is required as a parameter for some methods of this class. The Condition struct is documented below.
Methods


This API will create a copy of a ConditionSet. This is an overloaded method with the following possible declarations:
public ConditionSet Copy()
public ConditionSet Copy(IEnumerable<Condition> cConditions)
public ConditionSet Copy(ContentObject oContainer)
public ConditionSet Copy(ContentObject oContainer, IEnumerable<Condition> cConditions)
Parameters
cConditions: A iEnumerable Condition struct object that defines the conditions included in the ConditionSet.
oContainer: A ContentList object.
Returns
Rule object: Will return null if the ConditionSet isn't found.
Example
See the general Code Sample below.


This API will call the evaluation of the ConditionSet, returning the appropriate data. This is an overloaded method with the following possible declarations:
public bool Evaluate(SystemVariableContextReadonly Context)
public bool Evaluate(SysVarClass.IContextReadonly Context)
Parameters
Context: A SystemVariableContext object containing the context settings for the Condition Set.
Returns
string: The result of the Condition Set's evaluation.
Example
See the general Code Sample below.
Condition Struct
The Condition Struct object is an IEnumerable object that stores a condition or set of conditions.
Properties
These properties can be enumerated via a Get, but are Set privately, and can't be Set in script.
PROPERTY NAME |
DESCRIPTION |
---|---|
Left |
A SystemVariable object that defines the Left side of the condition. |
Right |
A SystemVariable object that defines the Right side of the condition. |
Type |
The type of comparison to make between the left and right side of the Condition. |
Methods
Code Sample
A user can't instantiate a ConditionSet (or a Condition) object. Users will only interact with these objects through the “ReturnValues” property of a Business Rule. The following code evaluates a Business Rule, and then manually evaluates its return values, returning the first match:
var context = new SystemVariableContext {Form = BaseForm};
var sv = new SystemVariable(bp.eSysVar.FormField,
new DataItem(FormEnums.eDataType.String),
{String = "UserPicker1"});
sv.Parameters["format"] = "uid";
var sEval = sv.Evaluate(context);
var rule = Rule.GetRuleByRULEID(bp, "RULEID");
var resultRule = rule.Evaluate(context);
ReturnFirst(rule, context);
// Return the First matching value in a Rule
static string ReturnFirst(Rule rule, SystemVariableContext context)
{
foreach(var rv in rule.ReturnValues)
{
// The Copy below function is unnecessary, and added only for illustration.
// In actual use, the line below would simply be:
// var cs = rv.Value();
var cs = rv.Value.Copy();
if (cs.Evaluate(context))
return rv.Key.Evaluate(context);
}
return "";
}
Documentation Feedback and Questions
If you notice some way that this document can be improved, we're happy to hear your suggestions. Similarly, if you can't find an answer you're looking for, ask it via feedback. Simply click on the button below to provide us with your feedback or ask a question. Please remember, though, that not every issue can be addressed through documentation. So, if you have a specific technical issue with Process Director, please open a support ticket.