TaskBuilder
@gravity-rail/sdk / TaskBuilder
Class: TaskBuilder
Extends
Constructors
Constructor
new TaskBuilder(
name,workflow,prompt?,start?,description?):TaskBuilder
Parameters
name
string
workflow
prompt?
string = ''
start?
boolean = false
description?
string = ''
Returns
TaskBuilder
Overrides
WorkspaceBuilderResource.constructor
Properties
_created
_created:
boolean=false
Inherited from
WorkspaceBuilderResource._created
_existed
_existed:
boolean=false
Inherited from
WorkspaceBuilderResource._existed
_id?
optional_id:number
Inherited from
_uuid?
optional_uuid:string
Inherited from
WorkspaceBuilderResource._uuid
description
readonlydescription:string=''
eventRules
readonlyeventRules:WorkspaceBuilderEventRule[] =[]
existingChildIds
readonlyexistingChildIds:Set<number>
Child task ids the server already has, recorded when this task is adopted.
name
readonlyname:string
prompt
readonlyprompt:string=''
start
readonlystart:boolean=false
transitions
readonlytransitions:TaskTransition[] =[]
workflow
readonlyworkflow:WorkflowBuilder
Accessors
appliesWhenExisting
Get Signature
get appliesWhenExisting():
boolean
True when apply() is safe — and required — to run against a resource
that was ADOPTED rather than created.
False by default because most builders create only: re-running their
apply() on an existing resource would make a duplicate. Override it
when apply() is an idempotent full write keyed on stable identities,
which is the only way a re-run can express an EDIT (a removed goal, a
reordered timeline) rather than just an addition.
Returns
boolean
Inherited from
WorkspaceBuilderResource.appliesWhenExisting
id
Get Signature
get id():
number
Server-assigned numeric id — available after apply() or adopt().
Returns
number
Inherited from
isImplicit
Get Signature
get isImplicit():
boolean
True for resources the server creates on our behalf (currently a
journey's Start step). They are kept in the resource list so edges can
reference them, but they are never created, printed, or counted.
Returns
boolean
Inherited from
WorkspaceBuilderResource.isImplicit
uuid
Get Signature
get uuid():
string
Server-assigned uuid — available after apply() or adopt().
Returns
string
Inherited from
Methods
adopt()
adopt(
existing):void
Record the edges an adopted task already carries, so a re-run adds only what is missing.
Parameters
existing
AnyRecord
Returns
void
Overrides
WorkspaceBuilderResource.adopt
apply()
apply(
client):Promise<void>
Parameters
client
Returns
Promise<void>
Overrides
WorkspaceBuilderResource.apply
initialMessage()
initialMessage(
message,suggestions?):TaskBuilder
Parameters
message
string
suggestions?
string[]
Returns
TaskBuilder
matchKey()
matchKey():
string|undefined
Returns
string | undefined
Inherited from
WorkspaceBuilderResource.matchKey
onEnter()
onEnter(
action,params?,name?):TaskBuilder
Parameters
action
string
params?
AnyRecord = {}
name?
string
Returns
TaskBuilder
planLine()
planLine():
string
Returns
string
Overrides
WorkspaceBuilderResource.planLine
transitionsTo()
transitionsTo(
child,when,autoNext?,required?,celCondition?):TaskBuilder
Parameters
child
TaskBuilder
when
string
autoNext?
boolean = false
required?
boolean = false
celCondition?
string
Returns
TaskBuilder