Skip to content

@sebasoft/neuron-js


Defined in: plugins/rules/SimpleRule.ts:6

Represents the base interface for all elements within the rules engine. Elements are the building blocks of scripts, pulses, actions, conditions, and parameters.

Extends ​

Constructors ​

Constructor ​

new SimpleRule(id, type, conditions, actions, options): SimpleRule

Defined in: abstracts/AbstractRule.ts:7

Parameters ​

id ​

string

type ​

string

conditions ​

ConditionInterface<ConditionOptions>[]

actions ​

ActionInterface<ActionOptions>[]

options ​

RuleOptions

Returns ​

SimpleRule

Inherited from ​

AbstractRule.constructor

Properties ​

actions ​

readonly actions: ActionInterface<ActionOptions>[]

Defined in: abstracts/AbstractRule.ts:11

Inherited from ​

AbstractRule.actions


conditions ​

readonly conditions: ConditionInterface<ConditionOptions>[]

Defined in: abstracts/AbstractRule.ts:10

Inherited from ​

AbstractRule.conditions


id ​

readonly id: string

Defined in: abstracts/AbstractElement.ts:7

Unique identifier for the element instance.

Inherited from ​

AbstractRule.id


options ​

readonly options: RuleOptions

Defined in: abstracts/AbstractElement.ts:9

Configuration options specific to this element instance.

Inherited from ​

AbstractRule.options


type ​

readonly type: string

Defined in: abstracts/AbstractElement.ts:8

The registered type name of the element. This type is used by the Registry (Neuron) to look up the correct implementation.

Inherited from ​

AbstractRule.type


TYPE ​

readonly static TYPE: "simple_rule" = "simple_rule"

Defined in: plugins/rules/SimpleRule.ts:7

Methods ​

execute() ​

execute(context): ExecutionResult<void>

Defined in: plugins/rules/SimpleRule.ts:9

Parameters ​

context ​

ExecutionContext

Returns ​

ExecutionResult<void>


toJSON() ​

toJSON(): object

Defined in: plugins/rules/SimpleRule.ts:13

Returns ​

object

Overrides ​

AbstractRule.toJSON


fromJSON() ​

static fromJSON(jsonObject): SimpleRule

Defined in: plugins/rules/SimpleRule.ts:23

Parameters ​

jsonObject ​

RuleInterface

Returns ​

SimpleRule