GetConditionVal Method

This method allows users to call and retrieve the values of the named expression variables.

Input Arguments

  • CondName. The name of the condition variable.

  • IntId. The integration id of the product.

Output Arguments

If the condition variable is found and evaluates to true, the property Result is set to Y in the output arguments. If not, the Result is set to N.

For example, define a Product as follows:

Class1

-> Att1

Product: Child1 (associated with Class1)

Attribute: Att1 (which has the default value of one)

Constraints List:

Name: RuleOne

Constraint: The attribute SekAtt1 = one sets the value of the procedural condition variable to true

Product: Root (associated with Class1)

Re1: Child1

You can use the following script:

function Cfg_AttributeChanged (ChangedAttribute)

{

var Service = TheApplication().GetService("Configurator Service");

var Variable ="RuleOne";

var VariableVal = "";

var IntegrationID= AddItem("$.[Root]#1", "R1", "Child1", "1")

var InputArgs = TheApplication().NewPropertySet();

var OutputArgs = TheApplication().NewPropertySet();

InputArgs.SetProperty("CondName", Variable);

InputArgs.SetProperty("IntId", IntegrationID);

Service.InvokeMethod("GetConditionVal", InputArgs, OutputArgs);

Variable = OutputArgs.GetProperty("Result");

if (Variable == "Y")

{

TheApplication().RaiseErrorText("True" );

}

else

{

TheApplication().RaiseErrorText("False" );

}

}