Rule Methods
Retrieve label (Local)
rule.getLabel();
Retrieves the unique label of the rule.
Returns
String
Get a Remote version of the rule.
rule.asRemote(tx);
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
tx |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
Rule.Remote
Retrieve the when body (Local)
rule.getWhen();
Retrieves the statements that constructs the when body of the rule.
Returns
string
Retrieve the then body (Local)
rule.getThen();
Retrieves the single statement that constructs the then body of the rule.
Returns
string
Rename label
rule.asRemote(Transaction tx).setLabel(String label);
Renames the label of the rule. The new label must remain unqiue.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
label |
The new label to be given to the rule. |
String |
true |
N/A |
Returns
void
Delete rule
rule.asRemote(Transaction tx).delete();
Returns
null
Check if the rule has been deleted
rule.asRemote(Transaction tx).isDeleted();
Returns
boolean
LogicManager
Retrieve a Rule
transaction.logic().getRule(String label);
Retrieves the Rule that has the given label.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
label |
The label of the Rule to create or retrive. |
String |
true |
N/A |
Returns
Create or retrieve a Rule
transaction.logic().putRule(String label, Pattern when, Pattern then);
Creates a new Rule if none exists with the given label, or retrieves the existing one.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
label |
The label of the Rule to create or retrive. |
String |
true |
N/A |
when |
The pattern describing the when body of the rule. |
true |
N/A |
|
then |
The pattern describing the then body of the rule. |
true |
N/A |
Returns
Retrieve label (Local)
rule.label;
Retrieves the unique label of the rule.
Returns
String
Get a Remote version of the rule.
rule.asRemote(tx);
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
tx |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
RemoteRule
Retrieve the when body (Local)
rule.when;
Retrieves the statements that constructs the when body of the rule.
Returns
string
Retrieve the then body (Local)
rule.then;
Retrieves the single statement that constructs the then body of the rule.
Returns
string
Rename label
await rule.asRemote(tx).setLabel(label);
Renames the label of the rule. The new label must remain unqiue.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
label |
The new label to be given to the rule. |
String |
true |
N/A |
Returns
void
Delete rule
await rule.asRemote(tx).delete();
Returns
void
Check if the rule has been deleted
await rule.asRemote(tx).isDeleted();
Returns
boolean
LogicManager
Retrieve a Rule
await transaction.logic().getRule(label);
Retrieves the Rule that has the given label.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
label |
The label of the Rule to create or retrive. |
String |
true |
N/A |
Returns
Create or retrieve a Rule
await transaction.logic().putRule(label, when, then);
Creates a new Rule if none exists with the given label, or retrieves the existing one.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
label |
The label of the Rule to create or retrive. |
String |
true |
N/A |
when |
The when body of the rule to create. |
String |
true |
N/A |
then |
The then body of the rule to create. |
String |
true |
N/A |
Returns
Retrieve label (Local)
rule.get_label()
Retrieves the unique label of the rule.
Returns
String
Get a Remote version of the rule.
rule.as_remote(tx)
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
tx |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
RemoteRule
Retrieve the when body (Local)
rule.get_when()
Retrieves the statements that constructs the when body of the rule.
Returns
string
Retrieve the then body (Local)
rule.get_then()
Retrieves the single statement that constructs the then body of the rule.
Returns
string
Rename label
rule.as_remote(tx).set_label(label)
Renames the label of the rule. The new label must remain unqiue.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
label |
The new label to be given to the rule. |
String |
true |
N/A |
Returns
None
Delete rule
rule.as_remote(tx).delete();
Returns
None
Check if the rule has been deleted
rule.as_remote(tx).is_deleted()
Returns
boolean
LogicManager
Retrieve a Rule
transaction.logic().get_rule(label)
Retrieves the Rule that has the given label.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
label |
The label of the Rule to create or retrive. |
String |
true |
N/A |
Returns
Create or retrieve a Rule
transaction.logic().put_rule(label, when, then)
Creates a new Rule if none exists with the given label, or retrieves the existing one.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
label |
The label of the Rule to create or retrive. |
String |
true |
N/A |
when |
The when body of the rule to create. |
String |
true |
N/A |
then |
The then body of the rule to create. |
String |
true |
N/A |