BusinessRule
class BusinessRule
This class allows the storage and retrieval of the attributes of a business rule
Properties
private Simulator | $simulator | ||
private string | $elementId | ||
private string | $id | ||
private string | $name | ||
private string | $label | ||
private string | $conditions | ||
private Connector | $connector | ||
private array | $ifActions | ||
private array | $elseActions | ||
private null | $translator | ||
private array | $inverseOperators |
Methods
Constructor of class BusinessRule
Returns the Simulator object that defines this BusinessRule
Returns the generated id of this business rule for the DOM element in the browser
Sets the generated id of this business rule for the DOM element in the browser
Returns the business rule ID
Sets the business rule ID
Returns the business rule name
Sets the business rule name
Returns the business rule label
Sets the business rule label
Returns the business rule conditions
Sets the business rule conditions
Returns the Connector object of this business rule
Returns the list of actions that must be executed if the conditions of this business rule are verified.
Sets the list of actions that must be executed if the conditions of this business rule are verified.
Adds an action to the list of actions that must be executed if the conditions of this business rule are verified.
Returns the list of actions that must be executed if the conditions of this business rule are NOT verified.
Sets the list of actions that must be executed if the conditions of this business rule are NOT verified.
Adds an action to the list of actions that must be executed if the conditions of this business rule are NOT verified.
Returns the conditions of this business rule in a readable format.
Transforms a connector into an array of conditions
Returns the readable format of an operator
Transforms the array of parsed conditions of this business rule into an array of conditions in a readable format
Transforms the array of parsed conditions of this business rule into their negative forms
function optimize
Parses the conditions of this business rule in an array to be usable by the administration module.
Details
at line 153
void
__construct(Simulator $simulator, int $elementId, string $id, string $name)
Constructor of class BusinessRule
at line 168
Simulator
getSimulator()
Returns the Simulator object that defines this BusinessRule
at line 179
string
getElementId()
Returns the generated id of this business rule for the DOM element in the browser
at line 192
void
setElementId(string $elementId)
Sets the generated id of this business rule for the DOM element in the browser
at line 203
string
getId()
Returns the business rule ID
at line 215
void
setId(string $id)
Sets the business rule ID
at line 226
string
getName()
Returns the business rule name
at line 238
void
setName(string $name)
Sets the business rule name
at line 249
string
getLabel()
Returns the business rule label
at line 261
void
setLabel(string $label)
Sets the business rule label
at line 272
string
getConditions()
Returns the business rule conditions
at line 284
void
setConditions(string $conditions)
Sets the business rule conditions
at line 295
Connector
getConnector()
Returns the Connector object of this business rule
at line 307
void
setConnector(Connector $connector)
Sets the Connector object of this business rule
at line 318
array
getIfActions()
Returns the list of actions that must be executed if the conditions of this business rule are verified.
at line 330
void
setIfActions(array $ifActions)
Sets the list of actions that must be executed if the conditions of this business rule are verified.
at line 342
void
addIfAction(Action $ifAction)
Adds an action to the list of actions that must be executed if the conditions of this business rule are verified.
at line 353
array
getElseActions()
Returns the list of actions that must be executed if the conditions of this business rule are NOT verified.
at line 365
void
setElseActions(array $elseActions)
Sets the list of actions that must be executed if the conditions of this business rule are NOT verified.
at line 377
void
addElseAction($elseAction)
Adds an action to the list of actions that must be executed if the conditions of this business rule are NOT verified.
at line 390
string
getExtendedConditions()
Returns the conditions of this business rule in a readable format.
If the business rule has no connector, the conditions are first parsed then optimized.
at line 411
private array
ruleConnector($pconnector)
Transforms a connector into an array of conditions
A connector is either a Condition object or a Connector object
at line 439
protected string
getPlainOperator(string $operator, string $type)
Returns the readable format of an operator
at line 482
protected void
plainConditions(array $ruleData)
Transforms the array of parsed conditions of this business rule into an array of conditions in a readable format
at line 553
protected void
negate(array $ruleData)
Transforms the array of parsed conditions of this business rule into their negative forms
at line 583
protected void
optimize(array $ruleData)
function optimize
at line 610
protected bool
optimizeCond(array $ruleData, Connector $connector)
function optimizeCond
at line 637
protected array
parseConditions()
Parses the conditions of this business rule in an array to be usable by the administration module.
.