Class: Agent
Defined in: core/actions/src/coalescing-manager.ts:289
Structure actions.
Extends this class to build new actions behaviors.
Extends
Constructors
Constructor
new Agent():
Agent
Defined in: core/actions/src/workflow-manager.ts:76
Returns
Agent
Inherited from
CoalescingWorkflow.constructor
Properties
agentDbDoc
agentDbDoc:
AgentSchemaInterface<JSONObject,JSONObject>
Defined in: core/actions/src/coalescing-manager.ts:304
dbDoc
dbDoc:
ActionSchemaInterface<{commandName?:string; }, {actions: {[key:string]:object; };currentStepIndex?:number;currentStepName?:string;currentTrackIds:string[];isRollBackPossible:boolean;nTimesCurrentStep:number;oldResult:StepResult[];preserveOldResult:StepResult[];registeredActions:object[];stepsHistory:number[]; },JSONObject>
Defined in: core/actions/src/action-manager.ts:106
Action Database Document
Inherited from
dBSession?
optionaldBSession:ClientSession
Defined in: core/actions/src/workflow-manager.ts:47
Inherited from
defaultAgentSettings
defaultAgentSettings:
object
Defined in: core/actions/src/coalescing-manager.ts:321
cycle
cycle:
object
cycle.frequency
cycle.frequency:
number
defineCallMode
defineCallMode:
"main"|"actionFinding"
Defined in: core/actions/src/workflow-manager.ts:229
Inherited from
CoalescingWorkflow.defineCallMode
docsToSaveAtStepStart
docsToSaveAtStepStart:
Document<any,any,any>[] =[]
Defined in: core/actions/src/workflow-manager.ts:49
Inherited from
CoalescingWorkflow.docsToSaveAtStepStart
dynamicActionFound
dynamicActionFound:
Action
Defined in: core/actions/src/workflow-manager.ts:241
Inherited from
CoalescingWorkflow.dynamicActionFound
dynamicActionToFound
dynamicActionToFound:
ActionSchemaInterface
Defined in: core/actions/src/workflow-manager.ts:240
Inherited from
CoalescingWorkflow.dynamicActionToFound
executingDefine
executingDefine:
boolean=false
Defined in: core/actions/src/workflow-manager.ts:228
Inherited from
CoalescingWorkflow.executingDefine
executor?
optionalexecutor:Executor
Defined in: core/actions/src/action-manager.ts:40
Specify an executor in which all actions of this class will run.
Inherited from
IArgument
IArgument:
object
Defined in: core/actions/src/coalescing-manager.ts:292
Action argument
commandName?
optionalcommandName:string
Overrides
IBag
IBag:
object
Defined in: core/actions/src/workflow-manager.ts:53
Action bag
actions
actions:
object
Index Signature
[key: string]: object
currentStepIndex?
optionalcurrentStepIndex:number
currentStepName?
optionalcurrentStepName:string
currentTrackIds
currentTrackIds:
string[]
isRollBackPossible
isRollBackPossible:
boolean
nTimesCurrentStep
nTimesCurrentStep:
number
oldResult
oldResult:
StepResult[]
preserveOldResult
preserveOldResult:
StepResult[]
registeredActions
registeredActions:
object[]
stepsHistory
stepsHistory:
number[]
Inherited from
IInfo
IInfo:
JSONObject
Defined in: core/actions/src/coalescing-manager.ts:302
IOutput
IOutput:
JSONObject
Defined in: core/actions/src/coalescing-manager.ts:301
IResult
IResult:
JSONObject
Defined in: core/actions/src/coalescing-manager.ts:299
Action result
Overrides
isExecutorSet
isExecutorSet:
boolean=false
Defined in: core/actions/src/action-manager.ts:497
Inherited from
CoalescingWorkflow.isExecutorSet
isInitialized
isInitialized:
boolean=false
Defined in: core/actions/src/action-manager.ts:482
Inherited from
CoalescingWorkflow.isInitialized
mapRefWithStrategy
mapRefWithStrategy:
Map<string,"default"|"cross-workflow">
Defined in: core/actions/src/coalescing-manager.ts:90
Inherited from
CoalescingWorkflow.mapRefWithStrategy
noConcurrencyCommandNames
noConcurrencyCommandNames:
string[]
Defined in: core/actions/src/coalescing-manager.ts:368
notifyHealthPromise
notifyHealthPromise:
Promise<any> =undefined
Defined in: core/actions/src/action-manager.ts:945
Send a signal to indicate that the action is still in progress.. Useful for preventing timeouts when the action's duration is long but not precisely predictable.
Inherited from
CoalescingWorkflow.notifyHealthPromise
registeredActionIds
registeredActionIds:
any[] =[]
Defined in: core/actions/src/workflow-manager.ts:507
Inherited from
CoalescingWorkflow.registeredActionIds
resolveDefineIteration()
resolveDefineIteration: (
actionState?) =>void
Defined in: core/actions/src/workflow-manager.ts:275
Parameters
actionState?
Returns
void
Inherited from
CoalescingWorkflow.resolveDefineIteration
runtime
runtime:
ActionRuntime=ActionRuntime.activeRuntime
Defined in: core/actions/src/action-manager.ts:42
Inherited from
steps
steps:
Step[] =[]
Defined in: core/actions/src/workflow-manager.ts:51
Inherited from
version
version:
string='1.0.0'
Defined in: core/actions/src/coalescing-manager.ts:366
cronDefaultSettings
staticcronDefaultSettings:object
Defined in: core/actions/src/action-manager.ts:82
Configure the frequency at which a cron will launch Action.resume. It is also possible to dynamically modify the dbDoc.cronActivity property to modify the call to a cron. If not set, this property will be 'inherited' from the first parent class where it is.
activityFrequency
activityFrequency:
number
Inherited from
CoalescingWorkflow.cronDefaultSettings
defaultDelay
staticdefaultDelay:number=Infinity
Defined in: core/actions/src/workflow-manager.ts:43
Shortcut to [ActionState.IN_PROGRESS].
If not set, this property will be 'inherited' from the first parent class where it is.
Inherited from
CoalescingWorkflow.defaultDelay
defaultDelays
staticdefaultDelays:object
Defined in: core/actions/src/action-manager.ts:70
For the states ActionState.EXECUTING_MAIN and ActionState.IN_PROGRESS,
this object configures the time after which, if no change happened, an action is considered in error.
For example, an action can only be in the ActionState.IN_PROGRESS state for as long as
defaultDelays[ActionState.IN_PROGRESS] time.
1?
optional1:number
2?
optional2:number
Default Value
{
[ActionState.IN_PROGRESS]: this.defaultDelay,
[ActionState.EXECUTING_MAIN]: 2*60*1000,
}
You should configure this if your actions have longer timeouts.
If not set, this property will be 'inherited' from the first parent class where it is.
Inherited from
CoalescingWorkflow.defaultDelays
permanentRef
staticpermanentRef:string|string[]
Defined in: core/actions/src/action-manager.ts:35
Id of the action stored in database. It should be a permanent id that designates the action instance.
Inherited from
CoalescingWorkflow.permanentRef
Accessors
_id
Get Signature
get _id():
this["dbDoc"]["_id"]
Defined in: core/actions/src/action-manager.ts:157
Returns
this["dbDoc"]["_id"]
Inherited from
argument
Get Signature
get argument():
this["dbDoc"]["argument"]
Defined in: core/actions/src/action-manager.ts:121
Returns
this["dbDoc"]["argument"]
Set Signature
set argument(
argument):void
Defined in: core/actions/src/action-manager.ts:125
Parameters
argument
this["dbDoc"]["argument"]
Returns
void
Inherited from
bag
Get Signature
get bag():
this["dbDoc"]["bag"]
Defined in: core/actions/src/action-manager.ts:112
Returns
this["dbDoc"]["bag"]
Set Signature
set bag(
bag):void
Defined in: core/actions/src/action-manager.ts:116
Parameters
bag
this["dbDoc"]["bag"]
Returns
void
Inherited from
cronActivity
Get Signature
get cronActivity():
this["dbDoc"]["cronActivity"]
Defined in: core/actions/src/action-manager.ts:148
Returns
this["dbDoc"]["cronActivity"]
Set Signature
set cronActivity(
cronActivity):void
Defined in: core/actions/src/action-manager.ts:152
Parameters
cronActivity
this["dbDoc"]["cronActivity"]
Returns
void
Inherited from
CoalescingWorkflow.cronActivity
repeat
Get Signature
get repeat():
this["dbDoc"]["repeat"]
Defined in: core/actions/src/action-manager.ts:139
Returns
this["dbDoc"]["repeat"]
Set Signature
set repeat(
repeat):void
Defined in: core/actions/src/action-manager.ts:143
Parameters
repeat
this["dbDoc"]["repeat"]
Returns
void
Inherited from
result
Get Signature
get result():
this["dbDoc"]["result"]
Defined in: core/actions/src/action-manager.ts:130
Returns
this["dbDoc"]["result"]
Set Signature
set result(
result):void
Defined in: core/actions/src/action-manager.ts:134
Parameters
result
this["dbDoc"]["result"]
Returns
void
Inherited from
Methods
_resume()
_resume():
any
Defined in: core/actions/src/action-manager.ts:636
The function resumes the action by calling the appropriate function depending on the current state of the action. It doesn't take into account the executor.
Returns
any
A promise. You can not rely on this to know when an action is finished.
Inherited from
activityLogs()
activityLogs(
options):any[] |Promise<any[]>
Defined in: core/actions/src/action-manager.ts:790
Parameters
options
any
Returns
any[] | Promise<any[]>
Inherited from
CoalescingWorkflow.activityLogs
breakAndReject()
breakAndReject(
result):RejectAction
Defined in: core/actions/src/workflow-manager.ts:200
Parameters
result
any
Returns
Inherited from
CoalescingWorkflow.breakAndReject
breakAndReturn()
breakAndReturn(
result):ResolveAction
Defined in: core/actions/src/workflow-manager.ts:193
Parameters
result
any
Returns
Inherited from
CoalescingWorkflow.breakAndReturn
clone()
clone():
any
Defined in: core/actions/src/action-manager.ts:914
Clone the action.
Returns
any
a new action with the same argument
Inherited from
createAgentDoc()
createAgentDoc():
Promise<AgentSchemaInterface<JSONObject,JSONObject>>
Defined in: core/actions/src/coalescing-manager.ts:327
Returns
Promise<AgentSchemaInterface<JSONObject, JSONObject>>
define()
define():
Promise<any>
Defined in: core/actions/src/coalescing-manager.ts:385
Defines the workflow logic.
Called multiple times for a single workflow process.
Use the do method to apply mutating operations.
Returns
Promise<any>
Promise that resolves with an argument of type this['IResult'].
Overrides
defineCycle()
defineCycle():
void
Defined in: core/actions/src/coalescing-manager.ts:364
Returns
void
defineDynamicAction()
defineDynamicAction(
actionDb):Promise<Action>
Defined in: core/actions/src/workflow-manager.ts:243
Parameters
actionDb
Returns
Promise<Action>
Inherited from
CoalescingWorkflow.defineDynamicAction
defineInstall()
defineInstall():
void
Defined in: core/actions/src/coalescing-manager.ts:362
Returns
void
defineUninstall()
defineUninstall():
void
Defined in: core/actions/src/coalescing-manager.ts:456
Returns
void
defineUpdate()
defineUpdate():
void
Defined in: core/actions/src/coalescing-manager.ts:454
Returns
void
digest()
digest():
Promise<ScopeOfChanges<string>[]>
Defined in: core/actions/src/coalescing-manager.ts:445
Returns
Promise<ScopeOfChanges<string>[]>
do()
Call Signature
do<
T>(ref,action):DoPromise<T["IResult"]>
Defined in: core/actions/src/workflow-manager.ts:524
Executes an action in the workflow. If the action already exists, it will be tracked and resumed. If not, it will be started.
Type Parameters
T
T extends Action
Parameters
ref
string
the step reference of the action to execute
action
T
Returns
DoPromise<T["IResult"]>
a promise that resolves with the result of the action
Inherited from
Call Signature
do<
T>(ref,cb):DoPromise<T>
Defined in: core/actions/src/workflow-manager.ts:534
Executes an action in the workflow. If the action already exists, it will be tracked and resumed. If not, it will be started.
Type Parameters
T
T
Parameters
ref
string
the step reference of the action to execute
cb
() => Promise<T>
a callback that returns a promise
Returns
DoPromise<T>
a promise that resolves with the result of the promise
Inherited from
Call Signature
do(
ref,opts):DoPromise<any>
Defined in: core/actions/src/workflow-manager.ts:547
Executes an action in the workflow. If the action already exists, it will be tracked and resumed. If not, it will be started.
Parameters
ref
string
the step reference of the action to execute
opts
an object containing a pattern of the action to execute
init?
() => Promise<any>
the init method of the action
main
() => ActionState | Promise<ActionState>
the main method of the action
watcher?
() => Promise<ActionState>
the watcher method of the action
Returns
DoPromise<any>
a promise that resolves with the result of the action
Inherited from
Call Signature
do<
T>(ref,opts):any
Defined in: core/actions/src/workflow-manager.ts:565
Executes an action in the workflow. If the action already exists, it will be tracked and resumed. If not, it will be started.
Type Parameters
T
T extends Action
Parameters
ref
string
the step reference of the action to execute
opts
an object containing an instantiation of a dynamic action
dynamicAction
T | () => T
an action or a function that returns an action
Returns
any
a promise that resolves with the result of the action
Inherited from
Call Signature
do<
T>(ref,opts,params?):DoPromise<T>
Defined in: core/actions/src/workflow-manager.ts:571
Executes an action in the workflow. If the action already exists, it will be tracked and resumed. If not, it will be started.
Type Parameters
T
T
Parameters
ref
string
the step reference of the action to execute
opts
Action |
{ init?: () => Promise<any>; main: () => ActionState | Promise<ActionState>; watcher?: () => Promise<ActionState>; }
init?
() => Promise<any>
main
() => ActionState | Promise<ActionState>
watcher?
() => Promise<ActionState>
| { dynamicAction: Action | () => Action; } | () => Promise<any>
params?
nCall
number
Returns
DoPromise<T>
a promise that resolves with the result of the action
Inherited from
dynamicallyDefineFromWorkflowStep()
dynamicallyDefineFromWorkflowStep(
workflow,marker):void
Defined in: core/actions/src/action-manager.ts:312
Parameters
workflow
marker
string
Returns
void
Inherited from
CoalescingWorkflow.dynamicallyDefineFromWorkflowStep
endDigestor()
endDigestor():
Promise<void>
Defined in: core/actions/src/coalescing-manager.ts:462
Returns
Promise<void>
findIfEquivalentActionAlreadyExists()
findIfEquivalentActionAlreadyExists(
ref,action):Promise<ActionSchemaInterface<any,any,any>>
Defined in: core/actions/src/coalescing-manager.ts:91
Parameters
ref
string
action
Returns
Promise<ActionSchemaInterface<any, any, any>>
Inherited from
CoalescingWorkflow.findIfEquivalentActionAlreadyExists
getAgentDoc()
getAgentDoc():
Promise<AgentSchemaInterface<JSONObject,JSONObject>>
Defined in: core/actions/src/coalescing-manager.ts:305
Returns
Promise<AgentSchemaInterface<JSONObject, JSONObject>>
getAgentOutput()
getAgentOutput():
Promise<JSONObject>
Defined in: core/actions/src/coalescing-manager.ts:346
Returns
Promise<JSONObject>
getLogs()
getLogs(
options):Promise<any[]>
Defined in: core/actions/src/action-manager.ts:794
Parameters
options
endTime?
number
Returns
Promise<any[]>
Inherited from
goTo()
goTo(
name,onState):Agent
Defined in: core/actions/src/workflow-manager.ts:185
Parameters
name
string
onState
Returns
Agent
Inherited from
goToStep()
goToStep(
name):ResolveAction
Defined in: core/actions/src/workflow-manager.ts:176
Parameters
name
string
Returns
Inherited from
identity()
identity():
any
Defined in: core/actions/src/coalescing-manager.ts:24
Returns
any
Inherited from
init()
init():
Promise<void>
Defined in: core/actions/src/coalescing-manager.ts:294
Initialize the action from the action stored in the database.
Example: In order to not store secrets in the database, you can set a vault id in the argument and retrieve the secret at the initialization of the action.
Example: You cannot store class object on the database. If your action use complex object, they can be initialized here.
Returns
Promise<void>
Overrides
initialization()
initialization():
Promise<void>
Defined in: core/actions/src/action-manager.ts:489
Mainly used for workflows. Can also complement init(). If it gets too complex, use hooks.
Returns
Promise<void>
Inherited from
CoalescingWorkflow.initialization
internalLog()
internalLog(
message,opts):void
Defined in: core/actions/src/action-manager.ts:855
Log a message in the internal logger.
Parameters
message
string
The message to log.
opts
Options for logging, such as the log level. the final log message will be:
{
actionRef: this.dbDoc.actionRef,
actionId: this.dbDoc._id.toString(),
filter: this.dbDoc.filter,
definedIn: this.dbDoc.definitionFrom.workflow?.toObject(),
timestamp: new Date().toISOString(),
level: opts.level || 'info',
message: message,
}
level
string = 'debug'
Returns
void
Inherited from
CoalescingWorkflow.internalLog
internalLogError()
internalLogError(
err):void
Defined in: core/actions/src/workflow-manager.ts:855
Log an error in the internal logger.
Parameters
err
Error
The error to log. the final log message will be:
{
actionRef: this.dbDoc.actionRef,
actionId: this.dbDoc._id.toString(),
filter: this.dbDoc.filter,
definedIn: this.dbDoc.definitionFrom.workflow?.toObject(),
err: err,
timestamp: new Date().toISOString(),
}
Returns
void
Inherited from
CoalescingWorkflow.internalLogError
isActionActive()
isActionActive(
action):boolean
Defined in: core/actions/src/workflow-manager.ts:217
Parameters
action
Returns
boolean
Inherited from
CoalescingWorkflow.isActionActive
lastOutput()
lastOutput():
Promise<any>
Defined in: core/actions/src/coalescing-manager.ts:141
Returns
Promise<any>
Inherited from
lockCommand()
lockCommand(
commandName):Promise<void>
Defined in: core/actions/src/coalescing-manager.ts:369
Parameters
commandName
string
Returns
Promise<void>
main()
main():
Promise<ActionState>
Defined in: core/actions/src/workflow-manager.ts:319
This method should launched the main action process It is called only one time. It returns a state value.
Returns
Promise<ActionState>
Inherited from
name()
name(
name):Agent
Defined in: core/actions/src/workflow-manager.ts:169
Parameters
name
string
Returns
Agent
Inherited from
next()
next(
cb,opts?):Agent
Defined in: core/actions/src/workflow-manager.ts:92
Parameters
cb
(...args) => void | Action | Action[] | Promise<void | Action | Action[]>
opts?
retry
number
Returns
Agent
Inherited from
notifyHealth()
notifyHealth():
Promise<any>
Defined in: core/actions/src/action-manager.ts:946
Returns
Promise<any>
Inherited from
CoalescingWorkflow.notifyHealth
once()
once(
ref,opts):Promise<unknown>
Defined in: core/actions/src/coalescing-manager.ts:115
Parameters
ref
string
opts
Action |
{ init?: () => Promise<any>; main: () => ActionState | Promise<ActionState>; watcher?: () => Promise<ActionState>; }
init?
() => Promise<any>
main
() => ActionState | Promise<ActionState>
watcher?
() => Promise<ActionState>
| { dynamicAction: Action | () => Action; } | () => Promise<any>
Returns
Promise<unknown>
Inherited from
onComplete()
onComplete(
cb,opts?):Agent
Defined in: core/actions/src/workflow-manager.ts:109
Parameters
cb
(...args) => void | Action | Action[] | Promise<void | Action | Action[]>
opts?
retry
number
Returns
Agent
Inherited from
onError()
onError(
cb,opts?):Agent
Defined in: core/actions/src/workflow-manager.ts:100
Parameters
cb
(...args) => void | Action | Action[] | Promise<void | Action | Action[]>
opts?
retry
number
Returns
Agent
Inherited from
onErrorGoTo()
onErrorGoTo(
name):Agent
Defined in: core/actions/src/workflow-manager.ts:212
Parameters
name
string
Returns
Agent
Inherited from
CoalescingWorkflow.onErrorGoTo
onMainTimeout()
onMainTimeout():
ActionState|Promise<ActionState>
Defined in: core/actions/src/workflow-manager.ts:757
Called in case of timeout in ActionState.EXECUTING_MAIN state.
It can return ActionState.SLEEPING if the process infers
that main() has not run and the action must be retried.
Returns
ActionState | Promise<ActionState>
a ActionState value.
Inherited from
CoalescingWorkflow.onMainTimeout
onSuccessGoTo()
onSuccessGoTo(
name):Agent
Defined in: core/actions/src/workflow-manager.ts:207
Parameters
name
string
Returns
Agent
Inherited from
CoalescingWorkflow.onSuccessGoTo
repeatDo()
Call Signature
repeatDo<
T>(ref,cb,repeat):DoPromise<T>
Defined in: core/actions/src/workflow-manager.ts:714
Repeats a do a number of times.
Type Parameters
T
T
Parameters
ref
string
the step reference of the action to repeat
cb
() => Promise<T>
a callback that returns a promise
repeat
object & object
an object containing the number of times to repeat the action
Returns
DoPromise<T>
a promise that resolves with the result of the last action
Inherited from
Call Signature
repeatDo<
T>(ref,opts,repeat):DoPromise<T>
Defined in: core/actions/src/workflow-manager.ts:719
Repeats a do a number of times.
Type Parameters
T
T
Parameters
ref
string
the step reference of the action to repeat
opts
() => Promise<T>
repeat
object & object
an object containing the number of times to repeat the action
Returns
DoPromise<T>
a promise that resolves with the result of the last action
Inherited from
resolveDynamicActionFinding()
resolveDynamicActionFinding():
void
Defined in: core/actions/src/workflow-manager.ts:242
Returns
void
Inherited from
CoalescingWorkflow.resolveDynamicActionFinding
resume()
resume():
Promise<any>
Defined in: core/actions/src/action-manager.ts:605
The function resumes the action by calling the appropriate executor if needed and then by calling the appropriate function depending on the current state of the action
Returns
Promise<any>
A promise. You can not rely on this to know when an action is finished.
Inherited from
resyncWithDb()
resyncWithDb():
Promise<void>
Defined in: core/actions/src/coalescing-manager.ts:475
Update the current model instance with latest data from database
Returns
Promise<void>
a promise that resolves when the document has been loaded
Overrides
CoalescingWorkflow.resyncWithDb
rollback()
rollback(
cb,opts?):Agent
Defined in: core/actions/src/workflow-manager.ts:160
Parameters
cb
(...args) => void | Action | Action[] | Promise<void | Action | Action[]>
opts?
retry
number
Returns
Agent
Inherited from
save()
save(
params):any
Defined in: core/actions/src/coalescing-manager.ts:47
Save an action in the database. Will then be managed by the worker.
Parameters
params
isNew
boolean = ...
nCall
number = 0
Returns
any
a promise that resolves when the action has been saved
Inherited from
saveAgentOutput()
saveAgentOutput(
output):Promise<void>
Defined in: core/actions/src/coalescing-manager.ts:341
Parameters
output
any
Returns
Promise<void>
setArgument()
setArgument(
args):this
Defined in: core/actions/src/coalescing-manager.ts:351
Set the argument that will be stored in the database.
Once set, the argument of an action should not be modified.
Parameters
args
Omit<this["IArgument"], "commandName">
The argument to set.
Returns
this
Overrides
CoalescingWorkflow.setArgument
setCommand()
setCommand(
commandName):Agent
Defined in: core/actions/src/coalescing-manager.ts:355
Parameters
commandName
AgentCommands<Agent>
Returns
Agent
setExecutor()
Defined in: core/actions/src/action-manager.ts:516
Set the executor for this action. It is called only once when the action is created. If you want to set an executor, you should override this method.
Returns
void | Executor | Promise<void | Executor>
a promise that resolves when you have set the executor is set
Inherited from
CoalescingWorkflow.setExecutor
setFilter()
setFilter(
filter):Agent
Defined in: core/actions/src/action-manager.ts:438
Make filtering actions easier with the filter property.
These filters are stored in database with
the filter property and allow to search for
an action or a group of actions
Parameters
filter
Object
Returns
Agent
Inherited from
setOutput()
setOutput():
Promise<JSONObject>
Defined in: core/actions/src/coalescing-manager.ts:458
Returns
Promise<JSONObject>
setRepeat()
setRepeat(
opts):Agent
Defined in: core/actions/src/action-manager.ts:422
Configure the number of times an action is repeated.
Parameters
opts
4?
number
5?
number
Returns
Agent
Inherited from
setResult()
setResult(...
results):Agent
Defined in: core/actions/src/action-manager.ts:448
Set the action result.
Parameters
results
...any[]
Returns
Agent
Inherited from
startAction()
protectedstartAction(ref,action):Promise<void>
Defined in: core/actions/src/workflow-manager.ts:447
Parameters
ref
string
action
Returns
Promise<void>
Inherited from
CoalescingWorkflow.startAction
startActionTransaction()
protectedstartActionTransaction(ref,action):Promise<any[]>
Defined in: core/actions/src/workflow-manager.ts:410
Parameters
ref
string
action
Returns
Promise<any[]>
Inherited from
CoalescingWorkflow.startActionTransaction
stringifyIdentity()
stringifyIdentity():
string
Defined in: core/actions/src/coalescing-manager.ts:29
Returns
string
Inherited from
CoalescingWorkflow.stringifyIdentity
substitute()
substitute(
otherPendingActionsWithSameIdentity):ActionSchemaInterface<any,any,any>
Defined in: core/actions/src/coalescing-manager.ts:467
Parameters
otherPendingActionsWithSameIdentity
ActionSchemaInterface<any, any, any>[]
Returns
ActionSchemaInterface<any, any, any>
Overrides
toPromise()
protectedtoPromise(ref,dbDoc):DoPromise<unknown>
Defined in: core/actions/src/workflow-manager.ts:488
Parameters
ref
string
dbDoc
Returns
DoPromise<unknown>
Inherited from
trackAction()
trackAction(
ref,action):void
Defined in: core/actions/src/coalescing-manager.ts:133
Parameters
ref
string
action
Returns
void
Inherited from
CoalescingWorkflow.trackAction
transform()
transform(
ref,action):Action
Defined in: core/actions/src/workflow-manager.ts:88
Proxy that will be called before the start of any action. Use this method to transform any action before it is started.
Parameters
ref
string
the step reference of the action to transform
action
the action to transform
Returns
the transformed action
Inherited from
watcher()
watcher():
Promise<IN_PROGRESS|PAUSED>
Defined in: core/actions/src/workflow-manager.ts:762
Watch the action state.
It is called :
- potentially many times when the action is in
IN_PROGRESSstate - one time if the action is in
EXECUTING_MAINstate and the executing_main delay has expired.
Returns
Promise<IN_PROGRESS | PAUSED>
promise
Inherited from
_constructFromDb()
static_constructFromDb(actionDb):Action
Defined in: core/actions/src/action-manager.ts:256
Construct an action from a document stored in the database.
Parameters
actionDb
a document coming from the database
Returns
an action for which dbDoc property is equal to actionDb
Inherited from
CoalescingWorkflow._constructFromDb
_constructFromWorkflow()
static_constructFromWorkflow(dbDoc):Promise<Action>
Defined in: core/actions/src/action-manager.ts:281
Construct an action from a document stored in the database and whose definition depends on a workflow.
Parameters
dbDoc
Returns
Promise<Action>
an action for which dbDoc property is equal to actionDb
Inherited from
CoalescingWorkflow._constructFromWorkflow
constructFromDb()
staticconstructFromDb(actionDb):Promise<Action>
Defined in: core/actions/src/action-manager.ts:304
Construct an action from a document stored in the database.
Parameters
actionDb
a document coming from the database
Returns
Promise<Action>
an action for which dbDoc property is equal to actionDb
Inherited from
CoalescingWorkflow.constructFromDb
findPendingWorkflowUsingAction()
staticfindPendingWorkflowUsingAction(actionDbDoc):Query<ActionSchemaInterface<any,any,any> &object[],ActionSchemaInterface<any,any,any> &object, { },ActionSchemaInterface<any,any,any>>
Defined in: core/actions/src/workflow-manager.ts:822
Parameters
actionDbDoc
Returns
Query<ActionSchemaInterface<any, any, any> & object[], ActionSchemaInterface<any, any, any> & object, { }, ActionSchemaInterface<any, any, any>>
Inherited from
CoalescingWorkflow.findPendingWorkflowUsingAction
reject()
staticreject(result?):RejectAction
Defined in: core/actions/src/action-manager.ts:355
Return a new RejectAction object.
Parameters
result?
any
action result
Returns
new RejectActioninstance
Inherited from
resolve()
staticresolve(result?):ResolveAction
Defined in: core/actions/src/action-manager.ts:344
Return a new ResolveAction object.
Parameters
result?
any
action result
Returns
new ResolveActioninstance
Inherited from
trackActionAsPromise()
statictrackActionAsPromise(action,states):Promise<unknown>
Defined in: core/actions/src/action-manager.ts:926
Track an action until it reaches one of the given states.
Parameters
action
The action to track.
states
ActionState[] = ...
The states to reach.
Returns
Promise<unknown>
A promise that resolves when the action reaches one of the given states. The promise resolves with the state reached.