Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Rule<T>

Type parameters

  • T

Hierarchy

  • Rule

Index

Properties

Optional action

action: string | ((context: ExecutionContext<T>) => Observable<any>)

the action to run if the action is a string, it will be interpreted as a jsonata expression

Optional afterAction

afterAction: (context: ExecutionContext<T>) => Observable<any>

lifecycle hook after the action has been executing executed

Type declaration

Optional beforeAction

beforeAction: (context: ExecutionContext<T>) => Observable<any>

lifecycle hook before the action is executed

Type declaration

Optional dependencies

dependencies: CompositeDependency<T>

the dependencies of the rule that will be executed

description

description: string

a description of the rule

Optional direction

direction: Direction

whether dependency should be evaluated before action Direction.OutsideIn: rule will run first before its dependency Direction.InsideOut: rule will run first after its dependency

Optional metadata

metadata: Record<string, any>

custom metadata defined by user that will be returned on execution response

name

name: string

the name of the rule

Optional onError

onError: string | ((error: any, context: ExecutionContext<T>) => Observable<any>)

lifecycle hook after the action has error

Optional uniqueBy

uniqueBy: (root: T) => any

by default Jasper Workflow Engine will hash the root object provided to the rule to determine its uniqueness if you don't want the entire object to be considered and want to provide your own uniqueness algorithm, use this extension

example

students are the same if the studentId is the same uniqueBy: (root: Stduent) => root.studentId

example

two apples are identical if the variety and weight are the same uniqueBy: (root: Apple) => ({ variety: root.variety, weight: root.weight })

Type declaration

    • (root: T): any
    • Parameters

      • root: T

      Returns any

Generated using TypeDoc