Documentation
¶
Overview ¶
Package compiler turns a BPMN model into an immutable, integer-indexed CompiledProcess (ADR-0004). Element ids become array indices, topology lives in shared contiguous arrays, and per-type data lives in detail tables, so the runtime hot path is pointer arithmetic with no strings, maps, or locks (invariant I5).
This is the minimal target structure plus a programmatic Builder. The XML parse/resolve/validate front end (compiler.md stages 1–5) is a later milestone; the linearized result here is the shape the engine consumes.
Index ¶
- Constants
- func FirstDynamicJobTypeIndex() int32
- func HasErrors(ps []Problem) bool
- func ReloadNamed(key uint64, version int32, r io.Reader, processId string) (*CompiledProcess, []Problem, error)
- func ReservedJobTypeCount() int32
- func ReservedJobTypes() []string
- func SummarizeProblems(ps []Problem) string
- type AdConfig
- type AdHocDetail
- type AgentParam
- type AgentTaskConfig
- type AgentTool
- type BoundaryEventDetail
- type BoundaryEventKind
- type BpmnType
- type Builder
- func (b *Builder) AddAdConnectorTask(cfg AdConfig) int32
- func (b *Builder) AddAdHocSubProcess(d AdHocDetail) int32
- func (b *Builder) AddAgentConnectorTask(cfg AgentTaskConfig) int32
- func (b *Builder) AddBoundaryCancelEvent(host int32) int32
- func (b *Builder) AddBoundaryCompensationEvent(host int32) int32
- func (b *Builder) AddBoundaryConditionalEvent(host int32, condition *expr.Compiled, interrupting bool) int32
- func (b *Builder) AddBoundaryErrorEvent(host int32, errorCode string) int32
- func (b *Builder) AddBoundaryEscalationEvent(host int32, escalationCode string, interrupting bool) int32
- func (b *Builder) AddBoundaryMessageEvent(host int32, interrupting bool, messageName string, ...) int32
- func (b *Builder) AddBoundarySignalEvent(host int32, interrupting bool, signalName string) int32
- func (b *Builder) AddBoundaryTimerEvent(host int32, interrupting bool, durationNanos int64) int32
- func (b *Builder) AddBoundaryTimerSchedule(host int32, interrupting bool, schedule TimerSchedule) int32
- func (b *Builder) AddBusinessRuleTask(decisionId string, inputs map[string]any, retries int32) (int32, error)
- func (b *Builder) AddBusinessRuleTaskMapped(decisionId, resultVar string, staticInputs map[string]any, ...) (int32, error)
- func (b *Builder) AddCallActivity(calledProcessId string, binding DecisionBinding, ...) int32
- func (b *Builder) AddCancelEndEvent() int32
- func (b *Builder) AddClioQueryTask(connector, subject, reduceSpec, query, resultVar string, retries int32) int32
- func (b *Builder) AddClioReadTask(connector, subject, resultVar string, limit, retries int32) int32
- func (b *Builder) AddClioWriteTask(connector, subject, eventType string, retries int32) int32
- func (b *Builder) AddCompensationEndEvent() int32
- func (b *Builder) AddCompensationThrowEvent() int32
- func (b *Builder) AddConditionalCatchEvent(condition *expr.Compiled) int32
- func (b *Builder) AddCsvConnectorTask(cfg CsvConfig) int32
- func (b *Builder) AddDataInputAssociation(node int32, dataObject, variable string, value *expr.Compiled)
- func (b *Builder) AddDataObject(name, itemType, initialState string, isCollection bool) int32
- func (b *Builder) AddDataOutputAssociation(node int32, dataObject string, value *expr.Compiled, ...)
- func (b *Builder) AddDataStore(name, elementId string) int32
- func (b *Builder) AddDiscordConnectorTask(cfg DiscordConfig) int32
- func (b *Builder) AddEndEvent() int32
- func (b *Builder) AddEntraConnectorTask(cfg EntraConfig) int32
- func (b *Builder) AddErrorEndEvent(errorCode string) int32
- func (b *Builder) AddEscalationEndEvent(escalationCode string) int32
- func (b *Builder) AddEscalationThrowEvent(escalationCode string) int32
- func (b *Builder) AddEventBasedGateway() int32
- func (b *Builder) AddExclusiveGateway() int32
- func (b *Builder) AddGoogleSheetsConnectorTask(cfg GoogleSheetsConfig) int32
- func (b *Builder) AddInclusiveGateway() int32
- func (b *Builder) AddInputMapping(node int32, target string, source *expr.Compiled)
- func (b *Builder) AddJiraConnectorTask(cfg JiraConfig) int32
- func (b *Builder) AddLane(name string, parent int32) int32
- func (b *Builder) AddLdapConnectorTask(cfg LdapConfig) int32
- func (b *Builder) AddLdifConnectorTask(cfg LdifConfig) int32
- func (b *Builder) AddLinkCatchEvent() int32
- func (b *Builder) AddLinkThrowEvent() int32
- func (b *Builder) AddMailConnectorTask(cfg MailConfig) int32
- func (b *Builder) AddMessageCatchEvent(messageName string, correlationKey *expr.Compiled) int32
- func (b *Builder) AddMessageEndEvent(messageName string, correlationKey *expr.Compiled) int32
- func (b *Builder) AddMessageStartEvent(messageName string, correlationKey *expr.Compiled, singletonStart bool) int32
- func (b *Builder) AddMessageThrowEvent(messageName string, correlationKey *expr.Compiled) int32
- func (b *Builder) AddMockupTask(cfg MockupConfig) int32
- func (b *Builder) AddOutputMapping(node int32, target string, source *expr.Compiled)
- func (b *Builder) AddParallelGateway() int32
- func (b *Builder) AddReceiveTask(messageName string, correlationKey *expr.Compiled) int32
- func (b *Builder) AddRemedyConnectorTask(cfg RemedyConfig) int32
- func (b *Builder) AddRestConnectorTask(cfg RestConfig) int32
- func (b *Builder) AddScimConnectorTask(cfg ScimConfig) int32
- func (b *Builder) AddScriptJobTask(jobType, language, source, resultVar string, retries int32) int32
- func (b *Builder) AddScriptTask(e *expr.Compiled, resultVar string) int32
- func (b *Builder) AddSendTask(jobType string, retries int32) int32
- func (b *Builder) AddServiceTask(jobType string, retries int32) int32
- func (b *Builder) AddSharePointConnectorTask(cfg SharePointConfig) int32
- func (b *Builder) AddSignalCatchEvent(signalName string) int32
- func (b *Builder) AddSignalEndEvent(signalName string) int32
- func (b *Builder) AddSignalStartEvent(signalName string) int32
- func (b *Builder) AddSignalThrowEvent(signalName string) int32
- func (b *Builder) AddSoapConnectorTask(cfg SoapConfig) int32
- func (b *Builder) AddSqlConnectorTask(cfg SqlConfig) int32
- func (b *Builder) AddStartEvent() int32
- func (b *Builder) AddSubProcess() int32
- func (b *Builder) AddTask() int32
- func (b *Builder) AddTemisDecisionTask(connector, decisionId, resultVar string, staticInputs map[string]any, ...) (int32, error)
- func (b *Builder) AddTerminateEndEvent() int32
- func (b *Builder) AddTimerCatchEvent(durationNanos int64) int32
- func (b *Builder) AddTimerCatchSchedule(schedule TimerSchedule) int32
- func (b *Builder) AddTimerStartEvent(schedule TimerSchedule) int32
- func (b *Builder) AddUserConnectorTask(cfg UserConnectorConfig) int32
- func (b *Builder) AddUserTask(name, assignee, candidateGroups, formId string, priority int32, ...) int32
- func (b *Builder) AddWebScrapeConnectorTask(cfg WebScrapeConfig) int32
- func (b *Builder) AddWebScrapeExtractionTask(cfg WebScrapeExtractionConfig) int32
- func (b *Builder) Build() (*CompiledProcess, error)
- func (b *Builder) Connect(source, target int32) int32
- func (b *Builder) CurrentScope() int32
- func (b *Builder) PopScope()
- func (b *Builder) PushScope(id int32)
- func (b *Builder) SetAdHocResultCollection(nodeID int32, collection string, element *expr.Compiled)
- func (b *Builder) SetAgentParams(m map[string][]agentParamSpec)
- func (b *Builder) SetCompensationActivityRef(throwNodeID, activityRef int32)
- func (b *Builder) SetCompensationHandler(boundaryNodeID, handlerNodeID int32)
- func (b *Builder) SetDocumentation(text string)
- func (b *Builder) SetElementBpmnId(nodeID int32, bpmnID string)
- func (b *Builder) SetElementDocumentation(nodeID int32, text string)
- func (b *Builder) SetEventSubProcess(nodeID int32, d EventSubProcessDetail)
- func (b *Builder) SetExecutable(v bool)
- func (b *Builder) SetFlowCondition(flowID int32, c *expr.Compiled)
- func (b *Builder) SetFlowDefault(flowID int32)
- func (b *Builder) SetHistoryTtl(nanos int64)
- func (b *Builder) SetInstanceTtl(nanos int64)
- func (b *Builder) SetLane(nodeID, laneIdx int32)
- func (b *Builder) SetMultiInstance(nodeID int32, sequential bool, inputElement, outputCollection string, ...)
- func (b *Builder) SetRepairForm(nodeID int32, formID string)
- func (b *Builder) SetSearchableVariables(names []string)
- func (b *Builder) SetStandardLoop(nodeID int32, testBefore bool, loopMaximum int32, condition *expr.Compiled)
- func (b *Builder) SetStartFormId(id string)
- func (b *Builder) SetTransaction(nodeID int32)
- func (b *Builder) SetVersionTag(s string)
- type BusinessRuleTaskDetail
- type CallActivityDetail
- type CallActivityRef
- type CompensationDetail
- type CompiledDataObject
- type CompiledDataStore
- type CompiledFlow
- type CompiledNode
- type CompiledProcess
- func (p *CompiledProcess) AdHoc(detail int32) *AdHocDetail
- func (p *CompiledProcess) AdHocEntries(id int32) []int32
- func (p *CompiledProcess) BoundaryEvent(detail int32) *BoundaryEventDetail
- func (p *CompiledProcess) BoundaryEvents(id int32) []int32
- func (p *CompiledProcess) BusinessRuleDecisions() []string
- func (p *CompiledProcess) BusinessRuleTask(detail int32) *BusinessRuleTaskDetail
- func (p *CompiledProcess) CallActivities() []CallActivityRef
- func (p *CompiledProcess) CallActivity(detail int32) *CallActivityDetail
- func (p *CompiledProcess) CompensationThrow(detail int32) *CompensationDetail
- func (p *CompiledProcess) Conditional(detail int32) *ConditionalDetail
- func (p *CompiledProcess) ConnectorRefs() []ConnectorRef
- func (p *CompiledProcess) ConnectorTask(detail int32) *ConnectorTaskDetail
- func (p *CompiledProcess) ConnectorTaskOf(id int32) (*ConnectorTaskDetail, error)
- func (p *CompiledProcess) DataInputAssociations(id int32) []DataInputAssociation
- func (p *CompiledProcess) DataObjects() []CompiledDataObject
- func (p *CompiledProcess) DataOutputAssociations(id int32) []DataOutputAssociation
- func (p *CompiledProcess) DataStores() []CompiledDataStore
- func (p *CompiledProcess) Documentation() string
- func (p *CompiledProcess) ElementBpmnId(id int32) string
- func (p *CompiledProcess) ElementDocumentation(id int32) string
- func (p *CompiledProcess) ElementIndexOf(bpmnId string) (int32, bool)
- func (p *CompiledProcess) ErrorEnd(detail int32) *ErrorEndDetail
- func (p *CompiledProcess) Escalation(detail int32) *EscalationDetail
- func (p *CompiledProcess) EventSubProcess(detail int32) *EventSubProcessDetail
- func (p *CompiledProcess) EventSubprocesses(id int32) []int32
- func (p *CompiledProcess) Flow(id int32) *CompiledFlow
- func (p *CompiledProcess) HasConditionalEvents() bool
- func (p *CompiledProcess) HasSearchableVariables() bool
- func (p *CompiledProcess) HistoryTtlNanos() int64
- func (p *CompiledProcess) IOInputs(id int32) []IOMapping
- func (p *CompiledProcess) IOOutputs(id int32) []IOMapping
- func (p *CompiledProcess) InclusiveJoinReach(node int32) NodeSet
- func (p *CompiledProcess) InstanceTtlNanos() int64
- func (p *CompiledProcess) Intern(idx int32) string
- func (p *CompiledProcess) IsEventSubProcess(id int32) bool
- func (p *CompiledProcess) IsExecutable() bool
- func (p *CompiledProcess) IsSearchableVariable(name string) bool
- func (p *CompiledProcess) IsTransaction(id int32) bool
- func (p *CompiledProcess) Lane(idx int32) *LaneDetail
- func (p *CompiledProcess) LanePath(nodeID int32) []string
- func (p *CompiledProcess) MessageCatch(detail int32) *MessageDetail
- func (p *CompiledProcess) MessageStart(detail int32) *MessageDetail
- func (p *CompiledProcess) MessageStartEvents() []MessageStartEvent
- func (p *CompiledProcess) MessageStarts() []MessageDetail
- func (p *CompiledProcess) MessageThrow(detail int32) *MessageDetail
- func (p *CompiledProcess) MockupTask(detail int32) *MockupTaskDetail
- func (p *CompiledProcess) MultiInstance(detail int32) *MultiInstanceDetail
- func (p *CompiledProcess) Node(id int32) *CompiledNode
- func (p *CompiledProcess) NodeConnectorRef(id int32) (ConnectorRef, bool)
- func (p *CompiledProcess) NodeCount() int
- func (p *CompiledProcess) NodeLane(nodeID int32) int32
- func (p *CompiledProcess) Outgoing(id int32) []int32
- func (p *CompiledProcess) ProcessId() string
- func (p *CompiledProcess) ReceivableMessageNames() []string
- func (p *CompiledProcess) ReceiveTask(detail int32) *MessageDetail
- func (p *CompiledProcess) RepairForm(id int32) string
- func (p *CompiledProcess) ResolveJobTypes(intern func(name string) (int32, error)) error
- func (p *CompiledProcess) RootEventSubprocesses() []int32
- func (p *CompiledProcess) ScopeStartEvents(id int32) []int32
- func (p *CompiledProcess) ScriptJobTask(detail int32) *ScriptJobTaskDetail
- func (p *CompiledProcess) ScriptTask(detail int32) *ScriptTaskDetail
- func (p *CompiledProcess) SearchableVariables() []string
- func (p *CompiledProcess) SendTask(detail int32) *ServiceTaskDetail
- func (p *CompiledProcess) ServiceTask(detail int32) *ServiceTaskDetail
- func (p *CompiledProcess) SignalCatch(detail int32) *SignalDetail
- func (p *CompiledProcess) SignalStart(detail int32) *SignalDetail
- func (p *CompiledProcess) SignalStartEvents() []SignalStartEvent
- func (p *CompiledProcess) SignalThrow(detail int32) *SignalDetail
- func (p *CompiledProcess) StartEvents() []int32
- func (p *CompiledProcess) StartFormId() string
- func (p *CompiledProcess) TimerCatch(detail int32) *TimerCatchDetail
- func (p *CompiledProcess) TimerStart(detail int32) *TimerStartDetail
- func (p *CompiledProcess) TimerStartEvents() []TimerStartEvent
- func (p *CompiledProcess) UserTask(detail int32) *UserTaskDetail
- func (p *CompiledProcess) VersionTag() string
- type ConditionalDetail
- type ConnectorRef
- type ConnectorTaskDetail
- type CsvConfig
- type DataInputAssociation
- type DataOutputAssociation
- type DecisionBinding
- type DecisionInputMapping
- type Deployable
- type DiscordConfig
- type EntraConfig
- type ErrorEndDetail
- type EscalationDetail
- type EventSubProcessDetail
- type GoogleSheetsConfig
- type IOMapping
- type JiraConfig
- type LaneDetail
- type LdapConfig
- type LdifConfig
- type MailConfig
- type MessageDetail
- type MessageStartEvent
- type MockupConfig
- type MockupTaskDetail
- type MultiInstanceDetail
- type NodeSet
- type Problem
- type RemedyConfig
- type RestAuth
- type RestConfig
- type RestExpr
- type RestKV
- type ScimConfig
- type ScrapeField
- type ScriptJobTaskDetail
- type ScriptTaskDetail
- type ServiceTaskDetail
- type Severity
- type SharePointConfig
- type SignalDetail
- type SignalStartEvent
- type SoapConfig
- type SqlConfig
- type TimerCatchDetail
- type TimerSchedule
- func (s TimerSchedule) FirstDue(now int64) int64
- func (s TimerSchedule) IsFeel() bool
- func (s TimerSchedule) NextDue(now int64) (int64, bool)
- func (s TimerSchedule) Repeats() bool
- func (s TimerSchedule) ResolveConstant() (TimerSchedule, error)
- func (s TimerSchedule) ResolveFeel(text string) (TimerSchedule, bool)
- func (s TimerSchedule) ResolveFeelValue(v expr.Value) (TimerSchedule, bool)
- type TimerScheduleKind
- type TimerStartDetail
- type TimerStartEvent
- type UserConnectorConfig
- type UserTaskDetail
- type ValidationError
- type WebScrapeConfig
- type WebScrapeExtractionConfig
- type WebScrapeFieldConfig
- type WebScrapeFormat
Constants ¶
const ( RuleReachability = "reachability" RuleGatewayNoOutgoing = "gateway.no-outgoing" RuleGatewayNoIncoming = "gateway.no-incoming" RuleGatewayMultipleDefault = "gateway.multiple-default" RuleGatewayMissingDefault = "gateway.missing-default" RuleBoundaryIncomingFlow = "boundary.incoming-flow" RuleBoundaryInvalidHost = "boundary.invalid-host" RuleFlowCrossScope = "flow.cross-scope" // RuleAgentTool marks a tool of an agent-driven ad-hoc that gives the model nothing to // go on: an entry activity with no <bpmn:documentation>, so the model is told the tool // exists and not what it is for (ADR-0253). A // warning, not an error: the tool still runs, and a model that guesses well enough is // not an unrunnable model — but it is one nobody can predict. RuleAgentTool = "agent.tool" // RuleErrorUnhandled marks an error end event with no statically matching enclosing // error boundary or error event subprocess in the same process (ADR-0089). A warning, // not an error: the catch may live at a call-activity caller one process cannot see, // and the runtime incident is the real terminal for a truly uncaught error. RuleErrorUnhandled = "error.unhandled" // RuleCancelEndOutsideTransaction marks a cancel end event whose enclosing scope is not a // transaction — an error, since BPMN allows a cancel end only within a <transaction> (ADR-0108). RuleCancelEndOutsideTransaction = "cancel.end-outside-transaction" // RuleCancelBoundaryInvalidHost marks a cancel boundary attached to something other than a // transaction — an error, since a cancel boundary may attach only to a <transaction> (ADR-0108). RuleCancelBoundaryInvalidHost = "cancel.boundary-invalid-host" // RuleTransactionNoCancelBoundary marks a transaction that has a cancel end event but no // cancel boundary (ADR-0108). A warning: the cancellation tears the transaction down with // no recovery route, usually a modeling mistake, but not structurally invalid. RuleTransactionNoCancelBoundary = "transaction.no-cancel-boundary" // RuleEventGatewayTarget marks an event-based gateway whose outgoing flow leads to a // non-catch element — an error, since a deferred choice can only race catch events // (message/timer/signal intermediate catch); a task or gateway cannot participate (ADR-0110). RuleEventGatewayTarget = "event-gateway.invalid-target" // RuleTimerStartSchedule marks a timer start event whose constant FEEL schedule cannot be // resolved to a valid duration/date/cycle at deploy (ADR-0111). It is an error: a start // schedule that will not resolve arms nothing, so the process would silently never trigger. // A start-event FEEL schedule is compiler-constant (references no variables, ADR-0056), so it // evaluates the same way at deploy as at arm and can be checked without an instance. RuleTimerStartSchedule = "timer.start-schedule" // RuleLoopUnbounded marks a standard loop whose only bound is its FEEL condition // (ADR-0133): nothing in the model says how often it may run, so a condition that // never turns false loops until the instance is cancelled. A warning, not an error // — such a loop is legal BPMN and often correct — and the engine's safety ceiling // stops a runaway; the warning is what turns the bound into a stated decision. RuleLoopUnbounded = "loop.unbounded" // RuleLoopCounterMapping marks a looping activity whose zeebe:ioMapping writes the // name the loop's own counter uses (ADR-0077/ADR-0133). An error: the mapping lands // in the very scope the engine binds loopCounter into, so it overwrites the fact the // loop reads to know which round just finished — every round then looks like the // first, the loop never reaches its maximum, and it repeats until someone cancels // the instance. Map to a different name and read loopCounter as it is. RuleLoopCounterMapping = "loop.counter-mapping" // RuleDottedTarget marks a model that writes to a variable name containing a dot — // a result variable, an I/O mapping target, a loop's input element or output // collection. An error: Atlas writes a *variable of that name*, it does not write a // field inside a structure, so `customers.gesamtumsatz` silently produces a variable // literally called that beside the `customers` it was meant to extend. The author // finds out by reading the variable list and wondering, which is exactly the kind of // quiet wrong answer a deploy check exists to prevent. RuleDottedTarget = "variable.dotted-target" // RuleVariableShadowsDataObject marks a model that writes a variable under the name // of one of its own data objects. A warning, not an error: it is legal, and one // name for one idea is a reasonable thing to want. But the two are not one thing. // A data object carries a type, a data state and a recorded history; a variable // carries a value. They live in separate records and are written by separate // events, and a FEEL expression can see only the variable — an object is readable // solely through a data input association, which copies it into a variable. So a // write to either leaves the other as it was, and two things drift apart under one // name while every expression in the model quietly means just one of them. RuleVariableShadowsDataObject = "variable.shadows-data-object" )
Rule identifiers are stable machine slugs for the check that produced a Problem, so a UI can group, filter, or link to documentation by rule without parsing the human-readable Message (which is deliberately not a stable API). They are grouped by the three validation families of ROADMAP Milestone 1: reachability, gateway coverage, and scope consistency.
const ( // RuleParse marks a document that will not decode at all, or a model with no // executable process — a model-level failure with no single owning element. RuleParse = "parse" // RuleCompile marks a per-process failure in an earlier compile stage (an // unknown flow reference, a bad FEEL expression) — the pool named nothing the // graph checks could inspect, so its error is surfaced as one Problem instead. RuleCompile = "compile" )
Rule slugs for whole-model dry-run findings that ValidateModel raises outside the per-node graph checks — a fault that stops the compile before a linearized graph exists, so it cannot be anchored the way the graph rules above are.
const AdJobType = "io.atlas.ad"
AdJobType is the reserved job type an Active Directory task carries. AD speaks LDAP, so it dials like the generic LDAP worker, but it adds the AD-specific provisioning primitives the generic worker cannot express: setting a password via unicodePwd over LDAPS, enabling/disabling an account via userAccountControl, and adding/removing a group member incrementally (ADR-0166).
const AdJobTypeIndex int32 = 19
AdJobTypeIndex is the interned index AdJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it twentieth (after the nineteen job types above), so it is always 19. This lets a single in-process AD worker subscribe by one global index across every deployed process, the same way the LDAP worker uses LdapJobTypeIndex (ADR-0166).
const AgentJobType = "io.atlas.ai.agent"
AgentJobType is the reserved job type an agent-driven ad-hoc subprocess creates on the container itself, once per round (ADR-0253). It is not a service-task worker like the ones above: the job does not do the round's work, it *decides* it — the Worker Instance behind it calls the model and completes the job with either the tools to run next or a final answer, and the engine turns that into activations.
const AgentJobTypeIndex int32 = 27
AgentJobTypeIndex is the interned index AgentJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it twenty-eighth, so it is always 27.
const AiTaskJobType = "io.atlas.ai.task"
AiTaskJobType is the reserved job type an AI task carries: one call to a language model, one answer into one variable, no tools and no rounds (ADR-0256). It sits beside AgentJobType rather than inside it because the two are different shapes — a step that asks a question once, and a container whose model chooses what runs — and two shapes that never have to be told apart by looking inside a payload are worth an index. One kind serving several job types is clio's shape already.
const AiTaskJobTypeIndex int32 = 28
AiTaskJobTypeIndex is the interned index AiTaskJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it twenty-ninth, so it is always 28.
const ClioQueryJobType = "io.atlas.clio.query"
ClioQueryJobType is the reserved job type a clio "query" task carries. The in-process clio worker subscribes to it to read projected state (get_state) or run a stored query (run_query) on the configured clio instance and write the result back into the task's result variable (ADR-0036).
const ClioQueryJobTypeIndex int32 = 8
ClioQueryJobTypeIndex is the interned index ClioQueryJobType is guaranteed to occupy: NewBuilder reserves it ninth, so it is always 8.
const ClioReadJobType = "io.atlas.clio.read"
ClioReadJobType is the reserved job type a clio "read" task carries. The in-process clio worker subscribes to it to read a subject's events (read_events) from the configured clio instance and write them back into the task's result variable as a JSON array (ADR-0036).
const ClioReadJobTypeIndex int32 = 9
ClioReadJobTypeIndex is the interned index ClioReadJobType is guaranteed to occupy: NewBuilder reserves it tenth, so it is always 9.
const ClioWriteJobType = "io.atlas.clio.write"
ClioWriteJobType is the reserved job type a clio "write-events" task carries. The in-process clio worker subscribes to it to append the event to the configured clio instance (ADR-0036), the same way the DMN worker subscribes to DMNJobType.
const ClioWriteJobTypeIndex int32 = 7
ClioWriteJobTypeIndex is the interned index ClioWriteJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it eighth, so it is always 7. This lets a single in-process clio worker subscribe by one global index across every deployed process, the same way the DMN worker uses DMNJobTypeIndex — which is what wires the clio worker into the server run loop (ADR-0036).
const CsvImportJobType = "io.atlas.csv-import"
CsvImportJobType is the reserved job type a CSV-import service task carries. An in-process worker parses an uploaded CSV (a `csvText` variable) against a column layout (a `columnConfig` variable, typically set by a preceding script task) into a `rows` collection — so a process ingests and validates a batch of records entirely on the engine, the upload arriving through a user-task form rather than a side-channel endpoint (ADR-0087).
const CsvImportJobTypeIndex int32 = 11
CsvImportJobTypeIndex is the interned index CsvImportJobType is guaranteed to occupy: NewBuilder reserves it twelfth, so it is always 11. A single in-process CSV worker subscribes by this global index across every deployed process, the same way the mail worker uses MailJobTypeIndex.
const DMNJobType = "io.atlas.dmn"
DMNJobType is the reserved job type business rule tasks carry. The in-process DMN worker subscribes to it to pick up decisions for evaluation, the same way an external worker subscribes to a service task's job type.
const DMNJobTypeIndex int32 = 0
DMNJobTypeIndex is the interned index DMNJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it first, so it is always 0. Job type indices are otherwise per-process (interned in build order), which makes a global int32-keyed job runner ambiguous across processes — index 3 could be a service task's type in one process and something else in another. Pinning the DMN type to a single global index lets one in-process DMN worker serve every deployed process without colliding with any service-task type (which always interns to >= 1). See ADR-0014.
const DiscordJobType = "io.atlas.discord"
DiscordJobType is the reserved job type a Discord task carries (ADR-0258). One job type serves every Discord operation — send a message, edit or delete one, read one, list a channel's messages, or open a thread — because they share a bot identity, a credential and an error envelope; the operation is a modeled value rather than a reserved index of its own, as it is for Jira (ADR-0201) and Google Sheets (ADR-0235).
const DiscordJobTypeIndex int32 = 29
DiscordJobTypeIndex is the interned index DiscordJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it thirtieth, so it is always 29. Together with the name it lets a job carry its type as an integer and the in-process Discord worker subscribe by one global index across every deployed process, the same way the Jira worker uses JiraJobTypeIndex.
const EntraJobType = "io.atlas.entra"
EntraJobType is the reserved job type a Microsoft Entra ID task carries. Entra is Graph, so a process could in principle reach it with the REST worker; what this type marks is a task that names a *lifecycle operation* instead of a URL and a JSON fragment, the same argument the AD worker makes against generic LDAP (ADR-0166/0171).
Like the SQL types above it, no in-process handler subscribes to it: the kind is worker-only, so the tenant's client secret never enters the engine.
const EntraJobTypeIndex int32 = 23
EntraJobTypeIndex is the interned index EntraJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it twenty-fourth, so it is always 23.
const GoogleSheetsJobType = "io.atlas.googlesheets"
GoogleSheetsJobType is the reserved job type a Google Sheets task carries (ADR-0235). One job type serves every spreadsheet operation — create a spreadsheet, add a sheet, read, write, append, clear, delete a sheet or trash the file — because they share a credential and an error envelope; the operation is a modeled value rather than a reserved index of its own, as it is for Jira (ADR-0201).
const GoogleSheetsJobTypeIndex int32 = 26
GoogleSheetsJobTypeIndex is the interned index GoogleSheetsJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it twenty-seventh, so it is always 26. Together with the name it lets a job carry its type as an integer and the in-process Google Sheets worker subscribe by one global index across every deployed process, the same way the Jira worker uses JiraJobTypeIndex.
const JiraJobType = "io.atlas.jira"
JiraJobType is the reserved job type a Jira task carries (ADR-0201). One job type serves every Jira operation — create an issue, read one, update, transition, comment, assign, or search — because they share an instance, a credential and an error envelope; the operation is a modeled value rather than a reserved index of its own, as it is for the directory workers (ADR-0153/0154/0166/0172).
const JiraJobTypeIndex int32 = 25
JiraJobTypeIndex is the interned index JiraJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it twenty-sixth, so it is always 25. Together with the name it lets a job carry its type as an integer and the in-process Jira worker subscribe by one global index across every deployed process, the same way the mail worker uses MailJobTypeIndex.
const JsJobType = "io.atlas.script.javascript"
JsJobType is the reserved job type a JavaScript script task carries; the in-process Node worker subscribes to it (ADR-0047), like the PowerShell worker.
const JsJobTypeIndex int32 = 6
JsJobTypeIndex is the interned index JsJobType is guaranteed to occupy: NewBuilder reserves it seventh, so it is always 6, giving the in-process Node worker one global index across every deployed process.
const LdapJobType = "io.atlas.ldap"
LdapJobType is the reserved job type a generic LDAP task carries. Like the REST/SCIM workers it authors its endpoint in the model — the LDAP server URL, bind DN, and target/base DN — and names a server-side secret for the bind password (ADR-0041); the in-process LDAP worker subscribes to it to perform the directory operation (search/add/modify/delete/modify-password) off the hot path (ADR-0154).
const LdapJobTypeIndex int32 = 17
LdapJobTypeIndex is the interned index LdapJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it eighteenth (after the seventeen job types above), so it is always 17. This lets a single in-process LDAP worker subscribe by one global index across every deployed process, the same way the SCIM worker uses ScimJobTypeIndex (ADR-0154).
const LdifJobType = "io.atlas.ldif"
LdifJobType is the reserved job type a directory-file task carries: LDIF (RFC 2849) or DSML v1, read or written (ADR-0171).
It has an in-process handler as well as a worker one, and that is not a lapse from ADR-0164: parsing a file is pure computation with no network and no credential, the same category as a FEEL script or a local DMN evaluation, which that record explicitly leaves in the engine. It is offloadable all the same.
const LdifJobTypeIndex int32 = 24
LdifJobTypeIndex is the interned index LdifJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it twenty-fifth, so it is always 24.
const LoopCounterVariable = "loopCounter"
LoopCounterVariable is the name of the 1-based per-iteration counter a loop binds into each round's own scope (ADR-0077/ADR-0133, matching Zeebe). The engine writes it and reads it back to know which round just finished, so it is the engine's name to own inside a loop: the deploy refuses a model that maps onto it there (loop.counter-mapping), and both sides name it from here rather than repeating the string.
const MailJobType = "io.atlas.mail.send"
MailJobType is the reserved job type an outbound mail task carries. The in-process mail worker subscribes to it to send the model-authored message through a server-registered mail provider off the hot path (ADR-0079), the same way the clio worker subscribes to ClioWriteJobType.
const MailJobTypeIndex int32 = 10
MailJobTypeIndex is the interned index MailJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it eleventh (after the ten job types above), so it is always 10. This lets a single in-process mail worker subscribe by one global index across every deployed process, the same way the REST worker uses RestJobTypeIndex (ADR-0067/0078).
const MariaDBJobType = "io.atlas.mariadb"
MariaDBJobType is the reserved job type a MariaDB (or MySQL) task carries. Statements use ?-style positional placeholders only.
const MariaDBJobTypeIndex int32 = 21
MariaDBJobTypeIndex is the interned index MariaDBJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it twenty-second, so it is always 21.
const MsSqlJobType = "io.atlas.mssql"
MsSqlJobType is the reserved job type a Microsoft SQL Server task carries. Statements use @p1-style placeholders and may bind by name.
const MsSqlJobTypeIndex int32 = 20
MsSqlJobTypeIndex is the interned index MsSqlJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it twenty-first (after the twenty job types above), so it is always 20.
const NumBpmnTypes = numBpmnTypes
NumBpmnTypes is the size a behavior dispatch table indexed by BpmnType needs.
const PostgresJobType = "io.atlas.postgres"
PostgresJobType is the reserved job type a PostgreSQL task carries. Statements use $1-style positional placeholders only.
const PostgresJobTypeIndex int32 = 22
PostgresJobTypeIndex is the interned index PostgresJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it twenty-third, so it is always 22.
const PwshJobType = "io.atlas.script.powershell"
PwshJobType is the reserved job type a PowerShell script task carries. The in-process PowerShell script worker subscribes to it to run the script off the hot path and write its result back, the same way the DMN worker subscribes to DMNJobType (ADR-0047). Each polyglot script language gets its own reserved job type so a customer can deploy and secure only the worker(s) they need.
const PwshJobTypeIndex int32 = 2
PwshJobTypeIndex is the interned index PwshJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it third (after DMN and user tasks), so it is always 2. This lets a single in-process PowerShell worker subscribe by one global index across every deployed process, the same way the DMN worker uses DMNJobTypeIndex (see ADR-0047).
const PythonJobType = "io.atlas.script.python"
PythonJobType is the reserved job type a Python script task carries; the in-process Python worker subscribes to it (ADR-0047), like the PowerShell worker.
const PythonJobTypeIndex int32 = 5
PythonJobTypeIndex is the interned index PythonJobType is guaranteed to occupy: NewBuilder reserves it sixth (after DMN, user tasks, PowerShell, the temis worker, and REST), so it is always 5, giving the in-process Python worker one global index across every deployed process.
const RemedyJobType = "io.atlas.remedy.entry"
RemedyJobType is the reserved job type a BMC Remedy task carries. The in-process Remedy worker subscribes to it to create an entry (e.g. an incident) in a Remedy form through the BMC AR System REST API off the hot path (ADR-0106), the same way the mail worker subscribes to MailJobType. The provider host and credentials live in a server-registered worker, like clio/mail; only the form name and its field values are model-authored.
const RemedyJobTypeIndex int32 = 13
RemedyJobTypeIndex is the interned index RemedyJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it fourteenth (after the thirteen job types above), so it is always 13. This lets a single in-process Remedy worker subscribe by one global index across every deployed process, the same way the mail worker uses MailJobTypeIndex (ADR-0079/0106).
const RestJobType = "io.atlas.http.rest"
RestJobType is the reserved job type an HTTP-REST task carries. The in-process REST worker subscribes to it to call the model-authored REST endpoint off the hot path and write the response back (ADR-0036/0067), the same way the clio worker subscribes to ClioWriteJobType.
const RestJobTypeIndex int32 = 4
RestJobTypeIndex is the interned index RestJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it fifth (after DMN, user tasks, PowerShell, and the temis worker), so it is always 4. This lets a single in-process REST worker subscribe by one global index across every deployed process, the same way the DMN worker uses DMNJobTypeIndex (ADR-0067).
const SafeLoopCeiling = 1000
SafeLoopCeiling is how many runs a standard loop that states no loopMaximum gets before the engine stops it and raises an incident (ADR-0133, amended). It is a safety net for the one construct that can spin on its own — a FEEL loop condition that never turns false — not a semantic limit: a loop that states its own loopMaximum is bounded by that number alone, however large, because the author said it out loud and the deploy validated it. The engine enforces the ceiling; the compiler names it in the loop.unbounded warning, so both read the same number.
const ScimJobType = "io.atlas.scim"
ScimJobType is the reserved job type a SCIM 2.0 task carries. Like the REST worker it authors its endpoint in the model — the SCIM base URL and resource type — and names a server-side secret for authentication (ADR-0041); the in-process SCIM worker subscribes to it to perform the resource operation off the hot path and write the response back, the same way the REST worker subscribes to RestJobType (ADR-0153).
const ScimJobTypeIndex int32 = 16
ScimJobTypeIndex is the interned index ScimJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it seventeenth (after the sixteen job types above), so it is always 16. This lets a single in-process SCIM worker subscribe by one global index across every deployed process, the same way the REST worker uses RestJobTypeIndex (ADR-0153).
SharePointJobType is the reserved job type a SharePoint task carries. The in-process SharePoint worker subscribes to it to create a list item in a model-authored SharePoint site/list through a server-registered SharePoint provider (Microsoft Graph) off the hot path (ADR-0141), the same way the mail worker subscribes to MailJobType.
SharePointJobTypeIndex is the interned index SharePointJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it thirteenth (after the twelve job types above), so it is always 12. This lets a single in-process SharePoint worker subscribe by one global index across every deployed process, the same way the mail worker uses MailJobTypeIndex (ADR-0141).
const SoapJobType = "io.atlas.soap"
SoapJobType is the reserved job type a SOAP / Web Services (WSDL) task carries. Like the REST/SCIM workers it authors its endpoint in the model — the web-service URL, the operation, and the request body — and names a server-side secret for any authentication credential (ADR-0041); the in-process SOAP worker worker subscribes to it to wrap the body in a SOAP envelope, invoke the operation, and parse the response off the hot path (ADR-0165).
const SoapJobTypeIndex int32 = 18
SoapJobTypeIndex is the interned index SoapJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it nineteenth (after the eighteen job types above), so it is always 18. This lets a single in-process SOAP worker subscribe by one global index across every deployed process, the same way the LDAP worker uses LdapJobTypeIndex (ADR-0165).
const TemisDecisionJobType = "io.atlas.temis.decision"
TemisDecisionJobType is the reserved job type a *central* business rule task carries — one whose decision is evaluated by a remote temis service rather than the embedded temis library. The in-process temis decision worker subscribes to it to evaluate the decision off the hot path and write the result back (ADR-0050), the same way the local DMN worker subscribes to DMNJobType.
const TemisDecisionJobTypeIndex int32 = 3
TemisDecisionJobTypeIndex is the interned index TemisDecisionJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it fourth (after DMN, user tasks, and PowerShell), so it is always 3. This lets a single in-process temis worker subscribe by one global index across every deployed process, the same way the DMN worker uses DMNJobTypeIndex (ADR-0050).
const UserConnectorJobType = "io.atlas.user.provision"
UserConnectorJobType is the reserved job type a user-provisioning task carries (ADR-0123). The in-process user-provisioning worker subscribes to it to create, set the password of, or disable an Atlas login through the internal user store off the hot path, the same way the mail worker subscribes to MailJobType. It is gated to the protected system project and opt-in server-side; nothing about the credential is model-authored (there is none — it mutates the local store).
const UserConnectorJobTypeIndex int32 = 15
UserConnectorJobTypeIndex is the interned index UserConnectorJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it sixteenth (after the fifteen job types above), so it is always 15. This lets a single in-process user-provisioning worker subscribe by one global index across every deployed process, the same way the mail worker uses MailJobTypeIndex (ADR-0123).
const UserTaskJobType = "io.atlas.user-task"
UserTaskJobType is the reserved job type user tasks carry. The in-process Tasks app (or an external task client) subscribes to it to list and complete human tasks, the same way the DMN worker subscribes to DMNJobType (ADR-0028).
const UserTaskJobTypeIndex int32 = 1
UserTaskJobTypeIndex is the interned index UserTaskJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it second (after DMN), so it is always 1. This lets the task-list endpoint scan activatable jobs by a single global index, the same way the DMN worker uses DMNJobTypeIndex.
const WebScrapeJobType = "io.atlas.webscrape"
WebScrapeJobType is the reserved job type a web-scraping task carries. The in-process web-scraping worker subscribes to it to fetch a model-authored URL and extract the elements matching a CSS selector off the hot path (ADR-0118), the same way the REST worker subscribes to RestJobType. The URL and selector live in the model (like REST's endpoint); nothing about the target is registry-held.
const WebScrapeJobTypeIndex int32 = 14
WebScrapeJobTypeIndex is the interned index WebScrapeJobType is guaranteed to occupy in every compiled process: NewBuilder reserves it fifteenth (after the fourteen job types above), so it is always 14. This lets a single in-process web-scraping worker subscribe by one global index across every deployed process, the same way the mail worker uses MailJobTypeIndex (ADR-0118).
Variables ¶
This section is empty.
Functions ¶
func FirstDynamicJobTypeIndex ¶ added in v0.3.0
func FirstDynamicJobTypeIndex() int32
FirstDynamicJobTypeIndex is the lowest index available to a model-authored job type (a <zeebe:taskDefinition type>). The engine-wide registry assigns from here up; see [dynamicJobTypeFloor] for why it is not simply one past the reserved range.
func HasErrors ¶
HasErrors reports whether any Problem is error severity — the condition under which a deploy is refused. Warnings alone leave a model deployable.
func ReloadNamed ¶ added in v0.4.0
func ReloadNamed(key uint64, version int32, r io.Reader, processId string) (*CompiledProcess, []Problem, error)
ReloadNamed is ParseNamed for a definition that is already deployed: it compiles the named process *without* the deploy-time validation gate, and returns what that gate would have said about it today alongside the process (ADR-0177).
Validation is a gate on deploying a model, not a condition for running one (I5, see validation.go): the compiled process is identical either way. A definition in a deployment store passed the gate of the day it was deployed and has been running under it since, so re-applying today's rules to it on every restart means a rule added to help authors can take a server down instead — on a model nobody touched, with every other definition and every running instance unreachable behind it. The rule still does its job at deploy, where the author is watching and can fix the model.
The returned Problems are what the gate raised — the full list, warnings included, exactly as ValidationError carries it — and are empty when today's rules do not refuse the model at all, so a caller can report drift on len() > 0. A model that cannot be compiled at all still returns an error: there is no definition to bring back.
func ReservedJobTypeCount ¶ added in v0.3.0
func ReservedJobTypeCount() int32
ReservedJobTypeCount is how many built-in job types exist in this build, and so the exclusive upper bound of the reserved index range. It grows whenever a worker is added, which is exactly why it is not the same number as FirstDynamicJobTypeIndex.
func ReservedJobTypes ¶ added in v0.3.0
func ReservedJobTypes() []string
ReservedJobTypes returns the reserved job-type names in index order, so index i of the result is the job type whose reserved index is i. It returns a copy: the slice is the definition of those indices, and a caller reordering it would re-point every job already written under them.
func SummarizeProblems ¶ added in v0.4.0
SummarizeProblems renders the error-severity Problems into one line — the same reading ValidationError.Error gives a refused deploy, available to a caller that holds the findings rather than the error (the reload path logs them). Warnings are left out: they name a smell, not a reason anything was refused.
Types ¶
type AdConfig ¶ added in v0.3.0
type AdConfig struct {
// Worker is the Console-configured directory this task talks to, or "" for a
// task that carries its own URL and bind DN the old way.
Connector string
URL RestExpr
BindDN RestExpr
BindSecret string
StartTLS bool
Op string
DN RestExpr
MemberDN RestExpr
EntryVar string
NewPassword RestExpr
Retries int32
NewDN RestExpr
// The fields of the two operations that read a subtree rather than acting on one
// entry: sync (a DirSync delta) and search (what is there now). Scope belongs to
// search alone — AD answers DirSync only for the whole subtree — and CookieVar and
// ObjectSecurity to sync alone.
BaseDN RestExpr
Filter RestExpr
Scope string
CookieVar string
ResultVar string
MaxEntries int32
ObjectSecurity bool
}
AdConfig is the deploy-time configuration of an Active Directory task (ADR-0166). URL is the server (ldaps://host:636 — a password set needs LDAPS) and BindDN the bind identity — literal-or-FEEL values; BindSecret names the server-side secret for the bind password (empty → an anonymous bind); StartTLS upgrades a plain ldap:// connection. Op is the operation ("create-user"|"set-password"|"enable"| "disable"|"add-group-member"|"remove-group-member"). DN is the target user or group entry; MemberDN is the member added/removed for the group operations; EntryVar names the process variable holding the create-user attribute object; NewPassword is the set-password value.
type AdHocDetail ¶ added in v0.2.0
type AdHocDetail struct {
CompletionCondition *expr.Compiled
CancelRemaining bool
AgentDriven bool
AgentWorker int32 // interned agent Worker name → index, -1 when not agent-driven
AgentModel int32 // interned language model name → index, -1 → the Worker's own model
// AgentContext are the interned names of the process variables this agent is given,
// in the order they were authored (ADR-0257). Empty means
// the agent knows its goal, its tools and what its own calls returned, and nothing
// of the case it is working on — which is a real design, not an oversight, when its
// tools fetch what it needs.
//
// Names rather than values: what an agent may reach is the diagram (ADR-0253), and
// what it may read is in the diagram for the same reason. A reviewer reads the
// element and sees what leaves the process.
AgentContext []int32
ResultCollection int32 // interned variable name a tool result is appended to, -1 if none
ResultElement *expr.Compiled
Tools []AgentTool
}
AdHocDetail is the per-ad-hoc-subprocess configuration the runtime needs (ADR-0138). CompletionCondition is an optional boolean FEEL expression re-evaluated after each contained activity completes; nil means the ad-hoc completes when its scope drains instead. When it holds, CancelRemaining (the BPMN cancelRemainingInstances default, true) decides whether the still-running contained activities are cancelled. Ordering is always the BPMN default, parallel — every entry activity is activated at once; a model asking for sequential ordering is refused at deploy until that driver lands, so no flag is carried for it.
An **agent-driven** ad-hoc (ADR-0253) inverts the entry rule: entering it activates nothing and creates one job on the container, and the model behind that job picks which contained activity to run. AgentDriven marks it; AgentWorker names the configured agent Worker the job resolves against (ADR-0203); ResultCollection / ResultElement are where a tool call's result is appended, the multi-instance pair exactly (ADR-0077); Tools is the deploy-time index of what the model may choose from. AgentModel names the language model the round asks and is -1 when the container names none, in which case the Worker's configured model is what runs (ADR-0256). The run's limits ride the agent Worker's own configuration (ADR-0117) and are not carried here.
Tools is a slice rather than a span of a shared array like the entry index: it is read once per round, when the container's job is built, and never per token — off the hot path (I1).
type AgentParam ¶ added in v0.5.0
AgentParam is one <atlas:agentParam> declared on a tool activity: a value the model must supply when it calls that tool. It is <atlas:startVariable>'s shape (ADR-0028) one level down — a typed, named, optionally described input — declared at deploy so a tool's schema is compiled rather than recovered from expressions at run time (I5). All string fields are interned indices; Description is -1 when none was given.
type AgentTaskConfig ¶ added in v0.5.0
type AgentTaskConfig struct {
Worker string
Model string
Prompt RestExpr
ResultVar string
Retries int32
}
AgentTaskConfig is the deploy-time configuration of an AI task (ADR-0256): one call to a language model, one answer into one variable. Worker names the agent Worker an operator configured — the endpoint, the credential and the wire format are its business and never enter the model (ADR-0041/0069/0168). Model names the language model to ask and may be empty, in which case the Worker's configured model is what runs. Prompt is the question, a literal-or-FEEL value evaluated over the variables the task sees at call time, and ResultVar is where the answer lands.
type AgentTool ¶ added in v0.5.0
type AgentTool struct {
Element int32 // the contained node's element id
Params []AgentParam
}
AgentTool is one contained entry activity offered to the model as a tool (ADR-0253). It carries no name or description of its own on purpose: the tool's name is the element's BPMN id (CompiledProcess.ElementBpmnId) and its description is the element's own <bpmn:documentation> (ElementDocumentation, ADR-0025) — the sentence a modeler wrote for the next human is the one the model reads, and a second copy could only drift from it.
type BoundaryEventDetail ¶
type BoundaryEventDetail struct {
HostNode int32 // ElementId of the activity this event is attached to
Interrupting bool // true = cancel the host on fire (BPMN cancelActivity); false = run alongside
Kind BoundaryEventKind
Schedule TimerSchedule // BoundaryTimer: when it fires; a cycle (non-interrupting only) recurs (ADR-0054)
MessageName string // BoundaryMessage: the message it subscribes to
CorrelationKey *expr.Compiled // BoundaryMessage: correlation-key expression (ADR-0020)
SignalName string // BoundarySignal: the signal it subscribes to (ADR-0088)
ErrorCode string // BoundaryError: the error code it catches; "" is a catch-all (ADR-0089)
EscalationCode string // BoundaryEscalation: the escalation code it catches; "" is a catch-all (ADR-0125)
Condition *expr.Compiled // BoundaryConditional: the boolean FEEL condition it fires on (ADR-0137)
// CompensationHandler is the ElementId of the compensation handler activity this
// boundary links its host to (BoundaryCompensation, ADR-0103). It is resolved at
// compile time from the BPMN <association> joining the boundary to the handler;
// -1 means unresolved (a compensation boundary with no association — a deploy error).
CompensationHandler int32
}
BoundaryEventDetail is the per-boundary-event data a behavior needs at runtime. A boundary event is attached to a host activity (HostNode) and arms while the host runs; when it fires it either interrupts the host (Interrupting) or spawns a parallel token. The timer fields apply when Kind is BoundaryTimer, the message fields when Kind is BoundaryMessage (ADR-0040).
type BoundaryEventKind ¶
type BoundaryEventKind uint8
BoundaryEventKind discriminates what a boundary event waits on.
const ( BoundaryTimer BoundaryEventKind = iota // waits a fixed duration, then fires BoundaryMessage // waits for a correlating message, then fires BoundarySignal // waits for a broadcast signal by name, then fires (ADR-0088) BoundaryError // catches an error propagating up to it by code, then fires; always interrupting (ADR-0089) BoundaryCompensation // links a host activity to its compensation handler; inert — never armed as an element instance, only read on host completion to record the activity as compensable (ADR-0103) BoundaryCancel // on a transaction only: catches the transaction's cancellation and routes its recovery flow; armed inert like an error boundary, and always interrupting (ADR-0108) BoundaryEscalation // catches an escalation propagating up to it by code, then fires; honors cancelActivity — may be interrupting or non-interrupting (ADR-0125) BoundaryConditional // fires while the host runs when its boolean FEEL condition becomes true; armed inert (no subscription), re-evaluated on variable change; honors cancelActivity — may be interrupting or non-interrupting (ADR-0137) )
type BpmnType ¶
type BpmnType uint8
BpmnType is the kind of a BPMN element. It is stored in element-instance state (as uint8) for O(1) behavior dispatch.
const ( TypeUnspecified BpmnType = iota TypeStartEvent TypeEndEvent TypeServiceTask TypeScriptTask TypeBusinessRuleTask TypeExclusiveGateway TypeTimerCatchEvent TypeMessageCatchEvent TypeMessageThrowEvent TypeTask // an undefined/manual task: no execution semantics, passes straight through TypeParallelGateway // AND gateway: forks a token onto every outgoing flow, joins by waiting for all incoming TypeInclusiveGateway // OR gateway: forks onto every flow whose condition holds, joins by waiting for all that could still arrive TypeMessageStartEvent // a start event that a correlating message instantiates (ADR-0035); at runtime it behaves like a none start (flows straight on) TypeConnectorTask // a service task that delegates to a server-registered worker via the job path (ADR-0036); like a service task it creates a job and waits TypeUserTask // a human task: parks a token, creates a job, waits for a person to complete it via the Tasks app (ADR-0028) TypeBoundaryEvent // a timer/message event attached to a host activity; arms while the host runs and, when it fires, interrupts the host or spawns a parallel token (ADR-0040) TypeScriptJobTask // a script task authored in a general-purpose language (PowerShell, …) that runs via the job path, not inline like a FEEL script task (ADR-0047); like a service task it creates a job and waits TypeTimerStartEvent // a start event that a due timer instantiates on a schedule (duration/date/cycle/cron, ADR-0051); at runtime it behaves like a none start (flows straight on) TypeMessageEndEvent // an end event that publishes a message, then ends the instance (ADR-0052); the send-and-stop counterpart of a message throw event, so it reuses the throw detail table TypeSubProcess // an embedded subprocess: a container that is itself a scope; a token entering it runs its inner start→…→end in a child scope, and it completes when that scope empties (ADR-0074) TypeCallActivity // a call activity: starts a separate process as a child instance, waits for it, then continues; variables pass in/out by mapping (ADR-0076) // TypeEventSubProcessStart is a runtime-only element type: the armed trigger of an // event subprocess (ADR-0082). No compiled node carries it (the handler compiles as // TypeSubProcess); the engine arms one waiting instance per event subprocess in a // scope, and its firing activates the handler. It is excluded from the scope's // active-child counter so it never blocks scope completion. TypeEventSubProcessStart TypeSignalCatchEvent // an intermediate catch event that waits for a broadcast signal by name (ADR-0088) TypeSignalThrowEvent // an intermediate throw event that broadcasts a signal by name to every waiting catch (ADR-0088) TypeSignalEndEvent // an end event that broadcasts a signal, then ends the instance (ADR-0088); reuses the throw detail table TypeSignalStartEvent // a start event that a broadcast signal instantiates (ADR-0088); at runtime it flows straight on like a message start TypeErrorEndEvent // an end event that throws an error, ending its scope abnormally and propagating up to the nearest matching handler (ADR-0089); the send-and-stop counterpart of a BPMN error throw TypeReceiveTask // an activity that waits for a correlating message, then continues (ADR-0102); the message intermediate catch's semantics in task form, so it accepts boundary events, I/O mappings, and multi-instance TypeCompensationThrowEvent // an intermediate throw event that triggers compensation — runs the handlers of completed compensable activities in its scope, or of one named activity (ADR-0103) TypeCompensationEndEvent // an end event that triggers compensation, then ends its scope (ADR-0103); the trigger-and-stop counterpart of a compensation throw, reusing the throw detail table TypeCancelEndEvent // an end event inside a transaction that cancels it: compensates the transaction's completed activities in reverse order, then routes out the transaction's cancel boundary (ADR-0108) TypeEventBasedGateway // a deferred choice: arms every target catch event (message/timer/signal) at once and takes the branch whose event fires first, cancelling the rest (ADR-0110) TypeSendTask // a send task: a job-creating activity identical in execution to a service task (ADR-0112) — it creates a job and waits, reusing ServiceTaskDetail and serviceTaskBehavior; a distinct type only to preserve the send-task identity, like TypeConnectorTask TypeTerminateEndEvent // an end event that ends its enclosing flow scope at once (ADR-0116): it terminates every other live token in the scope (cancelling their jobs), then completes the scope — at the root the instance ends, inside a subprocess that subprocess ends and the parent continues. cancelEndEventBehavior minus compensation and the cancel boundary TypeMockupTask // a service task simulated by the engine itself (ADR-0120): on activation it writes an optional FEEL result and arms a one-shot timer for a random duration, then completes (or, per a fail probability, raises an incident) — no external worker. A distinct type because its execution (timer-wait, no job) differs from a service task, like TypeConnectorTask. TypeEscalationThrowEvent // an intermediate throw event that raises an escalation, propagating up to the nearest matching handler, then continues on its outgoing flow (ADR-0125); the continue-after-throw counterpart of TypeMessageThrowEvent TypeEscalationEndEvent // an end event that raises an escalation, propagating up to the nearest matching handler, then ends its path (ADR-0125); unlike an error end the catch may be non-interrupting and an uncaught escalation is benign (no incident) TypeLinkThrowEvent // a link intermediate throw event: a goto to the link catch of the same name in the same scope (ADR-0133). Resolved at compile to a synthetic sequence flow to the catch; runs as a pass-through (no execution semantics of its own) TypeLinkCatchEvent // a link intermediate catch event: the landing point of a link throw of the same name (ADR-0133). Reached only via the compile-time synthetic flow; runs as a pass-through, flowing on its real outgoing flow TypeConditionalCatchEvent // a conditional intermediate catch event: waits until its boolean FEEL condition over the process's variables becomes true, then flows on (ADR-0137). Arms inert (no subscription) and is driven to Completing by a variable-change re-check; a conditional boundary/event-sub reuses TypeBoundaryEvent/TypeEventSubProcessStart with BoundaryConditional TypeAdHocSubProcess // an ad-hoc subprocess: a container scope whose contained activities run on demand, in any order, zero or more times — not driven by sequence flow from a start event (ADR-0138). On entry it activates every entry activity (a contained node with no incoming flow) at once; after each contained activity completes an optional boolean FEEL completion condition is re-evaluated, and the first time it holds the remaining work is cancelled and the ad-hoc completes (else it completes on scope-drain) )
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder constructs a CompiledProcess programmatically. It stands in for the XML parse/resolve/linearize pipeline until that front end exists: callers add nodes and flows, and Build linearizes them into the immutable form (assigning the shared topology array, detail tables, and start-event list).
func NewBuilder ¶
NewBuilder starts a builder for the process definition identified by key. It reserves the DMN job type as the first interned string so it always occupies DMNJobTypeIndex (0), giving the in-process DMN worker a stable, collision-free job type across every deployed process (see DMNJobTypeIndex).
func (*Builder) AddAdConnectorTask ¶ added in v0.3.0
AddAdConnectorTask adds an Active Directory task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved AdJobType so the in-process AD worker picks it up, evaluates any FEEL url/dn values over the instance's variables, binds, performs the AD operation (create-user / set-password via unicodePwd / enable / disable via userAccountControl / group-member add or remove), and completes the job (ADR-0166). The server and DNs live in the model; the bind password never does (BindSecret references a server-side secret, ADR-0041).
func (*Builder) AddAdHocSubProcess ¶ added in v0.2.0
func (b *Builder) AddAdHocSubProcess(d AdHocDetail) int32
AddAdHocSubProcess adds an ad-hoc subprocess container node and returns its element id (ADR-0138). Like an embedded subprocess it is a scope whose inner flow lives in the flat node/flow arrays — create it first, then PushScope(its id) before adding its children — but its contained activities are not sequenced from a start event: on entry the runtime activates every entry activity (a contained node with no incoming flow) at once. d carries the optional FEEL completion condition, the cancel-remaining flag, and the ordering.
func (*Builder) AddAgentConnectorTask ¶ added in v0.5.0
func (b *Builder) AddAgentConnectorTask(cfg AgentTaskConfig) int32
AddAgentConnectorTask adds an AI task and returns its element id. Like every other connector task it creates a job on activation and waits; the job carries the reserved AiTaskJobType, which nothing in the engine subscribes to — the kind is worker-only (ADR-0164), so the job waits for the Worker Instance holding the provider's credential, which asks the model once and completes the job with the answer as a variable.
It is deliberately not AgentJobType. That job type is a *round* on an ad-hoc container, whose completion carries tool calls the engine turns into activations (ADR-0253/0254); this one's completion is variables, so the ordinary job handler serves it. Telling the two apart by an index rather than by looking inside a payload is the point.
A task naming no model interns to -1, which the builder's own interner already does for the empty string — and -1 is the answer "ask whatever the Worker is configured for", not "ask the model called empty string". They are different questions and only one of them is one anyone asked.
func (*Builder) AddBoundaryCancelEvent ¶
AddBoundaryCancelEvent adds a cancel boundary event attached to host (a transaction): it catches the transaction's cancellation and routes its recovery flow. Armed inert like an error boundary and always interrupting (ADR-0108). Returns its element id.
func (*Builder) AddBoundaryCompensationEvent ¶
AddBoundaryCompensationEvent adds a compensation boundary event attached to host: an inert marker (never armed as an element instance) that makes the host compensable and links it to a compensation handler, resolved later from a BPMN <association> via SetCompensationHandler (ADR-0103). CompensationHandler starts unresolved (-1). Returns its element id.
func (*Builder) AddBoundaryConditionalEvent ¶ added in v0.2.0
func (b *Builder) AddBoundaryConditionalEvent(host int32, condition *expr.Compiled, interrupting bool) int32
AddBoundaryConditionalEvent adds a conditional boundary event attached to host that fires while the host runs when the given boolean FEEL condition becomes true (ADR-0137). It honors interrupting: an interrupting conditional boundary tears the host down on fire, a non-interrupting one runs the handler alongside the still-running host. It opens no subscription and is re-evaluated on variable change. Returns its element id.
func (*Builder) AddBoundaryErrorEvent ¶
AddBoundaryErrorEvent adds an error boundary event attached to host that catches an error propagating up to the host whose code matches errorCode ("" is a catch-all). An error boundary is always interrupting (ADR-0089): it opens no subscription and waits only to be found by propagation. Returns its element id.
func (*Builder) AddBoundaryEscalationEvent ¶ added in v0.2.0
func (b *Builder) AddBoundaryEscalationEvent(host int32, escalationCode string, interrupting bool) int32
AddBoundaryEscalationEvent adds an escalation boundary event attached to host that catches an escalation propagating up to the host whose code matches escalationCode ("" is a catch-all). Unlike an error boundary it honors interrupting: an interrupting escalation boundary tears the host down on fire, a non-interrupting one runs the handler alongside the still-running host (ADR-0125). It opens no subscription and waits only to be found by propagation. Returns its element id.
func (*Builder) AddBoundaryMessageEvent ¶
func (b *Builder) AddBoundaryMessageEvent(host int32, interrupting bool, messageName string, correlationKey *expr.Compiled) int32
AddBoundaryMessageEvent adds a message boundary event attached to host that fires when a message named messageName correlates on key. interrupting mirrors BPMN cancelActivity (ADR-0040). Returns its element id.
func (*Builder) AddBoundarySignalEvent ¶
AddBoundarySignalEvent adds a signal boundary event attached to host that fires when a signal named signalName is broadcast (ADR-0088). interrupting mirrors BPMN cancelActivity. Returns its element id.
func (*Builder) AddBoundaryTimerEvent ¶
AddBoundaryTimerEvent adds a timer boundary event attached to host, firing after durationNanos. interrupting mirrors BPMN cancelActivity: true cancels the host when it fires, false spawns a parallel token (ADR-0040). Returns its element id. It is the duration convenience over AddBoundaryTimerSchedule.
func (*Builder) AddBoundaryTimerSchedule ¶
func (b *Builder) AddBoundaryTimerSchedule(host int32, interrupting bool, schedule TimerSchedule) int32
AddBoundaryTimerSchedule adds a timer boundary event firing on the given compiled schedule. A cycle schedule on a non-interrupting boundary recurs — a repeating reminder (ADR-0054). Returns its element id.
func (*Builder) AddBusinessRuleTask ¶
func (b *Builder) AddBusinessRuleTask(decisionId string, inputs map[string]any, retries int32) (int32, error)
AddBusinessRuleTask adds a business rule task that evaluates the named DMN decision with the given static input context, and returns its element id. It is the constant-input form of Builder.AddBusinessRuleTaskMapped (no variable mappings, result discarded).
func (*Builder) AddBusinessRuleTaskMapped ¶
func (b *Builder) AddBusinessRuleTaskMapped(decisionId, resultVar string, staticInputs map[string]any, mappings []DecisionInputMapping, retries int32, binding DecisionBinding) (int32, error)
AddBusinessRuleTaskMapped adds a business rule task that evaluates the named DMN decision and returns its element id. Its input context is built from two layers the DMN worker merges at evaluation time: staticInputs is a constant base (JSON-encoded and interned at deploy time, never on the hot path — invariant I5), and mappings are variable-driven inputs (FEEL expressions evaluated over the instance's variables) that override a static input of the same name. If resultVar is non-empty the decision's result is written back into that process variable on job completion; an empty resultVar discards the result. It returns an error if the static inputs cannot be encoded.
func (*Builder) AddCallActivity ¶
func (b *Builder) AddCallActivity(calledProcessId string, binding DecisionBinding, propagateAllParent, propagateAllChild bool) int32
AddCallActivity adds a call activity that starts the process with the given bpmn id as a child instance, under the given binding and variable-propagation flags (ADR-0076), and returns its element id. The called process id is interned; the called def key is resolved at deploy/runtime, not here.
func (*Builder) AddCancelEndEvent ¶
AddCancelEndEvent adds a cancel end event: an end event inside a transaction that cancels it — compensating the transaction's completed activities in reverse order, then routing out the transaction's cancel boundary (ADR-0108). It carries no detail (a cancel always compensates the whole transaction). Returns its element id.
func (*Builder) AddClioQueryTask ¶
func (b *Builder) AddClioQueryTask(connector, subject, reduceSpec, query, resultVar string, retries int32) int32
AddClioQueryTask adds a clio "query" task and returns its element id. It reads from the named worker's clio instance and writes the result into resultVar. When query is non-empty the worker runs it as a run_query; otherwise it reads get_state for subject (with the optional reduceSpec projection). Like a service task it creates a job on activation carrying the reserved ClioQueryJobType and waits for the in-process clio worker to complete it (ADR-0036).
func (*Builder) AddClioReadTask ¶
AddClioReadTask adds a clio "read" task and returns its element id. It reads subject's events (up to limit; 0 = the worker's default) from the named worker's clio instance and writes them into resultVar as a JSON array. Like a service task it creates a job on activation carrying the reserved ClioReadJobType and waits for the in-process clio worker to complete it (ADR-0036).
func (*Builder) AddClioWriteTask ¶
AddClioWriteTask adds a clio "write-events" task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved ClioWriteJobType so the in-process clio worker picks it up, appends an event to the named worker's clio instance under subject with the given event type, and completes the job (ADR-0036).
func (*Builder) AddCompensationEndEvent ¶
AddCompensationEndEvent adds an end event that triggers compensation, then ends its scope — the trigger-and-stop counterpart of a compensation throw, reusing the throw detail table like a signal end event (ADR-0103). Returns its element id.
func (*Builder) AddCompensationThrowEvent ¶
AddCompensationThrowEvent adds an intermediate throw event that, on activation, triggers compensation — running the handlers of completed compensable activities in its scope (or of the single activity later set via SetCompensationActivityRef) — then flows on (ADR-0103). ActivityRef defaults to -1 (compensate the whole scope). Returns its element id.
func (*Builder) AddConditionalCatchEvent ¶ added in v0.2.0
AddConditionalCatchEvent adds a conditional intermediate catch event that waits until the given boolean FEEL condition over the process's variables becomes true, then flows on (ADR-0137). It arms inert (opens no subscription) and is driven to Completing by a variable-change re-check. Returns its element id.
func (*Builder) AddCsvConnectorTask ¶ added in v0.2.0
AddCsvConnectorTask adds a CSV-to-JSON task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved CsvImportJobType so the in-process CSV worker picks it up, reads the raw text from the named source variable, parses it against the authored delimiter/header/columns with the same parser the ingestion endpoint uses, and writes the JSON rows (and a rowCount) into the result variable (ADR-0139). The layout lives in the model — unlike the ADR-0087 convention, which read it from a columnConfig variable — so nothing but the file arrives at runtime.
func (*Builder) AddDataInputAssociation ¶
func (b *Builder) AddDataInputAssociation(node int32, dataObject, variable string, value *expr.Compiled)
AddDataInputAssociation attaches a data-input association to activity node: when the activity activates, the engine reads the data object named dataObject (bound into the FEEL scope under its name), evaluates value (a FEEL transform over the instance's variables and that object, nil to copy the object's value verbatim), and writes the result into the process variable named variable, which the activity then reads (ADR-0059). Build groups a node's associations into a shared array.
func (*Builder) AddDataObject ¶
AddDataObject declares a data object on the process: a typed, named datum with an optional declared structure (itemType) and initial data state, seeded under each instance's scope at creation (ADR-0053). It is not a flow node, so it returns the index of the entry in the data-object table, not an element id. Empty itemType or initialState intern to -1 (Intern maps that back to "").
func (*Builder) AddDataOutputAssociation ¶
func (b *Builder) AddDataOutputAssociation(node int32, dataObject string, value *expr.Compiled, targetState, targetPath string)
AddDataOutputAssociation attaches a data-output association to activity node: when the activity completes, the engine evaluates value (a FEEL expression over the instance's variables, nil for a state-only transition) and writes it into the data object named dataObject, advancing that object's data state to targetState (empty keeps the object's current state) — ADR-0058. A non-empty targetPath writes only that member of a structured object, keeping the rest (ADR-0060). Build groups a node's associations into a shared array.
func (*Builder) AddDataStore ¶ added in v0.5.0
AddDataStore records a data store this process names, by the store's own name and the BPMN id of the reference that named it. Like a data object it is not a flow node — no token passes through it — so it returns the index of the entry in the data-store table rather than an element id.
func (*Builder) AddDiscordConnectorTask ¶ added in v0.5.0
func (b *Builder) AddDiscordConnectorTask(cfg DiscordConfig) int32
AddDiscordConnectorTask adds a Discord task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved DiscordJobType so the in-process Discord worker picks it up, evaluates the authored literal-or-FEEL values over the variables the task sees, resolves the named worker's client, performs the one operation, writes what Discord returned into ResultVar (empty = discard it), and completes the job. The bot token is resolved server-side from the named worker, never authored in the model — mirroring Jira and Google Sheets (ADR-0201/0235).
func (*Builder) AddEndEvent ¶
AddEndEvent adds a none end event and returns its element id.
func (*Builder) AddEntraConnectorTask ¶ added in v0.3.0
func (b *Builder) AddEntraConnectorTask(cfg EntraConfig) int32
AddEntraConnectorTask adds an Entra ID task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved EntraJobType, which nothing in the engine subscribes to — the kind is worker-only (ADR-0164/0171), so the job waits for a worker that holds the tenant's app credential.
func (*Builder) AddErrorEndEvent ¶
AddErrorEndEvent adds an end event that throws the given error code — ending its scope abnormally and propagating up to the nearest matching handler rather than completing normally (ADR-0089). A code-less error end throws "". Returns its element id.
func (*Builder) AddEscalationEndEvent ¶ added in v0.2.0
AddEscalationEndEvent adds an end event that raises the given escalation code — propagating up to the nearest matching handler — then ends its path (ADR-0125). Unlike an error end, an uncaught escalation is benign (no incident) and a matching catch may be non-interrupting. A code-less escalation raises "". Returns its element id.
func (*Builder) AddEscalationThrowEvent ¶ added in v0.2.0
AddEscalationThrowEvent adds an intermediate throw event that raises the given escalation code — propagating up to the nearest matching handler — then continues on its outgoing flow (ADR-0125). A code-less escalation raises "". Returns its element id.
func (*Builder) AddEventBasedGateway ¶
AddEventBasedGateway adds an event-based gateway (deferred choice) and returns its element id. It carries no detail: at runtime it arms every target catch event (each outgoing flow must lead to a message/timer/signal intermediate catch) and takes the branch whose event fires first, cancelling the rest (ADR-0110).
func (*Builder) AddExclusiveGateway ¶
AddExclusiveGateway adds a data-based exclusive gateway (XOR split) and returns its element id. Its outgoing flows carry the conditions; see SetFlowCondition and SetFlowDefault.
func (*Builder) AddGoogleSheetsConnectorTask ¶ added in v0.5.0
func (b *Builder) AddGoogleSheetsConnectorTask(cfg GoogleSheetsConfig) int32
AddGoogleSheetsConnectorTask adds a Google Sheets task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved GoogleSheetsJobType so the in-process Google Sheets handler picks it up, evaluates the authored literal-or-FEEL values over the variables the task sees, resolves the named Worker's client, performs the one operation, writes what Google returned into ResultVar (empty = discard it), and completes the job. The credential is resolved server-side from the named Worker, never authored in the model — mirroring Jira and SharePoint (ADR-0141/0201).
The method keeps the Add*ConnectorTask name its sixteen siblings on this Builder carry; renaming that family is its own step of the ADR-0203 migration.
func (*Builder) AddInclusiveGateway ¶
AddInclusiveGateway adds an inclusive (OR) gateway and returns its element id. As a split it takes every outgoing flow whose condition holds (or the default if none do); as a join it waits until every branch that could still deliver a token has, then fires once. Conditions and the default flow are set the same way as for an exclusive gateway.
func (*Builder) AddInputMapping ¶
AddInputMapping attaches a zeebe:ioMapping input to activity node: when the activity activates, the engine evaluates source (a FEEL expression over the scope chain from the activity's flow scope) and writes the result into the activity-local variable named target, which the activity then sees (ADR-0068). Build groups a node's input mappings into a shared array. The parser owns validation; the builder only interns the target, mirroring the data-association adds.
func (*Builder) AddJiraConnectorTask ¶ added in v0.5.0
func (b *Builder) AddJiraConnectorTask(cfg JiraConfig) int32
AddJiraConnectorTask adds a Jira task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved JiraJobType so the in-process Jira worker picks it up, evaluates the authored literal-or-FEEL values over the variables the task sees, resolves the named worker's client, performs the one operation, writes what Jira returned into ResultVar (empty = discard it), and completes the job. The Jira base URL and credential are resolved server-side from the named worker, never authored in the model — mirroring Remedy and SharePoint (ADR-0106/0141).
func (*Builder) AddLane ¶ added in v0.2.0
AddLane adds an organizational lane and returns its index (ADR-0121). parent is the index of the enclosing lane in a nested laneSet, or -1 for a top-level lane. A lane is pure metadata — it affects no token flow.
func (*Builder) AddLdapConnectorTask ¶ added in v0.3.0
func (b *Builder) AddLdapConnectorTask(cfg LdapConfig) int32
AddLdapConnectorTask adds a generic LDAP task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved LdapJobType so the in-process LDAP worker picks it up, evaluates any FEEL url/dn/filter values over the instance's variables, binds and performs the directory operation, writes a search's entries into ResultVar, and completes the job (ADR-0154). The server and DNs live in the model; the bind password never does (BindSecret references a server-side secret, ADR-0041).
func (*Builder) AddLdifConnectorTask ¶ added in v0.3.0
func (b *Builder) AddLdifConnectorTask(cfg LdifConfig) int32
AddLdifConnectorTask adds a directory-file task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved LdifJobType, which an in-process worker and an `atlas worker` both serve — the work is a pure transform, so neither placement can block the other.
func (*Builder) AddLinkCatchEvent ¶ added in v0.2.0
AddLinkCatchEvent adds a link intermediate catch event — the landing point of a link throw of the same name (ADR-0133). Like the throw it carries no detail and runs as a pass-through, flowing on its real outgoing sequence flow when the synthetic link edge activates it. Returns its element id.
func (*Builder) AddLinkThrowEvent ¶ added in v0.2.0
AddLinkThrowEvent adds a link intermediate throw event — a goto (ADR-0133). It carries no detail: the link name matters only at compile, where connectScope resolves the pair to a synthetic sequence flow to the matching link catch. At runtime it is a pass-through, taking that synthetic flow. Returns its element id.
func (*Builder) AddMailConnectorTask ¶
func (b *Builder) AddMailConnectorTask(cfg MailConfig) int32
AddMailConnectorTask adds an outbound mail task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved MailJobType so the in-process mail worker picks it up, evaluates any FEEL recipient/subject/body values over the instance's variables, resolves the named worker's provider client, sends the message, and completes the job (ADR-0079). The provider endpoint and credentials are resolved server-side from the named worker, never authored in the model — mirroring clio (ADR-0036).
func (*Builder) AddMessageCatchEvent ¶
AddMessageCatchEvent adds an intermediate message catch event that, on activation, subscribes to the named message with a correlation key produced by the given compiled FEEL expression (evaluated over the instance's variables), then waits until a matching message is correlated. Returns its element id.
func (*Builder) AddMessageEndEvent ¶
AddMessageEndEvent adds an end event that, on activation, publishes the named message with a correlation key produced by the given compiled FEEL expression (evaluated over the ending instance's variables), then ends the instance. It reuses the throw detail table, since a message end event throws exactly like an intermediate throw event and only differs in its completion (ADR-0054). Returns its element id.
func (*Builder) AddMessageStartEvent ¶
func (b *Builder) AddMessageStartEvent(messageName string, correlationKey *expr.Compiled, singletonStart bool) int32
AddMessageStartEvent adds a message start event and returns its element id. It is a process entry point like a none start event — at runtime it simply flows straight on — but the engine also registers it at deploy time so a correlating message (a throw event or an API publish of messageName) instantiates a fresh process instance seeded with the message's payload (ADR-0035). correlationKey is compiled for future use; message-start matching is by name today.
func (*Builder) AddMessageThrowEvent ¶
AddMessageThrowEvent adds an intermediate message throw event that, on activation, publishes the named message with a correlation key produced by the given compiled FEEL expression (evaluated over the throwing instance's variables), then completes. Returns its element id.
func (*Builder) AddMockupTask ¶ added in v0.2.0
func (b *Builder) AddMockupTask(cfg MockupConfig) int32
AddMockupTask adds a mockup service task the engine simulates itself (ADR-0120) and returns its element id. Unlike a service task it creates no job: at runtime mockupTaskBehavior writes the optional FEEL result, arms a one-shot timer for a random duration, and completes (or raises an incident per the fail probability). The result variable and fail message are stored as raw strings (like ScriptTaskDetail.ResultVar); the FEEL expression is compiled by the caller at deploy time (invariant I5), as AddScriptTask takes a pre-compiled expression.
func (*Builder) AddOutputMapping ¶
AddOutputMapping attaches a zeebe:ioMapping output to activity node: when the activity completes, the engine evaluates source (a FEEL expression over the activity-local scope) and promotes the result into the parent (flow) scope under the variable named target (ADR-0068). Build groups a node's output mappings into a shared array.
func (*Builder) AddParallelGateway ¶
AddParallelGateway adds a parallel (AND) gateway and returns its element id. It forks a token onto every outgoing flow and joins by waiting until a token has arrived on each of its incoming flows.
func (*Builder) AddReceiveTask ¶
AddReceiveTask adds a receive task that, on activation, subscribes to the named message with a correlation key produced by the given compiled FEEL expression, then waits until a matching message is correlated — the message-catch semantics as an activity (ADR-0102). Returns its element id.
func (*Builder) AddRemedyConnectorTask ¶
func (b *Builder) AddRemedyConnectorTask(cfg RemedyConfig) int32
AddRemedyConnectorTask adds a BMC Remedy task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved RemedyJobType so the in-process Remedy worker picks it up, evaluates any FEEL form/field values over the instance's variables, resolves the named worker's AR System REST client, creates the entry, writes the new entry id into ResultVar (empty = discard it), and completes the job (ADR-0106). The Remedy base URL and credentials are resolved server-side from the named worker, never authored in the model — mirroring clio and mail (ADR-0036/0079).
func (*Builder) AddRestConnectorTask ¶
func (b *Builder) AddRestConnectorTask(cfg RestConfig) int32
AddRestConnectorTask adds an HTTP-REST task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved RestJobType so the in-process REST worker picks it up, evaluates any FEEL url/header/query values over the instance's variables, calls the endpoint with the given method, writes the JSON response into ResultVar (empty = discard the response), and completes the job (ADR-0067). Method is stored as given (the parser uppercases and validates it).
func (*Builder) AddScimConnectorTask ¶ added in v0.3.0
func (b *Builder) AddScimConnectorTask(cfg ScimConfig) int32
AddScimConnectorTask adds a SCIM 2.0 task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved ScimJobType so the in-process SCIM worker picks it up, evaluates any FEEL base-url/resource/id/filter values over the instance's variables, performs the resource operation against the provider, writes the JSON response into ResultVar (empty = discard), and completes the job (ADR-0153). The base URL and resource live in the model; credentials never do (Auth references a server-side secret, ADR-0041).
func (*Builder) AddScriptJobTask ¶
func (b *Builder) AddScriptJobTask(jobType, language, source, resultVar string, retries int32) int32
AddScriptJobTask adds a job-based script task authored in a general-purpose language (ADR-0047) and returns its element id. Like a service task it creates a job on activation and waits; the job carries jobType — a reserved per-language sentinel (e.g. PwshJobType) the in-process script worker for that language picks up, runs source through the interpreter, and completes the job, writing the result into the resultVar process variable. The parser owns language validation and the language→jobType mapping; the builder only interns what it is given, the same way AddServiceTask and the worker adds do.
func (*Builder) AddScriptTask ¶
AddScriptTask adds a script task that evaluates the given compiled FEEL expression and writes the result to resultVar. Returns its element id.
func (*Builder) AddSendTask ¶
AddSendTask adds a send task with the given job type and retries and returns its element id (ADR-0112). A send task is a service task under a different BPMN label: it creates a job and waits, so it reuses the service-task detail table and (at runtime) serviceTaskBehavior. Only its node type (TypeSendTask) differs, to preserve the send-task identity — the TypeConnectorTask "distinct type, shared behavior" pattern.
func (*Builder) AddServiceTask ¶
AddServiceTask adds a service task with the given job type and retries and returns its element id.
func (*Builder) AddSharePointConnectorTask ¶
func (b *Builder) AddSharePointConnectorTask(cfg SharePointConfig) int32
AddSharePointConnectorTask adds a SharePoint task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved SharePointJobType so the in-process SharePoint worker picks it up, evaluates any FEEL site/list/field values over the instance's variables, resolves the named worker's Graph client, creates the list item, writes the created item's JSON into ResultVar, and completes the job (ADR-0141). The Graph base and credentials are resolved server-side from the named worker, never authored in the model — mirroring the mail worker (ADR-0079).
func (*Builder) AddSignalCatchEvent ¶
AddSignalCatchEvent adds an intermediate signal catch event that waits for a broadcast signal of the given name (ADR-0088). Returns its element id.
func (*Builder) AddSignalEndEvent ¶
AddSignalEndEvent adds an end event that broadcasts the named signal, then ends the instance — the send-and-stop counterpart of a signal throw, reusing the throw detail table like a message end event (ADR-0088).
func (*Builder) AddSignalStartEvent ¶
AddSignalStartEvent adds a start event that a broadcast signal instantiates (ADR-0088); at runtime it flows straight on like a message start.
func (*Builder) AddSignalThrowEvent ¶
AddSignalThrowEvent adds an intermediate signal throw event that, on activation, broadcasts the named signal to every waiting catch, then completes (ADR-0088).
func (*Builder) AddSoapConnectorTask ¶ added in v0.3.0
func (b *Builder) AddSoapConnectorTask(cfg SoapConfig) int32
AddSoapConnectorTask adds a SOAP / Web Services task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved SoapJobType so the in-process SOAP worker picks it up, evaluates any FEEL endpoint/action/body values over the instance's variables, wraps the body in a SOAP envelope, invokes the operation, parses the response into ResultVar (empty = discard), and completes the job (ADR-0165). The endpoint and body live in the model; credentials never do (Auth references a server-side secret, ADR-0041).
func (*Builder) AddSqlConnectorTask ¶ added in v0.3.0
AddSqlConnectorTask adds a SQL task of cfg's product and returns its element id. Like a service task it creates a job on activation and waits; the job carries the product's reserved job type. Unlike every kind before it, nothing in the engine subscribes to that type — SQL is worker-only (ADR-0164/0170), so the job waits for a worker that holds the DSN. The engine's half is resolving the parameters against the instance's variables (ADR-0168); the statement needs no resolving, being literal.
func (*Builder) AddStartEvent ¶
AddStartEvent adds a none start event and returns its element id.
func (*Builder) AddSubProcess ¶
AddSubProcess adds an embedded subprocess container node and returns its element id. It carries no detail; its inner flow lives in the flat node/flow arrays, linked back to it only by the children's FlowScope. Create it first, then PushScope(its id) before adding its children so they land in its scope (ADR-0074).
func (*Builder) AddTask ¶
AddTask adds an undefined/manual task — one with no execution semantics — and returns its element id. It carries no detail and simply passes the token straight through, so a model can be drafted and its routing tested before its tasks are given real implementations.
func (*Builder) AddTemisDecisionTask ¶
func (b *Builder) AddTemisDecisionTask(connector, decisionId, resultVar string, staticInputs map[string]any, mappings []DecisionInputMapping, retries int32) (int32, error)
AddTemisDecisionTask adds a *central* business rule task: one whose decision is evaluated by the named server-registered temis worker rather than the embedded temis library (ADR-0050). It returns its element id. Authoring is otherwise identical to a local business rule task — same decision id, result variable, static inputs, and variable mappings — the only difference is that the task carries the temis job type so the remote worker picks it up.
func (*Builder) AddTerminateEndEvent ¶ added in v0.2.0
AddTerminateEndEvent adds a terminate end event: reaching it ends the enclosing flow scope at once — every other live token in the scope is terminated, then the scope completes (ADR-0116). It carries no detail (a terminate has no code, message, or handler). Returns its element id.
func (*Builder) AddTimerCatchEvent ¶
AddTimerCatchEvent adds an intermediate timer catch event that waits the given fixed duration (nanoseconds) before continuing, and returns its element id. It is the duration convenience over AddTimerCatchSchedule.
func (*Builder) AddTimerCatchSchedule ¶
func (b *Builder) AddTimerCatchSchedule(schedule TimerSchedule) int32
AddTimerCatchSchedule adds an intermediate timer catch event that waits until the given schedule's first due date, then continues. A catch fires once, so the schedule is a duration or date, never a cycle (ADR-0054). Returns its element id.
func (*Builder) AddTimerStartEvent ¶
func (b *Builder) AddTimerStartEvent(schedule TimerSchedule) int32
AddTimerStartEvent adds a timer start event and returns its element id. Like a none start it is a process entry point that flows straight on once instantiated; what makes it a start is the deploy-time timer the engine arms from its schedule, which instantiates a fresh process instance each time it fires (ADR-0051).
func (*Builder) AddUserConnectorTask ¶ added in v0.2.0
func (b *Builder) AddUserConnectorTask(cfg UserConnectorConfig) int32
AddUserConnectorTask adds a user-provisioning task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved UserConnectorJobType so the in-process user-provisioning worker picks it up, evaluates any FEEL field over the instance's variables, performs the operation against the internal user store, and completes the job (ADR-0123). No provider or credential is involved.
func (*Builder) AddUserTask ¶
func (b *Builder) AddUserTask(name, assignee, candidateGroups, formId string, priority int32, dueDateNanos int64, retries int32) int32
AddUserTask adds a user task that parks a token and creates a job for a human to complete via the Tasks app (ADR-0028). assignee and candidateGroups are optional (empty strings are stored as -1). Returns its element id.
func (*Builder) AddWebScrapeConnectorTask ¶ added in v0.2.0
func (b *Builder) AddWebScrapeConnectorTask(cfg WebScrapeConfig) int32
AddWebScrapeConnectorTask adds a web-scraping task and returns its element id. Like a service task it creates a job on activation and waits; the job carries the reserved WebScrapeJobType so the in-process web-scraping worker picks it up, evaluates any FEEL url/selector values over the instance's variables, fetches the page, extracts the text (or the named attribute) of every element matching the selector, writes the values into Result as a JSON array, and completes the job (ADR-0118). The URL and selector live in the model, mirroring the REST worker (ADR-0067); nothing about the target is registry-held.
func (*Builder) AddWebScrapeExtractionTask ¶ added in v0.5.0
func (b *Builder) AddWebScrapeExtractionTask(cfg WebScrapeExtractionConfig) int32
AddWebScrapeExtractionTask adds a web-scraping task with the explicit extraction format and bound defined by ADR-0190. Existing callers may keep using AddWebScrapeConnectorTask, whose zero-value format remains HTML with no bound.
func (*Builder) Build ¶
func (b *Builder) Build() (*CompiledProcess, error)
Build linearizes the accumulated nodes and flows into an immutable CompiledProcess. It returns an error if a flow references an unknown node.
func (*Builder) Connect ¶
Connect adds a sequence flow from source to target and returns its flow id, so the caller can attach a condition or mark it the default.
func (*Builder) CurrentScope ¶
CurrentScope reports the scope nodes are added into now (-1 at the process root).
func (*Builder) PopScope ¶
func (b *Builder) PopScope()
PopScope closes the innermost open scope, restoring the enclosing one.
func (*Builder) PushScope ¶
PushScope opens scope id: every node added until the matching PopScope carries id as its FlowScope. Scopes nest, so the outer scope is saved and restored.
func (*Builder) SetAdHocResultCollection ¶ added in v0.5.0
SetAdHocResultCollection names where an agent-driven ad-hoc's tool results accumulate (ADR-0253): collection is the variable on the container's scope each finished tool appends to, and element the FEEL expression evaluated over that tool's own scope to produce the entry. It exists because the name is an *interned* index inside the detail, which only a builder can mint — the same reason SetMultiInstance takes its output collection by name. An empty collection clears it.
func (*Builder) SetAgentParams ¶ added in v0.5.0
SetAgentParams records the model-wide element-id → <atlas:agentParam> index, read when Build binds an agent-driven ad-hoc's tool index and ignored otherwise.
func (*Builder) SetCompensationActivityRef ¶
SetCompensationActivityRef narrows a compensation throw/end event to compensate a single activity (by element id) rather than the whole scope (ADR-0103). The node must be a compensation throw or end event.
func (*Builder) SetCompensationHandler ¶
SetCompensationHandler resolves a compensation boundary event's handler link: it points the boundary node (a BoundaryCompensation) at the handler activity's element id (ADR-0103). The boundary must be a compensation boundary; other kinds are left untouched.
func (*Builder) SetDocumentation ¶ added in v0.2.0
SetDocumentation records the process's own <bpmn:documentation> — the summary a reader wants before following the diagram. Design-time metadata, like the element-level documentation above.
func (*Builder) SetElementBpmnId ¶
SetElementBpmnId records the source BPMN element id (e.g. "StartEvent_1") for a node so it can be mapped back for diagnostics and the live diagram overlay. It is optional: nodes without one report "" from CompiledProcess.ElementBpmnId.
func (*Builder) SetElementDocumentation ¶ added in v0.2.0
SetElementDocumentation records a node's <bpmn:documentation> — the prose an author writes about the element in the Modeler (ADR-0025). It is design-time metadata: the processor never reads it, so it changes no execution; it is carried so a surface that shows an element to a person (the Tasks app, for a user task's work instruction) can read it from the compiled process instead of re-parsing the model (invariant I5). Empty text interns to -1, so an undocumented node costs nothing.
func (*Builder) SetEventSubProcess ¶
func (b *Builder) SetEventSubProcess(nodeID int32, d EventSubProcessDetail)
SetEventSubProcess marks an already-added subprocess node event-triggered (ADR-0082), carrying the trigger detail its start event describes. It is applied after the subprocess and its inner start exist (like SetMultiInstance), and its EventSub field then indexes the detail. Build groups event-subprocess handlers by their parent scope so the runtime can arm them when the scope is entered.
func (*Builder) SetExecutable ¶
SetExecutable records the process's bpmn:isExecutable flag. A non-executable process is descriptive-only — the API refuses to start it and hides it from the start surfaces (it still deploys and lists so it can be inspected).
func (*Builder) SetFlowCondition ¶
SetFlowCondition attaches a compiled FEEL guard to a flow (an exclusive gateway takes the first flow whose condition is true).
func (*Builder) SetFlowDefault ¶
SetFlowDefault marks a flow as its gateway's default (taken when no condition matches).
func (*Builder) SetHistoryTtl ¶ added in v0.2.0
SetHistoryTtl records the process's history TTL in nanoseconds — how long a *finished* instance of this definition is kept before retention hard-deletes it (ADR-0144). Zero (the default) means the definition has no opinion: the server-wide max age applies, if one is configured. The parser passes an already-validated positive duration.
func (*Builder) SetInstanceTtl ¶
SetInstanceTtl records the process's instance TTL in nanoseconds — the self-cleaning expiry bound (ADR-0085). Zero (the default) means no TTL: instances never expire on their own. The parser passes an already-validated positive duration.
func (*Builder) SetLane ¶ added in v0.2.0
SetLane records that a flow node belongs to a lane (ADR-0121). A no-op for an unknown node.
func (*Builder) SetMultiInstance ¶
func (b *Builder) SetMultiInstance(nodeID int32, sequential bool, inputElement, outputCollection string, inputCollection, cardinality, outputElement, completionCondition *expr.Compiled)
SetMultiInstance marks an already-added node a multi-instance activity carrying the given loop characteristics (ADR-0077), interning the per-iteration and result variable names. The node keeps its real activity type; its MultiInstance field is set to index the loop detail. Applied after the node exists (like io-mappings), so any activity — task, subprocess, or call activity — can be a loop. Exactly one of inputCollection or cardinality should be non-nil (the parser enforces it).
func (*Builder) SetRepairForm ¶ added in v0.3.0
SetRepairForm records the form an operator should be shown when a token parks on this node with an incident (ADR-0169) — the modeler's answer to "if this task goes wrong, these are the values worth looking at". Design-time metadata exactly like the documentation above: the processor never reads it, so it changes no execution, and it is carried in the compiled process so the incident surface can read it without re-parsing the model (invariant I5) and so it moves with an instance that migrates (ADR-0162). An empty id interns to -1, so a node without one costs nothing.
func (*Builder) SetSearchableVariables ¶ added in v0.5.0
SetSearchableVariables declares the variable names an instance of this process can be found by. The engine maintains the variable value index for exactly these names — see CompiledProcess.IsSearchableVariable — so a process that declares none pays nothing for the feature.
func (*Builder) SetStandardLoop ¶ added in v0.2.0
func (b *Builder) SetStandardLoop(nodeID int32, testBefore bool, loopMaximum int32, condition *expr.Compiled)
SetStandardLoop marks an already-added node a BPMN standard loop (ADR-0133): it repeats its activity one iteration at a time while condition holds (nil = repeat until the cap), checked before the first iteration when testBefore is set, and at most loopMaximum times (0 = uncapped). It shares the multi-instance loop table and the node's MultiInstance index because it shares the runtime — a standard loop is a sequential loop whose iteration set is a condition rather than a collection — so a node carries at most one of the two markers (the parser refuses both).
func (*Builder) SetStartFormId ¶
SetStartFormId records the process's start-form id — the form the UI shows before creating an instance, whose data becomes the start variables (ADR-0028). It is design-time metadata the engine ignores.
func (*Builder) SetTransaction ¶
SetTransaction marks an already-added subprocess node as a <transaction> (ADR-0108), so the runtime and validation know it may host a cancel boundary and hold a cancel end event. A no-op for an out-of-range node.
func (*Builder) SetVersionTag ¶
SetVersionTag records the process's atlas:versionTag — an optional revision label (e.g. "1.4.0") shown in Operations beside the deploy version. Design-time metadata.
type BusinessRuleTaskDetail ¶
type BusinessRuleTaskDetail struct {
JobType int32 // interned reserved job type (DMN local, or temis worker) → index
DecisionId int32 // interned DMN decision id → index
Inputs int32 // interned JSON object of static inputs → index, -1 if none
ResultVar int32 // interned result-variable name → index, -1 if none
Connector int32 // interned temis worker name → index, -1 = local (in-engine)
Retries int32
Binding DecisionBinding // how the decision model is resolved (ADR-0063)
InputMappings []DecisionInputMapping // variable-driven inputs, evaluated off the hot path
}
BusinessRuleTaskDetail is the per-business-rule-task data a behavior needs at runtime. A business rule task delegates to a DMN decision, evaluated off the hot path by the temis engine (ADR-0014). Like a service task it runs as a job, so it carries a JobType (a reserved DMN sentinel) the in-process DMN worker subscribes to; DecisionId names the decision to evaluate.
Its inputs come from two layers the worker merges: Inputs is an interned JSON object of static constant inputs (a literal base), and InputMappings are the variable-driven inputs — FEEL expressions evaluated over the instance's variables, which override a static input of the same name. ResultVar, if set, is the process variable the decision's result is written back into on job completion (the output mapping); -1 if the task discards its result.
Worker selects the evaluation locus (ADR-0050): -1 (the default) means the decision is evaluated locally by the embedded temis library (ADR-0014); a set Worker is the interned name of a server-registered temis worker that evaluates the decision centrally, and the task then carries the temis job type instead of the local DMN job type.
type CallActivityDetail ¶
type CallActivityDetail struct {
CalledProcessId int32 // interned bpmn process id of the called process
Binding DecisionBinding
PropagateAllParent bool // pass all caller variables into the child (default true)
PropagateAllChild bool // return all child variables to the caller (default true)
}
CallActivityDetail is the per-call-activity data a behavior needs at runtime: the bpmn process id of the process to start as a child instance (interned), the binding that picks its version (latest vs this deployment), and whether variables propagate wholesale in and out (Zeebe's propagateAll flags — when off, only the activity's input/output mappings pass variables, giving an isolated child) (ADR-0076). The called def key is resolved at deploy/runtime, not compiled here.
type CallActivityRef ¶
type CallActivityRef struct {
ElementId string
CalledProcessId string
Binding DecisionBinding
PropagateAllParent bool
PropagateAllChild bool
MultiInstance bool
// Loop is true when the call activity carries a standard loop marker instead —
// it calls the process again and again while a condition holds (ADR-0133), where
// MultiInstance calls it once per collection element. At most one is ever true.
Loop bool
}
CallActivityRef is the static, read-only view of one call activity: the BPMN element that hosts it, the process id it calls, the version binding, whether variables propagate wholesale in/out, and whether it is a multi-instance loop (spawning one child per collection element). It carries no resolved def key — which deployed definition the call reaches is a per-server, deploy-time fact the server layer computes on top of this (ADR-0076).
type CompensationDetail ¶
type CompensationDetail struct {
ActivityRef int32
}
CompensationDetail is the per-compensation-throw data the runtime needs (ADR-0103), shared by the compensation throw and end events like the message/signal throw table. ActivityRef is the ElementId of the single activity to compensate, or -1 to compensate every completed compensable activity in the throw's scope (reverse completion order).
type CompiledDataObject ¶
type CompiledDataObject struct {
Name int32 // interned data-object name → index
ItemType int32 // interned itemDefinition reference → index, -1 if untyped
InitialState int32 // interned initial data state → index, -1 if none
IsCollection bool
}
CompiledDataObject is one BPMN data object declared by a process: a typed, named datum with an optional declared structure and initial data state. Unlike a CompiledNode it is not a flow node — no token flows through it (ADR-0053) — so it lives in its own table, not the node array, and the engine seeds one under each instance's scope at creation. All string fields are interned indices (resolve with CompiledProcess.Intern); -1 means unset.
type CompiledDataStore ¶ added in v0.5.0
CompiledDataStore is one BPMN data store a process names: a place instances of a class outlive the process that made them. Name is the store's own name — the <dataStore>'s where a <dataStoreReference> resolves to one, the reference's own otherwise — because the reference is one view on a diagram while the store is the thing every process means. ElementId is the reference's BPMN id, so a finding about the store can be marked on the box that named it. Both are interned indices.
type CompiledFlow ¶
type CompiledFlow struct {
Id int32
Source int32 // ElementId
Target int32 // ElementId
Condition *expr.Compiled
Default bool
}
CompiledFlow is a sequence flow between two nodes. Condition is the compiled FEEL guard an exclusive gateway evaluates to decide whether to take this flow (nil = unconditional); Default marks the flow taken when no condition matches.
type CompiledNode ¶
type CompiledNode struct {
ElementId int32 // == index in nodes[]
Type BpmnType
OutgoingStart int32 // offset into outgoingFlows
OutgoingCount int32
IncomingCount int32 // number of sequence flows targeting this node (a parallel join waits for all)
FlowScope int32 // ElementId of enclosing scope, -1 = process root
Detail int32 // index into the matching detail table, -1 if none
BoundaryStart int32 // offset into boundaryEvents (the node ids of events attached to this activity)
BoundaryCount int32 // number of boundary events attached (0 for a non-host node)
DataOutStart int32 // offset into dataOutAssocs (the data-output associations of this activity)
DataOutCount int32 // number of data-output associations (0 for a node with none)
DataInStart int32 // offset into dataInAssocs (the data-input associations of this activity)
DataInCount int32 // number of data-input associations (0 for a node with none)
IOInStart int32 // offset into ioInputs (the zeebe:ioMapping inputs of this activity)
IOInCount int32 // number of input mappings (0 for a node with none)
IOOutStart int32 // offset into ioOutputs (the zeebe:ioMapping outputs of this activity)
IOOutCount int32 // number of output mappings (0 for a node with none)
ScopeStartStart int32 // offset into scopeStarts (the start events nested directly in this subprocess)
ScopeStartCount int32 // number of nested start events (0 for a non-subprocess node)
MultiInstance int32 // index into multiInstances, -1 if this node is not a multi-instance loop (ADR-0077)
EventSub int32 // index into eventSubProcesses, -1 if this subprocess is not event-triggered (ADR-0082)
EventSubStart int32 // offset into eventSubs (the event-subprocess handler nodes nested directly in this scope)
EventSubCount int32 // number of event subprocesses in this scope (0 for a node that hosts none)
Transaction bool // this subprocess is a <transaction>: it may hold a cancel end event and host a cancel boundary (ADR-0108)
Lane int32 // index into lanes, -1 if this node is in no lane; organizational metadata with no execution effect (ADR-0121)
}
CompiledNode is one BPMN element. It stays small; type-specific data lives in detail tables referenced by Detail.
type CompiledProcess ¶
type CompiledProcess struct {
Key uint64 // ProcessDefinitionKey
BpmnProcessId int32 // interned
Version int32
// contains filtered or unexported fields
}
CompiledProcess is the immutable result of compiling one process definition. It is safe for concurrent reads without synchronization.
func Parse ¶
Parse reads a BPMN 2.0 XML model and compiles the first <process> into an immutable CompiledProcess keyed by key at the given version. It is the front end to the linearizer (compiler.md stages 1–2 and 6): it parses the XML, resolves string element ids to integer indices, and pours the result into the shared Builder. Validation beyond reference integrity (reachability, gateway coverage) is a later stage.
Service-task job types come from the Zeebe task-definition extension element (<zeebe:taskDefinition type="..." retries="..."/>), the de-facto standard for executable BPMN.
func ParseNamed ¶
ParseNamed compiles the single process with the given BPMN process id — a stored deployment records which process (by id) within its (possibly collaboration) XML it represents, so it can be recompiled under its original key. It compiles gate and all: a model that fails graph-wide validation is refused, as at any deploy. Bringing a definition back from a deployment store is the one case that wants the same compile *without* the gate, and uses ReloadNamed for it (ADR-0177).
func (*CompiledProcess) AdHoc ¶ added in v0.2.0
func (p *CompiledProcess) AdHoc(detail int32) *AdHocDetail
AdHoc returns the ad-hoc subprocess detail at the given table index (ADR-0138).
func (*CompiledProcess) AdHocEntries ¶ added in v0.2.0
func (p *CompiledProcess) AdHocEntries(id int32) []int32
AdHocEntries returns the element ids of an ad-hoc subprocess's entry activities — the contained flow nodes with no incoming sequence flow, which the runtime activates when the ad-hoc is entered (ADR-0138). Like ScopeStartEvents it is a slice into the shared topology array (no allocation); empty for a non-ad-hoc node or an ad-hoc with no contained activity.
func (*CompiledProcess) BoundaryEvent ¶
func (p *CompiledProcess) BoundaryEvent(detail int32) *BoundaryEventDetail
BoundaryEvent returns the boundary-event detail at the given table index.
func (*CompiledProcess) BoundaryEvents ¶
func (p *CompiledProcess) BoundaryEvents(id int32) []int32
BoundaryEvents returns the element ids of the boundary events attached to the activity node id, as a slice into the shared topology array (no allocation). Empty for a node with no attached boundary events.
func (*CompiledProcess) BusinessRuleDecisions ¶
func (p *CompiledProcess) BusinessRuleDecisions() []string
BusinessRuleDecisions returns the DMN decision ids this process's business rule tasks reference, distinct and in node order — empty if it has none. The server uses it at deploy time to pick and deploy the DMN model that provides those decisions into the DMN registry, so the tasks can be evaluated (ADR-0014).
func (*CompiledProcess) BusinessRuleTask ¶
func (p *CompiledProcess) BusinessRuleTask(detail int32) *BusinessRuleTaskDetail
BusinessRuleTask returns the detail at the given table index.
func (*CompiledProcess) CallActivities ¶
func (p *CompiledProcess) CallActivities() []CallActivityRef
CallActivities returns every call activity in this process, in node order — empty if it has none. It mirrors BusinessRuleDecisions: a static enumeration of an outbound reference (here the called process id) that the server surfaces so operators can see and manage the call activities deployed on a server — which process calls which, and whether the target resolves (ADR-0076).
func (*CompiledProcess) CallActivity ¶
func (p *CompiledProcess) CallActivity(detail int32) *CallActivityDetail
CallActivity returns the call-activity detail at the given table index.
func (*CompiledProcess) CompensationThrow ¶
func (p *CompiledProcess) CompensationThrow(detail int32) *CompensationDetail
CompensationThrow returns the compensation-throw detail at the given table index — shared by the compensation throw and end events (ADR-0103).
func (*CompiledProcess) Conditional ¶ added in v0.2.0
func (p *CompiledProcess) Conditional(detail int32) *ConditionalDetail
Conditional returns the conditional-catch detail at the given table index (ADR-0137).
func (*CompiledProcess) ConnectorRefs ¶ added in v0.3.0
func (p *CompiledProcess) ConnectorRefs() []ConnectorRef
func (*CompiledProcess) ConnectorTask ¶
func (p *CompiledProcess) ConnectorTask(detail int32) *ConnectorTaskDetail
ConnectorTask returns the connector-task detail at the given table index.
func (*CompiledProcess) ConnectorTaskOf ¶
func (p *CompiledProcess) ConnectorTaskOf(id int32) (*ConnectorTaskDetail, error)
ConnectorTaskOf returns the connector-task detail for element node id, or an error if id is not a task in this compiled process. It is the bounds-checked accessor for the job-worker path: a persisted job can outlive the process definition that compiled its element as a task (e.g. a job created before a redeploy that recompiled the element into something else, or dropped its worker-task table), and resolving such a stale job must fail it into an incident (ADR-0061) rather than index out of range and panic the job-runner goroutine — an unrecovered panic there crashes the whole server. A worker that gets an error returns it, and FailJob retries then parks the token.
func (*CompiledProcess) DataInputAssociations ¶
func (p *CompiledProcess) DataInputAssociations(id int32) []DataInputAssociation
DataInputAssociations returns the data-input associations of activity node id, as a slice into the shared array (no allocation). Empty for a node with none. The engine evaluates them when the activity activates to read its data objects into process variables (ADR-0059).
func (*CompiledProcess) DataObjects ¶
func (p *CompiledProcess) DataObjects() []CompiledDataObject
DataObjects returns the process's declared data objects — the typed, named data seeded under each instance's scope at creation (ADR-0053). Empty for a process that declares none. String fields are interned; resolve with Intern.
func (*CompiledProcess) DataOutputAssociations ¶
func (p *CompiledProcess) DataOutputAssociations(id int32) []DataOutputAssociation
DataOutputAssociations returns the data-output associations of activity node id, as a slice into the shared array (no allocation). Empty for a node with none. The engine evaluates them when the activity completes to write its data objects (ADR-0058).
func (*CompiledProcess) DataStores ¶ added in v0.5.0
func (p *CompiledProcess) DataStores() []CompiledDataStore
DataStores returns the data stores this process names — where its data lives beyond one instance (ADR-0230). Like a data object a store is not a flow node: no token passes through it, so it carries no behavior and adds nothing to the dispatch table. The engine does not read this table at all; it exists so a deploy can resolve the store against the owning application's information model and say whether the sentence the model wrote is true.
func (*CompiledProcess) Documentation ¶ added in v0.2.0
func (p *CompiledProcess) Documentation() string
Documentation returns the process's own <bpmn:documentation> — the summary that describes the process as a whole — or "" if it has none.
func (*CompiledProcess) ElementBpmnId ¶
func (p *CompiledProcess) ElementBpmnId(id int32) string
ElementBpmnId returns the source BPMN element id for a node (the string id bpmn-js uses, e.g. "StartEvent_1"), or "" if the node index is out of range or no id was recorded. Used to map runtime element instances back onto a diagram.
func (*CompiledProcess) ElementDocumentation ¶ added in v0.2.0
func (p *CompiledProcess) ElementDocumentation(id int32) string
ElementDocumentation returns the prose an author wrote about a node — its <bpmn:documentation> (ADR-0025) — or "" when the node is undocumented or the index is out of range. It is design-time metadata the engine never reads: it changes no execution, and is carried so a surface that shows an element to a person can read it here rather than re-parsing the model. The Tasks app uses it as a user task's work instruction.
func (*CompiledProcess) ElementIndexOf ¶ added in v0.5.0
func (p *CompiledProcess) ElementIndexOf(bpmnId string) (int32, bool)
ElementIndexOf is CompiledProcess.ElementBpmnId read backwards: the node index for a source BPMN element id, and false when the model has no such element. A caller that arrives with an id off a diagram — an operator clicking a shape — needs this direction to reach anything the engine keyed by node index.
It is a scan of the id table rather than a map, because it answers one lookup per request on a read path and a model has tens to hundreds of elements. It is never called from the processor: the hot path deals in indices already (I5).
func (*CompiledProcess) ErrorEnd ¶
func (p *CompiledProcess) ErrorEnd(detail int32) *ErrorEndDetail
ErrorEnd returns the error-end detail at the given table index (ADR-0089).
func (*CompiledProcess) Escalation ¶ added in v0.2.0
func (p *CompiledProcess) Escalation(detail int32) *EscalationDetail
Escalation returns the escalation-event detail (throw or end) at the given table index (ADR-0125).
func (*CompiledProcess) EventSubProcess ¶
func (p *CompiledProcess) EventSubProcess(detail int32) *EventSubProcessDetail
EventSubProcess returns the event-subprocess detail at the given table index — the trigger the runtime arms while the parent scope runs (ADR-0082).
func (*CompiledProcess) EventSubprocesses ¶
func (p *CompiledProcess) EventSubprocesses(id int32) []int32
EventSubprocesses returns the handler node ids of the event subprocesses nested directly in the subprocess scope id — the triggers the runtime arms when that subprocess is entered — as a slice into the shared topology array (no allocation). Empty for a scope that hosts none. Use RootEventSubprocesses for the process root.
func (*CompiledProcess) Flow ¶
func (p *CompiledProcess) Flow(id int32) *CompiledFlow
Flow returns the flow with the given id.
func (*CompiledProcess) HasConditionalEvents ¶ added in v0.2.0
func (p *CompiledProcess) HasConditionalEvents() bool
HasConditionalEvents reports whether the process contains any conditional event, so the runtime only re-checks conditionals for instances that can have one (ADR-0137).
func (*CompiledProcess) HasSearchableVariables ¶ added in v0.5.0
func (p *CompiledProcess) HasSearchableVariables() bool
HasSearchableVariables reports whether this process declares any. The engine asks this first on every variable write, so a process that declares none pays one comparison rather than a lookup.
func (*CompiledProcess) HistoryTtlNanos ¶ added in v0.2.0
func (p *CompiledProcess) HistoryTtlNanos() int64
HistoryTtlNanos returns the process's history TTL in nanoseconds, or 0 when none is configured. A positive value is this definition's own retention max age (ADR-0144): the retention sweep hard-deletes a finished instance of this definition once it is older than the TTL and its events are provably exported. Zero falls back to the server-wide max age.
func (*CompiledProcess) IOInputs ¶
func (p *CompiledProcess) IOInputs(id int32) []IOMapping
IOInputs returns the zeebe:ioMapping input mappings of activity node id, as a slice into the shared array (no allocation). Empty for a node with none. The engine evaluates them when the activity activates to write its activity-local scope (ADR-0068).
func (*CompiledProcess) IOOutputs ¶
func (p *CompiledProcess) IOOutputs(id int32) []IOMapping
IOOutputs returns the zeebe:ioMapping output mappings of activity node id, as a slice into the shared array (no allocation). Empty for a node with none. The engine evaluates them when the activity completes to promote selected values to the parent scope (ADR-0068).
func (*CompiledProcess) InclusiveJoinReach ¶ added in v0.5.0
func (p *CompiledProcess) InclusiveJoinReach(node int32) NodeSet
InclusiveJoinReach returns the set of node ids from which the given node is reachable by following sequence flows — its ancestors in the flow graph. An inclusive join uses it to decide whether any live token upstream could still arrive (if none can, and at least one has, it fires).
It is computed once, at compile time, for exactly the nodes that need it: the inclusive gateways with more than one incoming flow. Anything else gets the empty set, which is why the name says which nodes it answers for — a join that had no set would look like a join with nothing upstream, and fire early.
It used to be derived at runtime, on every arrival at every such join: a reverse adjacency over the whole graph, a map and a stack, all allocated and thrown away per token movement. That is topology, and topology is compiled, not interpreted (invariants I1 and I5, ADR-0279).
func (*CompiledProcess) InstanceTtlNanos ¶
func (p *CompiledProcess) InstanceTtlNanos() int64
InstanceTtlNanos returns the process's instance TTL in nanoseconds, or 0 when no TTL is configured. A positive value is the self-cleaning expiry bound (ADR-0085): the engine schedules a durable expiry timer at CreatedAt+TTL when an instance activates.
func (*CompiledProcess) Intern ¶
func (p *CompiledProcess) Intern(idx int32) string
Intern returns the string for an interned index, or "" if out of range.
func (*CompiledProcess) IsEventSubProcess ¶
func (p *CompiledProcess) IsEventSubProcess(id int32) bool
IsEventSubProcess reports whether the subprocess node id is event-triggered — a `<subProcess triggeredByEvent="true">` armed by its start event's event definition rather than entered by a flow (ADR-0082).
func (*CompiledProcess) IsExecutable ¶
func (p *CompiledProcess) IsExecutable() bool
IsExecutable reports the process's bpmn:isExecutable flag. A non-executable process is descriptive-only: the API refuses to start it and omits it from the start surfaces. Absent in the source defaults to true (see the parser).
func (*CompiledProcess) IsSearchableVariable ¶ added in v0.5.0
func (p *CompiledProcess) IsSearchableVariable(name string) bool
IsSearchableVariable reports whether name is one of the declared names — the question the engine asks per variable write to decide whether the write is indexed. Resolved at deploy time (I5): this is a set lookup, not a parse.
func (*CompiledProcess) IsTransaction ¶
func (p *CompiledProcess) IsTransaction(id int32) bool
IsTransaction reports whether node id is a <transaction> subprocess — a subprocess that may hold a cancel end event and host a cancel boundary (ADR-0108).
func (*CompiledProcess) Lane ¶ added in v0.2.0
func (p *CompiledProcess) Lane(idx int32) *LaneDetail
Lane returns the lane at the given table index (ADR-0121).
func (*CompiledProcess) LanePath ¶ added in v0.2.0
func (p *CompiledProcess) LanePath(nodeID int32) []string
LanePath returns a node's lane names from the outermost lane to the leaf, for display (e.g. ["Finance", "Approver"] for a node in a nested lane). Empty when the node is in no lane (ADR-0121).
func (*CompiledProcess) MessageCatch ¶
func (p *CompiledProcess) MessageCatch(detail int32) *MessageDetail
MessageCatch returns the message-catch detail at the given table index.
func (*CompiledProcess) MessageStart ¶
func (p *CompiledProcess) MessageStart(detail int32) *MessageDetail
MessageStart returns the message-start detail at the given table index.
func (*CompiledProcess) MessageStartEvents ¶
func (p *CompiledProcess) MessageStartEvents() []MessageStartEvent
MessageStartEvents returns each message-start event with its element index and compiled correlation-key expression. Computed by scanning the node table at deploy time (off the hot path); empty for a process with no message start event.
func (*CompiledProcess) MessageStarts ¶
func (p *CompiledProcess) MessageStarts() []MessageDetail
MessageStarts returns the definition's message-start-event details, one per message start event. The engine indexes these at deploy time so a correlating message can instantiate the process (ADR-0035). Empty for a process with no message start event.
func (*CompiledProcess) MessageThrow ¶
func (p *CompiledProcess) MessageThrow(detail int32) *MessageDetail
MessageThrow returns the message-throw detail at the given table index.
func (*CompiledProcess) MockupTask ¶ added in v0.2.0
func (p *CompiledProcess) MockupTask(detail int32) *MockupTaskDetail
MockupTask returns the mockup-task detail at the given table index (ADR-0120).
func (*CompiledProcess) MultiInstance ¶
func (p *CompiledProcess) MultiInstance(detail int32) *MultiInstanceDetail
MultiInstance returns the loop characteristics at the given table index — the per-activity multi-instance detail a node's MultiInstance field points at (ADR-0077).
func (*CompiledProcess) Node ¶
func (p *CompiledProcess) Node(id int32) *CompiledNode
Node returns the node with the given ElementId.
func (*CompiledProcess) NodeConnectorRef ¶ added in v0.3.0
func (p *CompiledProcess) NodeConnectorRef(id int32) (ConnectorRef, bool)
NodeConnectorRef returns the worker reference one node makes, and false when it makes none. Both shapes are covered: a task (mail, REST, SharePoint, …) and a business rule task delegating to a remote decision service, which names its worker the same way. An element that names no worker — a local decision, a REST task with its URL in the model, anything that is not one of those two task types — is not a reference.
It answers the question one element at a time because that is how an *incident* asks it: a token is parked on this element, which worker is it stuck on (ADR-0160)? ConnectorRefs asks the same question of every node.
func (*CompiledProcess) NodeCount ¶ added in v0.3.0
func (p *CompiledProcess) NodeCount() int
NodeCount is how many nodes the process compiled to, so a caller outside this package can walk them: node ids are the dense range [0, NodeCount).
func (*CompiledProcess) NodeLane ¶ added in v0.2.0
func (p *CompiledProcess) NodeLane(nodeID int32) int32
NodeLane returns the leaf lane index a node belongs to, or -1 if it is in no lane (ADR-0121).
func (*CompiledProcess) Outgoing ¶
func (p *CompiledProcess) Outgoing(id int32) []int32
Outgoing returns the flow ids leaving node id, as a slice into the shared topology array (no allocation).
func (*CompiledProcess) ProcessId ¶
func (p *CompiledProcess) ProcessId() string
ProcessId returns the source BPMN process id (the <process id="…">), used to tell one process's versions apart from another's when superseding start timers (ADR-0051).
func (*CompiledProcess) ReceivableMessageNames ¶ added in v0.5.0
func (p *CompiledProcess) ReceivableMessageNames() []string
ConnectorRefs returns every worker reference the process makes, in node order. An element that names no worker is left out; see NodeConnectorRef. ReceivableMessageNames returns every message name this definition can be *delivered* on, sorted and without duplicates: a message start event, an intermediate catch, a receive task, a boundary message event, and a message-triggered event subprocess.
Message *throws* are deliberately absent. A throw sends; this answers the question "what would arrive here", which is what an operator deciding who may receive an inbound event needs (ADR-0205). Computed by scanning the detail tables, so it belongs off the hot path — a deploy-time or console question, never a per-message one.
func (*CompiledProcess) ReceiveTask ¶
func (p *CompiledProcess) ReceiveTask(detail int32) *MessageDetail
ReceiveTask returns the receive-task detail at the given table index (ADR-0102). A receive task carries the same MessageDetail as a message catch — the message name and the compiled correlation-key expression it waits on.
func (*CompiledProcess) RepairForm ¶ added in v0.3.0
func (p *CompiledProcess) RepairForm(id int32) string
RepairForm returns the form an operator should be offered when a token parks on this node with an incident (ADR-0169), or "" when the node names none or the index is out of range.
It is a *better editor over an existing write path*, not a new one: the form names the variables worth looking at, and submitting it writes them through the same audited operator override the raw JSON editor uses (ADR-0098). The binding lives here, in the compiled model, because whoever authored the task is who knows which values its retry depends on — so it is versioned with the model, costs nothing at runtime, and rides an instance's migration (ADR-0162) rather than being runtime configuration that could drift from the task it describes.
func (*CompiledProcess) ResolveJobTypes ¶ added in v0.3.0
func (p *CompiledProcess) ResolveJobTypes(intern func(name string) (int32, error)) error
ServiceTask returns the detail at the given table index. ResolveJobTypes translates every model-authored job type in this process into the engine-wide index space, by handing each one's *name* to intern and keeping the index it returns. Service and send tasks are the only elements that need it: every other job-creating element carries a reserved job type, which is already the same index in every process (see reservedJobTypes).
It is called once per process at deploy time and again for each process on reload, so intern must be idempotent — the same name must come back with the same index. A failure aborts the whole resolution: a half-resolved process is worse than an unresolved one, because only some of its jobs would be findable.
The interner is supplied by the caller rather than imported, so the compiler stays independent of where the engine-wide table lives.
func (*CompiledProcess) RootEventSubprocesses ¶
func (p *CompiledProcess) RootEventSubprocesses() []int32
RootEventSubprocesses returns the handler node ids of the event subprocesses at the process root — the triggers armed when an instance is created (ADR-0082).
func (*CompiledProcess) ScopeStartEvents ¶
func (p *CompiledProcess) ScopeStartEvents(id int32) []int32
ScopeStartEvents returns the element ids of the start events nested directly in the subprocess node id — the scope's entry points the subprocess behavior seeds on activation — as a slice into the shared topology array (no allocation). Empty for a non-subprocess node or a subprocess with no start event (ADR-0074).
func (*CompiledProcess) ScriptJobTask ¶
func (p *CompiledProcess) ScriptJobTask(detail int32) *ScriptJobTaskDetail
ScriptJobTask returns the script-job-task detail at the given table index.
func (*CompiledProcess) ScriptTask ¶
func (p *CompiledProcess) ScriptTask(detail int32) *ScriptTaskDetail
ScriptTask returns the detail at the given table index.
func (*CompiledProcess) SearchableVariables ¶ added in v0.5.0
func (p *CompiledProcess) SearchableVariables() []string
SearchableVariables are the variable names this process declared an instance can be found by (atlas:searchable), in the order they were authored. nil when the process declares none.
func (*CompiledProcess) SendTask ¶
func (p *CompiledProcess) SendTask(detail int32) *ServiceTaskDetail
SendTask returns the detail at the given table index (ADR-0112). A send task is a service task under a different label — it reuses ServiceTaskDetail and the same detail table, so this is ServiceTask by another name, kept for call-site clarity.
func (*CompiledProcess) ServiceTask ¶
func (p *CompiledProcess) ServiceTask(detail int32) *ServiceTaskDetail
func (*CompiledProcess) SignalCatch ¶
func (p *CompiledProcess) SignalCatch(detail int32) *SignalDetail
SignalCatch returns the signal-catch detail at the given table index (ADR-0088).
func (*CompiledProcess) SignalStart ¶
func (p *CompiledProcess) SignalStart(detail int32) *SignalDetail
SignalStart returns the signal-start detail at the given table index (ADR-0088).
func (*CompiledProcess) SignalStartEvents ¶
func (p *CompiledProcess) SignalStartEvents() []SignalStartEvent
SignalStartEvents returns each root-scope signal-start event's signal name and element index. The engine indexes these at deploy time so a broadcast signal can instantiate the process (ADR-0088), mirroring MessageStartEvents. A signal start nested in an event subprocess is that scope's trigger, not a process entry point.
func (*CompiledProcess) SignalThrow ¶
func (p *CompiledProcess) SignalThrow(detail int32) *SignalDetail
SignalThrow returns the signal-throw detail at the given table index — shared by the signal throw and signal end events (ADR-0088).
func (*CompiledProcess) StartEvents ¶
func (p *CompiledProcess) StartEvents() []int32
StartEvents returns the process's entry-point element ids.
func (*CompiledProcess) StartFormId ¶
func (p *CompiledProcess) StartFormId() string
StartFormId returns the id of the form the UI shows before starting an instance, or "" if the process has no start form (ADR-0028). It is design-time metadata; the engine never reads it.
func (*CompiledProcess) TimerCatch ¶
func (p *CompiledProcess) TimerCatch(detail int32) *TimerCatchDetail
TimerCatch returns the timer-catch detail at the given table index.
func (*CompiledProcess) TimerStart ¶
func (p *CompiledProcess) TimerStart(detail int32) *TimerStartDetail
TimerStart returns the timer-start detail at the given table index.
func (*CompiledProcess) TimerStartEvents ¶
func (p *CompiledProcess) TimerStartEvents() []TimerStartEvent
TimerStartEvents returns each timer-start event with its element index and compiled schedule. Computed by scanning the node table at deploy time (off the hot path); empty for a process with no timer start event.
func (*CompiledProcess) UserTask ¶
func (p *CompiledProcess) UserTask(detail int32) *UserTaskDetail
UserTask returns the user-task detail at the given table index.
func (*CompiledProcess) VersionTag ¶
func (p *CompiledProcess) VersionTag() string
VersionTag returns the process's atlas:versionTag revision label ("" if none). It is design-time metadata Operations shows beside the deploy version; the engine never reads it.
type ConditionalDetail ¶ added in v0.2.0
ConditionalDetail is the per-conditional-catch-event data the runtime needs: the boolean FEEL condition it waits on (ADR-0137). A conditional intermediate catch arms inert and is driven to Completing when a variable-change re-check finds the condition true. (Conditional boundaries and event subprocesses carry their condition on BoundaryEventDetail / EventSubProcessDetail instead.)
type ConnectorRef ¶ added in v0.3.0
ConnectorRef is one model reference to a server-registered worker: the element carrying it, the reserved job type that says which *kind* of worker it needs, and the name it asks for. A model refers to a worker by name only and never carries an endpoint or a secret (ADR-0036/0041), so nothing inside the model can tell whether that name is configured anywhere — which is exactly why the references have to be enumerable from outside, where the worker store is (ADR-0158).
type ConnectorTaskDetail ¶
type ConnectorTaskDetail struct {
JobType int32 // interned reserved worker job type → index
Connector int32 // interned worker name → index, -1 if not a clio task
Subject int32 // interned clio target subject → index, -1 if unused
EventType int32 // interned clio event type → index, -1 if not a clio write task
ClioQuery int32 // interned clio run_query query string → index, -1 if unused
ReduceSpec int32 // interned clio get_state reduce-spec name → index, -1 if unused
Limit int32 // clio read_events limit, 0 = the worker's default
Method int32 // interned HTTP method → index, -1 if not a REST task
ResultVar int32 // interned REST/clio result variable name → index, -1 if none
// Url is the request endpoint, Headers and Query the request headers and query
// parameters a REST task adds (ADR-0067). Each value is literal or a FEEL
// expression evaluated over the instance's variables at call time (the
// Camunda-style fx toggle) — see RestExpr. Url is the zero RestExpr for a
// non-REST (clio) task; Headers/Query are then nil. Auth is an interned JSON
// object describing the request's authentication —
// {"type","username","apiKeyName","secretRef"} — where secretRef names a
// server-side secret (ADR-0041), never the value; -1 when unauthenticated.
Url RestExpr
Headers []RestKV
Query []RestKV
Auth int32
Retries int32
// Mail worker fields (JobType == MailJobType, ADR-0079). Worker (above)
// names the server-registered mail provider; the message is authored in the
// model as literal-or-FEEL values evaluated over the instance's variables at
// send time. To and Bcc/Cc are comma-separated recipient lists; From overrides
// the provider's default sender; MailSubject and Body are the message, and
// BodyHTML is its optional HTML half (sent as multipart/alternative beside Body,
// or alone as text/html). Each is the zero RestExpr for a non-mail task. Cc/Bcc/
// From/BodyHTML are also zero when a mail task omits them.
To RestExpr
Cc RestExpr
Bcc RestExpr
From RestExpr
MailSubject RestExpr
Body RestExpr
BodyHTML RestExpr
// CSV worker fields (JobType == CsvImportJobType, ADR-0139). CsvSource is the
// interned name of the process variable holding the raw CSV text (-1 → the
// default "csvText"); CsvResult the variable the parsed rows are written to
// (-1 → "rows"); CsvDelimiter the field delimiter (-1 → ","); CsvHasHeader
// whether the first row is a header; CsvColumns the interned field names (empty →
// derive them from the header row). Each is the zero value for a non-CSV task and
// is read only by the in-process CSV worker, which the runner dispatches by the
// CSV job type alone.
CsvSource int32
CsvResult int32
CsvDelimiter int32
CsvHasHeader bool
CsvColumns []int32
// CsvFormat is the interned file format ("csv" | "fixed-width" | "avp"; interned
// "" is csv, which is what every model authored before formats existed) and
// CsvOperation the direction ("read" | "write"; interned "" is read). CsvWidths
// holds each column's character width for a fixed-width file, positionally
// alongside CsvColumns (ADR-0139, amended).
CsvFormat int32
CsvOperation int32
CsvWidths []int32
// SharePoint worker fields (JobType == SharePointJobType, ADR-0141). Worker
// (above) names the server-registered SharePoint provider (its Graph base and
// OAuth credential live server-side). Site and List address the target list (a
// site host/path or id, and a list name or id); Fields are the created item's
// column values. Each is a literal-or-FEEL value evaluated over the instance's
// variables at call time; Site/List are the zero RestExpr and Fields is nil for a
// non-SharePoint task. ResultVar (above), if set, receives the created item's JSON.
Site RestExpr
List RestExpr
Fields []RestKV
// Remedy worker fields (JobType == RemedyJobType, ADR-0106). Worker (above)
// names the server-registered BMC Remedy instance; ResultVar (above), if set,
// receives the created entry's id. RemedyForm is the Remedy form the entry is
// created in (literal-or-FEEL, the zero RestExpr for a non-remedy task);
// RemedyFields are the entry's field values as name/literal-or-FEEL pairs, evaluated
// over the instance's variables at call time (nil for a non-remedy task).
RemedyForm RestExpr
RemedyFields []RestKV
// Web-scrape worker fields (JobType == WebScrapeJobType, ADR-0118/0190).
// Url (above) is the model-authored document to fetch. HTML uses ScrapeSelector
// (literal-or-FEEL) and optional ScrapeAttribute. ScrapeFormat is compiled from
// format=html|rss|atom; its zero value is HTML so models compiled before ADR-0190
// keep their semantics. ScrapeMaxItems is the deterministic first-N bound (0 =
// unlimited). Feed modes return structured entries and never inspect selector or
// attribute at runtime.
//
// ScrapeFields, when non-empty, changes what one HTML match *is*: the selector
// picks items and every match becomes an object carrying these fields, each read
// by its own field-relative selector and attribute (ADR-0231).
// A field list and ScrapeAttribute are mutually exclusive. ScrapeAbsoluteLinks
// resolves href/src reads against the fetched document's final URL (HTML only);
// ScrapePlainText strips markup from a feed entry's description (feeds only).
ScrapeSelector RestExpr
ScrapeAttribute int32
ScrapeFormat WebScrapeFormat
ScrapeMaxItems int32
ScrapeFields []ScrapeField
ScrapeAbsoluteLinks bool
ScrapePlainText bool
// User-provisioning worker fields (JobType == UserConnectorJobType, ADR-0123).
// UserOp is the interned operation ("create" | "set-password" | "disable").
// UserName identifies the account; UserEmail/UserDisplayName/UserRoles/UserPassword
// are the create/update values — each a literal-or-FEEL value evaluated over the
// instance's variables at call time. Each is the zero value for a non-user task and
// is read only by the in-process user-provisioning worker, which the runner
// dispatches by the user job type alone. There is no Worker and no credential:
// the worker mutates the internal user store directly, gated to the system project.
UserOp int32
UserName RestExpr
UserEmail RestExpr
UserDisplayName RestExpr
UserRoles RestExpr
UserPassword RestExpr
// SCIM worker fields (JobType == ScimJobType, ADR-0153). ScimBaseURL is the
// service provider's SCIM v2 base endpoint and ScimResource the resource-type path
// segment ("Users"/"Groups") — each a literal-or-FEEL value evaluated over the
// instance's variables at call time. ScimOp is the interned operation
// ("create"|"get"|"replace"|"patch"|"delete"|"search"), which the worker maps to an
// HTTP method. ScimResourceID addresses a single resource (get/replace/patch/
// delete); ScimFilter is the SCIM filter for a search. ScimBody is the interned name
// of the process variable holding the create/replace/patch payload (interned "" →
// the whole variable scope, mirroring REST). Each is the zero value for a non-SCIM
// task; ResultVar (above) receives the JSON response and Auth (above) the
// bearer/basic/apiKey credential reference. Read only by the in-process SCIM worker.
ScimBaseURL RestExpr
ScimResource RestExpr
ScimOp int32
ScimResourceID RestExpr
ScimFilter RestExpr
ScimBody int32
// LDAP worker fields (JobType == LdapJobType, ADR-0154). LdapURL is the server
// (ldap://host:389 or ldaps://host:636) and LdapBindDN the bind identity — each a
// literal-or-FEEL value evaluated over the instance's variables at call time.
// LdapBindSecret is the interned name of the server-side secret holding the bind
// password (interned "" → an anonymous bind); LdapStartTLS upgrades a plain
// connection with STARTTLS. LdapOp is the interned operation
// ("search"|"add"|"modify"|"add-values"|"delete-values"|"delete"|
// "modify-password"). LdapDN is the target entry
// (add/modify/delete/modify-password); LdapBaseDN/LdapFilter/LdapScope (interned
// "base"|"one"|"sub") address a search. LdapEntryVar is the interned name of the
// process variable holding the add/modify attribute object; LdapNewPassword is the
// modify-password value. Each is the zero value for a non-LDAP task; ResultVar
// (above) receives a search's entries as a JSON array. Read only by the in-process
// LDAP worker.
LdapURL RestExpr
LdapBindDN RestExpr
LdapBindSecret int32
LdapStartTLS bool
LdapOp int32
LdapDN RestExpr
LdapBaseDN RestExpr
LdapFilter RestExpr
LdapScope int32
LdapEntryVar int32
LdapNewPassword RestExpr
// LdapPageSize and LdapMaxEntries bound a search (ADR-0154, amended). The compiler
// writes the effective value here — the default when the model authored none — so
// the runtime interprets nothing (I5); 0 means unbounded, which a model asks for
// explicitly. LdapClientCertSecret is the interned name of the secret holding a
// PEM certificate+key bundle for a TLS client-certificate bind (interned "" →
// none); with no bind DN it authenticates by SASL EXTERNAL.
LdapPageSize int32
LdapMaxEntries int32
LdapClientCertSecret int32
// SOAP worker fields (JobType == SoapJobType, ADR-0165). SoapEndpoint is the
// web-service URL (from the WSDL's soap:address) — a literal-or-FEEL value evaluated
// over the instance's variables at call time. SoapOp is the interned operation name,
// used for diagnostics and as the default SOAPAction. SoapAction is the SOAPAction
// header value (literal-or-FEEL; the interned SoapOp is used when it evaluates to
// empty). SoapBody is the literal-or-FEEL XML payload placed inside the envelope's
// <soap:Body> — the operation's request element, typically FEEL-interpolated with the
// instance's variables. SoapVersion is the interned protocol version ("1.1"|"1.2"),
// which selects the envelope namespace and how the action is carried. Each is the zero
// value for a non-SOAP task; ResultVar (above) receives the parsed response body and
// Auth (above) the bearer/basic/apiKey credential reference. Read only by the
// in-process SOAP worker.
SoapEndpoint RestExpr
SoapOp int32
SoapAction RestExpr
SoapBody RestExpr
SoapVersion int32
// Active Directory worker fields (JobType == AdJobType, ADR-0166). AdURL is the
// server (ldaps://host:636) and AdBindDN the bind identity — literal-or-FEEL values.
// AdBindSecret is the interned name of the server-side bind-password secret (interned
// "" → anonymous); AdStartTLS upgrades a plain connection. AdOp is the interned
// operation ("create-user"|"set-password"|"enable"|"disable"|"add-group-member"|
// "remove-group-member", "update-attributes", "move", "delete", "create-group",
// "search").
// AdDN is the target user or group entry; AdMemberDN is the
// member added/removed for the group operations; AdEntryVar is the interned name of
// the process variable holding the create-user attribute object; AdNewPassword is the
// set-password value. Each is the zero value for a non-AD task. Read only by the
// in-process AD worker.
AdURL RestExpr
AdBindDN RestExpr
AdBindSecret int32
AdStartTLS bool
AdOp int32
AdDN RestExpr
AdMemberDN RestExpr
AdEntryVar int32
AdNewPassword RestExpr
// AdNewDN is the move operation's target distinguished name (literal-or-FEEL): the
// entry's new place in the tree, new relative name, or both — a mover in a
// directory *is* a DN change, so one value expresses all three.
AdNewDN RestExpr
// Read fields, shared by the two AD operations that read a subtree instead of
// acting on one entry: "sync" (a DirSync delta) and "search" (what is there now).
// AdBaseDN is the base the read starts from and AdFilter narrows it —
// literal-or-FEEL values. AdMaxEntries caps the result (0 = the worker's
// default), and ResultVar (above) receives it.
//
// AdScope is the interned search scope ("base"|"one"|"sub", interned "" → -1 for
// every other operation); a sync authors none, because AD answers DirSync only for
// the whole subtree. AdCookieVar is the interned name of the variable holding the
// sync's opaque resume cookie, which the operation reads *and writes back* so a
// loop carries itself forward, and AdObjectSecurity sets the DirSync flag that
// lets an account without the replication right read the changes it can see.
AdBaseDN RestExpr
AdFilter RestExpr
AdScope int32
AdCookieVar int32
AdMaxEntries int32
AdObjectSecurity bool
// Generic SQL worker fields (JobType == SqlJobType, ADR-0173). Worker
// (above) names the database the *worker* is configured for — a SQL task carries
// no address and no credential, because the DSN never enters the engine. SqlOp is
// the interned operation ("query"|"query-one"|"execute").
//
// SqlStatement is the interned SQL text, and it is an interned string rather than
// a RestExpr on purpose: a RestExpr could hold a FEEL expression, and a statement
// assembled from process data is an injection with no quoting bug required. Data
// reaches the statement only through SqlParamsVar — the interned name of the
// process variable whose value is bound to the statement's placeholders (a JSON
// array binds positionally, an object binds by name). SqlMaxRows caps a query's
// result set (0 = the worker's default); exceeding it fails the job rather than
// truncating, since a short result set is a wrong answer. ResultVar (above)
// receives the rows, the single row, or the affected count.
//
// Each is the zero value for a non-SQL task. No in-process worker reads these:
// they are resolved onto the job and read by a worker (ADR-0164/0168).
SqlOp int32
SqlStatement int32
SqlParamsVar int32
SqlMaxRows int32
// Microsoft Entra ID worker fields (JobType == EntraJobType, ADR-0172).
// Worker (above) names the tenant the *worker* is configured for; a task
// carries no tenant id and no client secret, because they never enter the engine.
// EntraConnector, when its Expr is non-nil, resolves that tenant name at runtime
// instead — a literal-or-FEEL value (e.g. "=tenant") for a process that serves
// more than one tenant. It overrides Worker at resolve time; Worker then
// still holds the authored text ("=tenant") for introspection. Only entra offers
// this, because it is worker-only and no deploy-time credential lookup keys off a
// fixed worker name (ADR-0172).
// EntraOp is the interned lifecycle operation ("create-user"|"get-user"|
// "update-user"|"delete-user"|"enable"|"disable"|"add-group-member"|
// "remove-group-member"). EntraUserID and EntraGroupID are literal-or-FEEL values
// addressing the user (a UPN or object id) and the group. EntraAttributesVar is
// the interned name of the process variable holding the directory properties for
// create-user and update-user; ResultVar (above) receives what Graph returned.
//
// EntraFilter, EntraSelect, EntraPageSize and EntraMaxUsers configure list-users
// and are zero on every other operation, which the compiler enforces rather than
// ignores. EntraFilter is a literal-or-FEEL OData $filter and EntraSelect the
// interned $select projection. EntraPageSize is the $top asked of each request
// (0 leaves Graph its own page size) and EntraMaxUsers caps what may reach the
// result variable (0 is unbounded); the compiler has already applied the defaults,
// so the runtime interprets nothing (I5). EntraSearch is a literal-or-FEEL $search
// term and EntraAdvanced asks for Graph's advanced query support; a search sets
// the flag on its own, because Graph offers no other way to run one.
//
// Each is the zero value for a non-Entra task. No in-process worker reads these:
// they are resolved onto the job and read by a worker (ADR-0164/0168).
EntraOp int32
EntraConnector RestExpr // literal-or-FEEL tenant name; when Expr != nil it overrides Worker at resolve time
EntraUserID RestExpr
EntraGroupID RestExpr
EntraNewPassword RestExpr // reset-password's new secret (literal-or-FEEL), zero otherwise
EntraAttributes RestExpr // inline attributes JSON compiled to a FEEL context, zero when a variable is named instead
EntraAttributesVar int32
EntraFilter RestExpr
EntraSelect int32
EntraPageSize int32
EntraMaxUsers int32
EntraSearch RestExpr
EntraAdvanced bool
// EntraDeltaLink resumes a change-tracking query (delta-users, delta-groups): a
// literal-or-FEEL value naming the @odata.deltaLink a previous run returned, empty
// (a fresh full enumeration) on the first run. It is the zero RestExpr on every
// other operation, which the compiler enforces (ADR-0172).
EntraDeltaLink RestExpr
// Directory-file worker fields (JobType == LdifJobType, ADR-0171). LdifFormat
// is the interned file format ("ldif" | "dsml") and LdifOperation the direction
// ("read" | "write"). LdifSource is the interned name of the variable holding the
// file text (read) or the entries (write); LdifResult the variable receiving the
// entries (read) or the rendered file (write).
//
// Unlike the text-file worker there is no default format: a file is LDIF or it
// is DSML, and guessing from the bytes is how a malformed file becomes a
// plausible-looking empty result.
LdifFormat int32
LdifOperation int32
LdifSource int32
LdifResult int32
// Jira worker fields (JobType == JiraJobType, ADR-0201).
// Worker (above) names the server-registered Jira instance — its base URL and
// credential live in the managed worker store and the vault, never in a model.
// JiraOp is the interned operation ("create-issue"|"get-issue"|"update-issue"|
// "transition-issue"|"add-comment"|"assign-issue"|"search"|"search-users"), and it
// decides which of the rest are populated; the compiler refuses a value on an
// operation that does not use it, so a field can never be quietly ignored at call
// time.
//
// JiraIssue addresses one issue by key or id (every operation but create and the two
// searches). JiraProject, JiraIssueType, JiraSummary and JiraDescription are the
// created issue's core fields — summary and description also carry an update.
// JiraTransition names the workflow transition to perform, by id or by the name
// shown in Jira; JiraComment is a comment body (its own operation, and optionally
// alongside a transition); JiraAssignee is the account the issue is handed to.
// JiraJQL is an issue search's query and JiraQuery an account search's term — a
// fragment of a display name or an address, which JiraProject may restrict to the
// accounts one project can assign. JiraMaxResults caps what either search may land in
// the result variable — the compiler has already applied the default, so the runtime
// interprets nothing (I5).
//
// JiraFields are extra issue fields as name/literal-or-FEEL pairs (create, update
// and transition), which is how a custom field or a field this worker does not
// name is set. Each RestExpr is a literal-or-FEEL value evaluated over the
// variables the task sees at call time; all are the zero value for a non-Jira task.
// ResultVar (above) receives what Jira returned, for the operations that return
// anything.
JiraOp int32
JiraIssue RestExpr
JiraProject RestExpr
JiraIssueType RestExpr
JiraSummary RestExpr
JiraDescription RestExpr
JiraTransition RestExpr
JiraComment RestExpr
JiraAssignee RestExpr
JiraJQL RestExpr
JiraQuery RestExpr
JiraMaxResults int32
JiraFields []RestKV
// Google Sheets fields (JobType == GoogleSheetsJobType,
// ADR-0235). Connector (above) names the Worker — the field
// keeps that name because the BPMN attribute it is read from does; its credential
// lives in the Worker store and the vault, never in a model. SheetsOp is the interned operation ("create-spreadsheet"|
// "add-sheet"|"read-range"|"write-range"|"append-row"|"clear-range"|"delete-sheet"|
// "delete-spreadsheet"), and it decides which of the rest are populated; the
// compiler refuses a value on an operation that does not use it, so a field can
// never be quietly ignored at call time.
//
// SheetsID addresses the spreadsheet (every operation but create). SheetsTab is a
// tab title — the tab added or deleted, or the first tab of a new file — and
// SheetsRange the A1 range the four cell-level operations act on, which may name
// its own sheet ("Anträge!A2:F"). SheetsTitle and SheetsFolder are a new
// spreadsheet's name and the Drive folder it is moved into. SheetsValues is what
// the two writing operations write: one literal-or-FEEL value whose result is a
// list of rows, a list of objects, or one row of cells.
//
// SheetsColumns, SheetsInput and SheetsHeader are compiled structure rather than
// authored values, because each decides the *shape* of a call rather than its
// content, and a shape that differed per token would not be one. SheetsColumns
// names the fields and their order a list of objects is projected through;
// SheetsInput is the interned value-input mode ("user"|"raw", already defaulted so
// the runtime interprets nothing, I5); SheetsHeader makes a read answer with
// objects keyed by the range's first row instead of raw rows.
//
// Each RestExpr is a literal-or-FEEL value evaluated over the variables the task
// sees at call time; all are the zero value for a non-Sheets task. ResultVar
// (above) receives what Google returned, for the operations that return anything.
SheetsOp int32
SheetsID RestExpr
SheetsTab RestExpr
SheetsRange RestExpr
SheetsTitle RestExpr
SheetsFolder RestExpr
SheetsValues RestExpr
SheetsColumns []string
SheetsInput int32
SheetsHeader bool
// Discord fields (JobType == DiscordJobType, ADR-0258). Connector
// (above) names the configured Discord Worker — the field keeps that name because
// the BPMN attribute it is read from does; its bot token lives in the Worker store
// and the vault, never in a model. DiscordOp is the interned operation
// ("send-message"|"edit-message"|"delete-message"|"get-message"|"list-messages"|
// "create-thread"), and it decides which of the rest are populated; the compiler
// refuses a value on an operation that does not use it, so a field can never be
// quietly ignored at call time.
//
// DiscordChannel addresses the channel every operation acts in — a thread is a
// channel in Discord, so replying in one is a send addressing the thread's id
// rather than an operation of its own. DiscordMessage addresses one message (the
// three that act on one, and optionally create-thread, where naming a message is
// what hangs the thread under it instead of starting a standalone one).
// DiscordContent is a message body and DiscordName a new thread's title.
//
// DiscordAfter is a list's lower bound: the message id to read after. It is
// exclusive and Discord orders by id, so a process can page a channel forward
// without re-reading what it already has. DiscordMaxResults caps what a list may
// return, already defaulted by the compiler so the runtime interprets nothing (I5).
//
// DiscordFields are extra request-body properties as name/literal-or-FEEL pairs,
// each keeping the JSON shape its value had — how a model reaches embeds,
// allowed_mentions or components without this type naming every property Discord
// will ever add. They are merged last, so a model can override what the worker
// composed.
//
// Each RestExpr is a literal-or-FEEL value evaluated over the variables the task
// sees at call time; all are the zero value for a non-Discord task. ResultVar
// (above) receives what Discord returned, for the operations that return anything.
DiscordOp int32
DiscordChannel RestExpr
DiscordMessage RestExpr
DiscordContent RestExpr
DiscordName RestExpr
DiscordAfter RestExpr
DiscordMaxResults int32
DiscordFields []RestKV
// AI task fields (JobType == AiTaskJobType, ADR-0256). Connector (above) names the
// agent Worker holding the endpoint, the credential and the wire format;
// a task carries none of those, because a provider is configured and not authored.
//
// AgentModel is the interned language model to ask, -1 when the task names none
// and inherits the Worker's configured default. It is authored rather than
// configured for the same reason a decision id or a REST URL is: it says what the
// step does, not how the deployment reaches anything, and a process wanting a
// small model for a classification and a strong one for the advice beside it
// should not need two Workers over one string.
//
// AgentPrompt is the question — a literal-or-FEEL value evaluated over the
// variables the task sees at call time — and ResultVar (above) receives the
// answer. There is no tool list: a step with tools is the ad-hoc container
// (ADR-0253), not this.
AgentModel int32
AgentPrompt RestExpr
}
ConnectorTaskDetail is the per-connector-task data a behavior needs at runtime. A task delegates to a server-registered worker evaluated off the hot path by a job worker (ADR-0036). Like a service task it runs as a job, so it carries a JobType (a reserved worker sentinel) the in-process worker worker subscribes to, and Worker names the server-registered worker to resolve at runtime. The JobType also selects which Worker Type this is, and thus which of the kind-specific fields below are populated:
- clio "write-events" (JobType == ClioWriteJobType): Worker names the server-registered clio instance; Subject and EventType are the interned clio coordinates the appended event lands under. The event body is what the task's zeebe:ioMapping inputs map, or — for a task with none — every variable it sees (ADR-0174).
- clio "query" (JobType == ClioQueryJobType): Worker names the clio instance; the task reads projected state or runs a stored query and writes the result into ResultVar. Either ClioQuery (a run_query query string) is set — then the worker runs that query — or Subject (with the optional ReduceSpec projection) is set — then the worker reads get_state for that subject.
- clio "read" (JobType == ClioReadJobType): Worker names the clio instance; Subject is the subject whose events are read (up to Limit, 0 = the worker's default) into ResultVar as a JSON array.
- HTTP REST (JobType == RestJobType): Method and Url are the interned request method (e.g. "POST") and the full endpoint URL authored in the model (ADR-0067, revising ADR-0036 for REST); a method that carries one gets the body described below; ResultVar, if set, is the process variable the JSON response is written back into on completion.
- SharePoint (JobType == SharePointJobType): Worker names the server-registered SharePoint provider; Site and List address the target list and Fields are the created item's column values (all literal-or-FEEL); the created item's JSON is written into ResultVar when set (ADR-0141).
- BMC Remedy (JobType == RemedyJobType): Worker names the server-registered Remedy instance; RemedyForm and RemedyFields are the form and the entry's field values (literal-or-FEEL) an incident/entry is created with through the AR System REST API; ResultVar, if set, receives the created entry's id (ADR-0106).
- Google Sheets (JobType == GoogleSheetsJobType): Connector names the Worker whose Google credential the server holds; SheetsOp is the spreadsheet operation and the Sheets* fields below are the values and the shape it takes; ResultVar, if set, receives what Google returned.
- Jira (JobType == JiraJobType): Worker names the server-registered Jira instance; JiraOp is the issue-tracker operation and the Jira* fields below are the values it takes (all literal-or-FEEL); ResultVar, if set, receives what Jira returned (ADR-0201).
- Discord (JobType == DiscordJobType): Connector names the configured Discord Worker whose bot token the server holds; DiscordOp is the chat operation and the Discord* fields below are the values it takes (all literal-or-FEEL); ResultVar, if set, receives what Discord returned (ADR-0258).
- web scrape (JobType == WebScrapeJobType): Url is the model-authored page to fetch (literal-or-FEEL, like REST); ScrapeSelector is the CSS selector whose matches are extracted; ScrapeAttribute names the HTML attribute to read from each match (-1 → each match's text content); ResultVar receives the extracted values as a JSON array (ADR-0118). With ScrapeFields set, the selector picks items instead and each match becomes an object of those fields (ADR-0231).
Unused fields for a given kind are -1 (Intern maps that back to ""); Limit is 0 when unset. No kind carries its body in the detail: where a payload is a variable scope — the clio event body, the REST request body, the SCIM body with no body variable named — it is the task's zeebe:ioMapping inputs, or everything the task sees when it maps none (ADR-0174).
type CsvConfig ¶ added in v0.2.0
type CsvConfig struct {
Source string
Result string
Delimiter string
HasHeader bool
Columns []string
Retries int32
// Format is the file format and Operation the direction; empty means csv and
// read. Widths carries each column's character width for a fixed-width file,
// positionally alongside Columns.
Format string
Operation string
Widths []int32
}
CsvConfig is the deploy-time configuration of a CSV-to-JSON task (ADR-0139). Source names the process variable holding the raw CSV text (empty → the worker's default "csvText"); Result the variable the parsed rows are written to (empty → "rows"); Delimiter the field delimiter (empty → ","); HasHeader whether the first row is a header; Columns the field names (empty → derive them from the header row). All are interned deploy-time data (I5).
type DataInputAssociation ¶
type DataInputAssociation struct {
DataObject int32 // interned source data-object name → index
Variable int32 // interned target process-variable name → index
Value *expr.Compiled
}
DataInputAssociation is one compiled <dataInputAssociation> on an activity: it reads a data object into a process variable when the activity activates, so the activity's FEEL can see it (ADR-0059). DataObject is the interned source data-object name (resolved from the association's sourceRef); Variable is the interned target process-variable name (its targetRef) the read value is written into; Value is the optional <assignment><from> FEEL transform, evaluated over the instance's variables plus the source object bound under its name — nil copies the object's value verbatim.
type DataOutputAssociation ¶
type DataOutputAssociation struct {
DataObject int32 // interned target data-object name → index
Value *expr.Compiled
TargetState int32
// TargetPath is the interned member path (the association's <assignment><to>,
// e.g. "name" or "customer.name") the write sets within a structured data
// object, -1 to write the whole value (ADR-0060). A path write reads the object's
// current JSON, sets that member, and writes the merged value back.
TargetPath int32
}
DataOutputAssociation is one compiled <dataOutputAssociation> on an activity: it writes a value into a data object and advances that object's data state when the activity completes (ADR-0058). DataObject is the interned target data-object name; Value is the FEEL expression (the association's <assignment><from>) evaluated over the instance's variables to produce the written value, nil for a state-only transition; TargetState is the interned data state the write moves the object into (from the target <dataObjectReference>'s <dataState>), -1 to keep the object's current state.
type DecisionBinding ¶
type DecisionBinding int32
DecisionBinding selects which DMN model version a local business rule task evaluates against (ADR-0063). It mirrors Camunda's zeebe:calledDecision bindingType. It applies only to local decisions; a central (worker) decision resolves through its worker, so Binding is ignored when Worker is set.
const ( // BindingLatest evaluates the newest deployed version of the decision (the // default, matching Camunda). It is zero so an unset binding means "latest". BindingLatest DecisionBinding = iota // BindingDeployment evaluates the decision snapshotted with this process's own // deployment (the ADR-0014 behavior): pinned and reproducible. BindingDeployment )
func (DecisionBinding) String ¶
func (b DecisionBinding) String() string
String renders a binding as the lower-case token used on the wire and in the Modeler (`bindingType`): "latest" or "deployment". Any unknown value is reported verbatim so a drift is visible rather than silently mapped to latest.
type DecisionInputMapping ¶
type DecisionInputMapping struct {
Target string // the decision input name this value binds to
Source *expr.Compiled // FEEL expression evaluated over instance variables
}
DecisionInputMapping is one explicit input to a DMN decision: the decision's input name (Target) fed by a FEEL expression (Source) evaluated over the process instance's variables at evaluation time. It is the variable-driven replacement for a business rule task's static inputs (ADR-0014): the source expression is compiled once at deploy time (invariant I5) and the DMN worker evaluates it off the hot path against live variables, so a decision routes on real instance data.
type Deployable ¶
type Deployable struct {
Process *CompiledProcess
PoolName string
ProcessName string
}
Deployable is one executable process compiled from a model, plus the display metadata a collaboration provides. PoolName is the participant (pool) name that references the process — "" for a standalone <process> outside any <collaboration>; ProcessName is the process's own name attribute.
func ParseAll ¶
ParseAll compiles every executable process in a model — the collaboration case, where a <collaboration> has several <participant> pools, each referencing a <process>. A process is executable (and thus returned) iff it has a start event; a participant whose process is a black box (no start event, or none) is skipped rather than erroring, since a message-flow counterpart pool is often left unmodeled. The i-th executable process (document order) is keyed baseKey+i, so a caller assigning keys sequentially advances its counter by len(result). It errors only if the model has no executable process at all.
type DiscordConfig ¶ added in v0.5.0
type DiscordConfig struct {
Connector string
Operation string
Channel RestExpr
Message RestExpr
Content RestExpr
Name RestExpr
After RestExpr
MaxResults int32
Fields []RestKV
ResultVar string
Retries int32
}
DiscordConfig is the deploy-time configuration of a Discord task (ADR-0258). Worker names the configured Discord Worker (its bot token lives server-side, never in the model) and Operation is the chat operation. The remaining values are the ones that operation takes — literal-or-FEEL values (the parser compiles the FEEL ones) evaluated over the variables the task sees at call time. MaxResults is a list's cap and After its lower bound, both already defaulted by the compiler so the runtime interprets nothing (I5). ResultVar, if set, is the process variable what Discord returned is written back into.
type EntraConfig ¶ added in v0.3.0
type EntraConfig struct {
Connector string
// ConnectorExpr carries the worker name as a literal-or-FEEL value when the
// author wants the tenant chosen at runtime (e.g. "=tenant" on a multi-tenant
// joiner). It is the zero RestExpr for the ordinary static case, where Worker
// alone names the tenant. Only entra takes this: the kind is worker-only, so no
// deploy-time credential lookup keys off a fixed name (ADR-0172).
ConnectorExpr RestExpr
Op string
UserID RestExpr
GroupID RestExpr
NewPassword RestExpr
Attributes RestExpr
AttributesVar string
ResultVar string
Filter RestExpr
Select string
PageSize int32
MaxUsers int32
Search RestExpr
Advanced bool
// DeltaLink is the resume cursor for a change-tracking query (delta-users,
// delta-groups): a literal-or-FEEL @odata.deltaLink from a previous run, empty on
// the first. Zero on every other operation.
DeltaLink RestExpr
Retries int32
}
EntraConfig is the deploy-time configuration of a Microsoft Entra ID worker task (ADR-0172). Worker names the tenant the worker is configured for — a task carries no tenant id and no client secret, because they never enter the engine. Op is the lifecycle operation. UserID and GroupID are literal-or-FEEL values addressing the user (a UPN or object id) and the group; AttributesVar names the process variable holding the directory properties for create-user and update-user; ResultVar receives what Graph returned (empty = discard).
Filter, Select, PageSize, MaxUsers, Search and Advanced configure list-users: the OData $filter (literal-or-FEEL), the $select projection, the $top per request, the cap on what may reach the result variable, the $search term (literal-or-FEEL), and whether the query asks for Graph's advanced query support. The compiler has already applied their defaults, set Advanced for a search, and refused all of them on the operations that return one object or none.
type ErrorEndDetail ¶
type ErrorEndDetail struct {
ErrorCode string
}
ErrorEndDetail is the per-error-end-event data the runtime needs: the code it throws (ADR-0089). A code-less error end throws "", which a code-less catch-all catches. It is its own small table (an error end carries no name, correlation key, or schedule).
type EscalationDetail ¶ added in v0.2.0
type EscalationDetail struct {
EscalationCode string
}
EscalationDetail is the per-escalation-event data the runtime needs: the code it raises (ADR-0125). Shared by the escalation throw and end events (like CompensationDetail is shared by the compensation throw and end), since both just carry the escalation code. A code-less escalation raises "", which a code-less catch-all catches.
type EventSubProcessDetail ¶
type EventSubProcessDetail struct {
StartNode int32 // the handler's inner start event node id
Interrupting bool // true = terminate the parent scope's other work on trigger (isInterrupting)
Kind BoundaryEventKind
Schedule TimerSchedule // BoundaryTimer: when the trigger fires
MessageName string // BoundaryMessage: the message it subscribes to
CorrelationKey *expr.Compiled // BoundaryMessage: correlation-key expression (ADR-0020)
SignalName string // BoundarySignal: the signal it subscribes to (ADR-0088)
ErrorCode string // BoundaryError: the error code it catches; "" is a catch-all (ADR-0089)
EscalationCode string // BoundaryEscalation: the escalation code it catches; "" is a catch-all (ADR-0125)
Condition *expr.Compiled // BoundaryConditional: the boolean FEEL condition it fires on (ADR-0137)
}
EventSubProcessDetail is the per-event-subprocess data the runtime needs to arm its trigger (ADR-0082). An event subprocess (`<subProcess triggeredByEvent="true">`) is not entered by a sequence flow; instead its start event's event definition is armed while the parent scope runs. Interrupting (from the start event's isInterrupting, default true) decides whether firing terminates the parent scope's other work before the handler runs. Kind reuses BoundaryEventKind: the timer field applies for a timer trigger, the message fields for a message trigger. StartNode is the handler's inner start event, seeded (like any message/timer start, flowing straight on) when the handler is activated on a trigger.
type GoogleSheetsConfig ¶ added in v0.5.0
type GoogleSheetsConfig struct {
Worker string
Operation string
Spreadsheet RestExpr
Sheet RestExpr
Range RestExpr
Title RestExpr
Folder RestExpr
Values RestExpr
Columns []string
Input string
Header bool
ResultVar string
Retries int32
}
GoogleSheetsConfig is the deploy-time configuration of a Google Sheets task (ADR-0235). Worker names the Google identity an operator configured (whose credential lives server-side, never in the model) and Operation is the spreadsheet operation. It is read from the task's `connector="…"` attribute, which keeps the pre-ADR-0203 spelling because it is authored in deployed models. The remaining values are the ones that operation takes — literal-or-FEEL values (the parser compiles the FEEL ones) evaluated over the variables the task sees at call time.
Columns, Input and Header are compiled structure rather than authored values: they decide the *shape* of what is written or read, and a shape that could differ on every token is not a shape. The compiler has already applied the Input default, so the runtime interprets nothing (I5). ResultVar, if set, is the process variable what Google returned is written back into.
type IOMapping ¶
type IOMapping struct {
Target int32 // interned target variable name → index
Source *expr.Compiled // FEEL expression evaluated to produce the value
}
IOMapping is one compiled zeebe:ioMapping entry on an activity — an input or an output — the generic, task-agnostic variable mapping of ADR-0068. Source is a FEEL expression compiled once at deploy time (invariant I5); Target is the interned variable name it writes. The two directions differ only in where they read and write at runtime (phase 4): an input evaluates Source over the scope chain from the activity's flow scope and writes Target into the activity-local scope on activation; an output evaluates Source over the local scope and writes Target into the parent (flow) scope on completion. The compiler only records them; the engine applies them.
type JiraConfig ¶ added in v0.5.0
type JiraConfig struct {
Connector string
Operation string
Issue RestExpr
Project RestExpr
IssueType RestExpr
Summary RestExpr
Description RestExpr
Transition RestExpr
Comment RestExpr
Assignee RestExpr
JQL RestExpr
Query RestExpr
MaxResults int32
Fields []RestKV
ResultVar string
Retries int32
}
JiraConfig is the deploy-time configuration of a Jira task (ADR-0201). Worker names the server-registered Jira instance (its base URL and credential live server-side, never in the model) and Operation is the issue-tracker operation. The remaining values are the ones that operation takes — literal-or-FEEL values (the parser compiles the FEEL ones) evaluated over the variables the task sees at call time. MaxResults is a search's cap, already defaulted by the compiler so the runtime interprets nothing (I5). ResultVar, if set, is the process variable what Jira returned is written back into.
type LaneDetail ¶ added in v0.2.0
type LaneDetail struct {
Name int32 // interned lane name → index, -1 if unnamed
Parent int32 // index into lanes of the enclosing lane, -1 for a top-level lane
}
LaneDetail is one BPMN lane: an organizational partition of the process's flow nodes with no execution semantics (ADR-0121). Name is the interned lane label; Parent is the index of the enclosing lane in a nested laneSet (-1 for a top-level lane), so a node's full lane path can be walked leaf-to-root for display.
type LdapConfig ¶ added in v0.3.0
type LdapConfig struct {
URL RestExpr
BindDN RestExpr
BindSecret string
StartTLS bool
Op string
DN RestExpr
BaseDN RestExpr
Filter RestExpr
Scope string
EntryVar string
NewPassword RestExpr
ResultVar string
// PageSize and MaxEntries are the effective search bounds; the compiler has
// already applied the defaults, and 0 means unbounded. ClientCertSecret names the
// secret holding a PEM certificate+key bundle for a client-certificate bind.
PageSize int32
MaxEntries int32
ClientCertSecret string
Retries int32
}
LdapConfig is the deploy-time configuration of a generic LDAP task (ADR-0154). URL is the server (ldap://host:389 or ldaps://host:636) and BindDN the bind identity — literal-or-FEEL values; BindSecret names the server-side secret for the bind password (empty → an anonymous bind); StartTLS upgrades a plain ldap:// connection with STARTTLS. Op is the operation ("search"|"add"|"modify"|"delete"|"modify-password"). DN is the target entry (add/modify/delete/modify-password); BaseDN/Filter/Scope address a search; EntryVar names the process variable holding the add/modify attribute object; NewPassword is the modify-password value. ResultVar receives a search's entries as a JSON array.
type LdifConfig ¶ added in v0.3.0
LdifConfig is the deploy-time configuration of a directory-file task (ADR-0171). Format is "ldif" or "dsml" and Operation "read" or "write"; Source names the variable holding the file text (read) or the entries (write), and Result the variable receiving the entries (read) or the rendered file (write).
type MailConfig ¶
type MailConfig struct {
Connector string
To RestExpr
Cc RestExpr
Bcc RestExpr
From RestExpr
Subject RestExpr
Body RestExpr
BodyHTML RestExpr
Retries int32
}
MailConfig is the deploy-time configuration of an outbound mail task (ADR-0079). Worker names the server-registered mail provider (its host and credentials live server-side, never in the model); To/Cc/Bcc/From/Subject/Body carry literal-or-FEEL values (the parser compiles the FEEL ones) evaluated over the instance's variables at send time. To and Subject/Body are the message; Cc, Bcc and From are optional (a zero RestExpr means unset).
type MessageDetail ¶
type MessageDetail struct {
MessageName string
CorrelationKey *expr.Compiled
// SingletonStart marks a message *start* event as one-per-correlation-key: while
// an instance started with a given key is live, another correlating message starts
// no duplicate (ADR-0094). Only meaningful on a message start event; ignored on
// catch/throw/end. Default false keeps ADR-0035's start-per-message behavior.
SingletonStart bool
}
MessageDetail is the per-message-event data a behavior needs at runtime, shared by the message intermediate catch and throw events. MessageName is the message's name (a subscription matches on it); CorrelationKey is the FEEL expression compiled once at deploy time (ADR-0015) that each side evaluates over its own variables to produce the correlation key (ADR-0020).
type MessageStartEvent ¶
type MessageStartEvent struct {
MessageName string
ElementId int32
CorrelationKey *expr.Compiled
SingletonStart bool // one live instance per correlation key (ADR-0094)
}
MessageStartEvent pairs a message-start event's message name with its element index, so the engine can index which element a starting message flows into for the collaboration replay (ADR-0038). CorrelationKey is the FEEL expression compiled at deploy time; the engine evaluates it over a starting message's payload so the created instance records which key it began with (ADR-0020). It is nil when the event declares no correlation key.
type MockupConfig ¶ added in v0.2.0
type MockupConfig struct {
MinNanos int64
MaxNanos int64
ResultVar string
Expr *expr.Compiled
FailPerMillion int32
FailMessage string
ErrorCode string
}
MockupConfig is the authored configuration of a mockup (engine-simulated) service task (ADR-0120). MinNanos/MaxNanos bound the random simulated duration (MaxNanos >= MinNanos, both >= 0). Expr, when non-nil, is the compiled FEEL result expression written to ResultVar on activation (the input→output script). FailPerMillion is the failure probability in parts-per-million (0..1_000_000). FailMessage is the incident message used when a simulated failure occurs.
type MockupTaskDetail ¶ added in v0.2.0
type MockupTaskDetail struct {
MinNanos int64 // minimum simulated duration in nanoseconds
MaxNanos int64 // maximum simulated duration in nanoseconds (>= MinNanos)
ResultVar string // result-variable name, "" if none (a raw string, like ScriptTaskDetail.ResultVar)
Expr *expr.Compiled // FEEL result expression compiled at deploy time (I5), nil if none
FailPerMillion int32 // failure probability in parts-per-million, 0..1_000_000
FailMessage string // incident message on a simulated failure, "" for a default
// ErrorCode, when non-empty, makes a simulated failure throw a BPMN error with this
// code (caught by a matching error boundary/event subprocess, ADR-0089) instead of
// raising an incident — so business error paths, not just technical ones, are
// exercisable. Empty keeps the incident behavior.
ErrorCode string
}
MockupTaskDetail is the per-mockup-task data the engine reads to simulate a service task itself (ADR-0120), instead of dispatching a job to an external worker. On activation the behavior arms a one-shot timer for a random duration in [MinNanos, MaxNanos] and, if Expr is set, evaluates it over the instance's variables and writes the result into ResultVar (the input→output "script", e.g. a simulated REST response). When the timer fires the task completes — unless the fail draw selects failure, in which case a job-less incident is raised with FailMessage.
The random duration and the fail decision are derived deterministically from the frozen timer key at command time (never re-drawn on replay), so no new nondeterministic source enters the engine (invariant I6). FailPerMillion is the failure probability scaled to parts-per-million (0 = never fail, 1_000_000 = always) so the whole decision stays integer-pure across live and replay.
type MultiInstanceDetail ¶
type MultiInstanceDetail struct {
InputCollection *expr.Compiled // FEEL list to iterate; nil when Cardinality is used
Cardinality *expr.Compiled // FEEL count; nil when InputCollection is used
InputElement int32 // interned per-iteration variable name, -1 if none
OutputCollection int32 // interned result-list variable name, -1 if none
OutputElement *expr.Compiled // FEEL per-iteration contribution, nil if none
CompletionCondition *expr.Compiled // FEEL early-exit, nil if none
Sequential bool // one iteration at a time (else parallel)
Standard bool // a <standardLoopCharacteristics> loop (ADR-0133)
TestBefore bool // standard loop: check the condition before iteration 1
LoopCondition *expr.Compiled // standard loop: FEEL repeat-while, nil if none
LoopMaximum int32 // standard loop: iteration cap, 0 = uncapped
}
MultiInstanceDetail is the per-multi-instance-activity data a behavior needs at runtime (ADR-0077). A multi-instance activity runs its node N times — once per element of InputCollection (a FEEL list), or Cardinality times — as inner element instances scoped under a body. InputElement (interned, -1 if none) is the local variable each iteration binds to its item; the standard loopCounter (1-based) is bound alongside it. Each iteration's OutputElement (a FEEL over its variables, nil if none) is appended to the OutputCollection (interned, -1 if none) list promoted to the parent when the loop completes. CompletionCondition (nil if none) is a FEEL early-exit evaluated after each iteration. Sequential runs one iteration at a time; parallel (the default) seeds them all at once. Exactly one of InputCollection or Cardinality is set — the deploy is refused otherwise.
Standard marks the other BPMN loop marker, <standardLoopCharacteristics> — the loop (circular arrow) icon (ADR-0133). It shares this struct because it shares the runtime: a standard loop is a sequential loop whose iteration set is not a collection but a condition, so it has no InputCollection, Cardinality, InputElement, or OutputCollection, and is driven instead by LoopCondition (nil means "repeat until LoopMaximum"), TestBefore (check the condition before the first iteration — a while loop; else a repeat-until that always runs at least once), and LoopMaximum (a hard iteration cap; 0 means uncapped). At least one of LoopCondition and LoopMaximum is set — the deploy is refused otherwise, since a loop with neither has no way to end.
type NodeSet ¶ added in v0.5.0
type NodeSet struct {
// contains filtered or unexported fields
}
NodeSet is a compile-time set of node ids, held as a bitset. It answers membership and nothing else, which is all the runtime asks of it, and it is immutable once built — so one lives on the CompiledProcess and is shared by every instance of it (invariant I5).
The zero NodeSet is empty and safe to query.
type Problem ¶
type Problem struct {
Element string `json:"element"`
Severity Severity `json:"severity"`
Rule string `json:"rule"`
Message string `json:"message"`
}
Problem is one structured validation finding on a compiled process, shaped for ADR-0026's Problems panel and the future POST /api/v1/validate endpoint. Element is the source BPMN element id it anchors to (the id bpmn-js uses, e.g. "Gateway_1"; "" for a process-level finding or a node compiled without a source id); Severity ranks it; Rule is the stable machine slug of the check that raised it; Message is a human-readable explanation.
func Validate ¶
func Validate(cp *CompiledProcess) []Problem
Validate runs the compiler's graph-wide checks (compiler.md stage 5, ROADMAP Milestone 1) over a linearized CompiledProcess and returns every structured Problem it finds — not just the first — so a Problems panel can list them all in one pass. It never mutates cp and is safe to call concurrently on an immutable process. compileProcess calls it as the final compile stage and refuses the deploy when HasErrors holds; the future /validate dry-run returns the full list (errors and warnings) verbatim.
Problems are returned in a deterministic order — by check family, then by node or flow index within each — so a caller (and a test) sees a stable sequence.
func ValidateModel ¶
ValidateModel runs the compiler's real parse → resolve → build → validate pipeline over a BPMN model as a *dry run* — it mints no keys, registers no definition, and starts no instance — and returns every validation Problem (errors and warnings) across all of the model's executable pools. It is the single source of validation truth behind ADR-0026's Problems panel and the POST /api/v1/validate endpoint: the panel never re-implements these rules (that would be the interpret-don't-compile failure mode I5 forbids), it renders what this returns.
Unlike ParseAll, which stops at the first fault so a deploy fails fast, the dry run reports everything at once — that is what a Problems panel needs. Faults the graph checks cannot anchor to a node still surface as Problems so the panel renders them uniformly: a document that will not parse, or a model with no executable process, becomes one RuleParse error; a pool that fails an earlier compile stage becomes one RuleCompile error rather than aborting the whole run and blinding the panel to the other pools.
The returned error is always nil today — every modeling fault is reported as a Problem, not an error — but the signature keeps an error so a future source that does I/O can report a read failure distinctly from a modeling one.
type RemedyConfig ¶
type RemedyConfig struct {
Connector string
Form RestExpr
Fields []RestKV
ResultVar string
Retries int32
}
RemedyConfig is the deploy-time configuration of a BMC Remedy task (ADR-0106). Worker names the server-registered Remedy instance (its base URL and credentials live server-side, never in the model). Form is the Remedy form the entry is created in (e.g. "HPD:IncidentInterface_Create"); Fields carries the entry's field values as name/literal-or-FEEL pairs evaluated over the instance's variables at call time (the fx toggle, ADR-0067). ResultVar, if set, is the process variable the created entry's id is written back into.
type RestAuth ¶
type RestAuth struct {
Type string `json:"type,omitempty"`
Username string `json:"username,omitempty"`
ApiKeyName string `json:"apiKeyName,omitempty"`
SecretRef string `json:"secretRef,omitempty"`
TokenURL string `json:"tokenUrl,omitempty"`
ClientID string `json:"clientId,omitempty"`
Scope string `json:"scope,omitempty"`
}
RestAuth is a REST worker task's authentication config. Type is "", "basic", "bearer", "apiKey", or "oauth2". Username (basic), ApiKeyName (the apiKey header name), ClientID/TokenURL/Scope (oauth2 client-credentials) are model data. SecretRef names a server-side secret (ADR-0041) — the basic password, bearer token, api-key value, or oauth2 client secret — resolved at runtime; the secret value itself is never authored in the model or stored here.
For Type "oauth2" the worker performs a client-credentials grant (ADR-0152): TokenURL is the token endpoint, ClientID the client identifier, SecretRef the client secret reference, and Scope the optional space-delimited scopes; the fetched access token is attached as a Bearer credential and cached until it nears expiry.
type RestConfig ¶
type RestConfig struct {
Method string
Url RestExpr
ResultVar string
Headers []RestKV
Query []RestKV
Auth RestAuth
Retries int32
}
RestConfig is the deploy-time configuration of an HTTP-REST task (ADR-0067). Method and ResultVar are interned; Url, Headers, and Query carry literal-or-FEEL values (the parser compiles the FEEL ones); Auth references a server-side secret.
type RestExpr ¶
RestExpr is a REST worker field value that is either a literal string (Expr == nil, use Literal) or a FEEL expression evaluated over the instance's variables at call time (Expr != nil), compiled once at deploy time (invariant I5, ADR-0008/0067). It backs the modeler's fx toggle: a model value with a leading '=' is an expression, otherwise a literal.
type RestKV ¶
RestKV is a named REST field value (one request header or query parameter): its Name and a value that may be literal or a FEEL expression.
type ScimConfig ¶ added in v0.3.0
type ScimConfig struct {
BaseURL RestExpr
Resource RestExpr
Op string
ResourceID RestExpr
Filter RestExpr
BodyVar string
ResultVar string
Auth RestAuth
Retries int32
}
ScimConfig is the deploy-time configuration of a SCIM 2.0 task (ADR-0153). BaseURL and Resource address the service provider and resource type ("Users"/"Groups"); Op is the operation ("create"|"get"|"replace"|"patch"| "delete"|"search"); ResourceID (get/replace/patch/delete) and Filter (search) carry literal-or-FEEL values (the parser compiles the FEEL ones); BodyVar names the process variable holding the create/replace/patch payload (empty → the whole variable scope); Auth references a server-side secret; ResultVar receives the JSON response (empty → discard it).
type ScrapeField ¶ added in v0.5.0
ScrapeField is one named field of a structured HTML scrape (ADR-0231): Name is the key the extracted value gets in the item's object, Selector an optional CSS selector evaluated *within* the matched item (-1 → the item element itself), and Attribute the optional attribute read from the element it resolves to (-1 → that element's text). All three are interned structural literals, never FEEL: a field list is the result's shape, and a shape that varies per instance is not a shape.
type ScriptJobTaskDetail ¶
type ScriptJobTaskDetail struct {
JobType int32 // interned reserved per-language script job type → index
Language int32 // interned script language (e.g. "powershell") → index
Source int32 // interned script source text → index
ResultVar int32 // interned result-variable name → index
Retries int32
}
ScriptJobTaskDetail is the per-script-job-task data a behavior needs at runtime. Unlike the inline FEEL script task (ScriptTaskDetail), a job script is authored in a general-purpose language (PowerShell first; Python/JavaScript later) and runs off the hot path in a job worker, exactly as a business rule task delegates to the DMN worker (ADR-0047). Like a service task it runs as a job, so it carries a JobType — a reserved per-language sentinel (e.g. PwshJobType) the in-process script worker subscribes to. Language is the interned language name (which also selects the worker/interpreter), Source is the interned script text (compiled/validated no further at deploy time — an interpreter runs it, invariant I5 keeps only interning and validation off the runtime path), and ResultVar is the process variable the script's result is written back into on job completion.
type ScriptTaskDetail ¶
ScriptTaskDetail is the per-script-task data a behavior needs at runtime: a FEEL expression compiled once at deploy time (ADR-0008/0015) and the name of the variable its result is written to.
type ServiceTaskDetail ¶
type ServiceTaskDetail struct {
JobType int32 // interned string → index, local to this compiled process
Retries int32
// contains filtered or unexported fields
}
ServiceTaskDetail is the per-service-task data a behavior needs at runtime.
func (*ServiceTaskDetail) GlobalJobType ¶ added in v0.3.0
func (d *ServiceTaskDetail) GlobalJobType() int32
GlobalJobType is the job type a job created for this task must carry: the engine-wide index when the process has been resolved, and otherwise the locally interned one, which is what a compiled process used before resolution existed and keeps a standalone process (a test, the conformance runner) behaving as it always did.
type Severity ¶
type Severity string
Severity ranks a validation Problem. An error refuses deployment (compileProcess returns it as a fatal compile error, preserving the "fail at deploy, never at runtime" contract); a warning is informational and does not block a deploy. The string values are stable and chosen so the future JSON /validate endpoint and Problems panel (ADR-0026) can serialize them directly.
const ( // SeverityError marks a problem that makes the model unrunnable or structurally // invalid, so the deploy is refused — the existing all-or-nothing compile-gate // behavior, now with a reason attached. SeverityError Severity = "error" // SeverityWarning marks a modeling smell that does not prevent the reachable // part of the process from executing correctly (e.g. dead, unreachable code). // It is surfaced to the author but never blocks a deploy. SeverityWarning Severity = "warning" )
type SharePointConfig ¶
type SharePointConfig struct {
}
SharePointConfig is the deploy-time configuration of a SharePoint task (ADR-0141). Worker names the server-registered SharePoint provider (its Graph base and OAuth credential live server-side, never in the model); Site and List address the target list, and Fields are the created item's column values — all literal-or-FEEL values (the parser compiles the FEEL ones) evaluated over the instance's variables at call time. ResultVar, if set, is the process variable the created item's JSON is written back into (empty = discard it).
type SignalDetail ¶
type SignalDetail struct {
SignalName string
}
SignalDetail is the per-signal-event data a behavior needs at runtime, shared by the signal intermediate catch, throw, end, and start events (ADR-0088). A signal is broadcast by name: it carries no correlation key and no code, so the name is all a catch subscribes on and a throw broadcasts.
type SignalStartEvent ¶
SignalStartEvent pairs a signal-start event's signal name with its element index, so the engine can index which element a starting signal flows into (ADR-0088).
type SoapConfig ¶ added in v0.3.0
type SoapConfig struct {
Endpoint RestExpr
Op string
Action RestExpr
Body RestExpr
Version string
ResultVar string
Auth RestAuth
Retries int32
}
SoapConfig is the deploy-time configuration of a SOAP / Web Services (WSDL) task (ADR-0165). Endpoint is the service URL (from the WSDL's soap:address) and Op the operation name; Action overrides the SOAPAction header (empty → Op); Body is the XML payload placed inside the SOAP envelope's Body (literal-or-FEEL, so a request can interpolate the instance's variables); Version is the SOAP protocol version ("1.1" or "1.2"); Auth references a server-side secret; ResultVar receives the parsed response body (empty → discard it).
type SqlConfig ¶ added in v0.3.0
type SqlConfig struct {
JobType string
Connector string
Op string
Statement string
ParamsVar string
MaxRows int32
ResultVar string
Retries int32
}
SqlConfig is the deploy-time configuration of a SQL task (ADR-0173), shared by all three products. JobType is the product's reserved job type (MsSqlJobType, MariaDBJobType or PostgresJobType) — the one field that differs between them, and what decides which driver the worker opens.
Worker names the database the worker is configured for: a SQL task carries no DSN, because the connection string never enters the engine. Op is the operation ("query"|"query-one"|"execute"). Statement is the SQL text, a literal by construction so no process value can become part of it; ParamsVar names the process variable bound to its placeholders. MaxRows caps a query's result set (0 = the worker's default), and ResultVar receives the rows, the row, or the affected count (empty = discard, valid only for execute).
type TimerCatchDetail ¶
type TimerCatchDetail struct {
Schedule TimerSchedule
}
TimerCatchDetail is the per-timer-intermediate-catch-event data: the compiled schedule that decides when the waiting token continues. A catch fires once, so only duration and date schedules reach here — a cycle is a compile error (ADR-0054).
type TimerSchedule ¶
type TimerSchedule struct {
Kind TimerScheduleKind
BaseNanos int64 // Duration/CycleInterval: the interval in ns; Date: the absolute instant (unix ns)
Repetitions int32 // remaining fires after the first; -1 = infinite; 0 = fire once
Cron cronSpec // populated only for TimerCycleCron
Expr *expr.Compiled // populated only for the TimerFeel* kinds (ADR-0055/0056)
}
TimerSchedule is a compiled timer definition: enough to compute every due date deterministically at runtime without re-parsing the XML (invariant I5). Timer start events use the full range (ADR-0051); catch and boundary timers use only a duration today and do not carry a schedule.
func (TimerSchedule) FirstDue ¶
func (s TimerSchedule) FirstDue(now int64) int64
FirstDue returns the due date of the first (or only) firing of a timer armed at now. The clock is read by the caller and frozen into the arming event, never here (invariant I4/I6).
func (TimerSchedule) IsFeel ¶
func (s TimerSchedule) IsFeel() bool
IsFeel reports whether the schedule comes from a FEEL expression evaluated at runtime (ADR-0055/0056), rather than a value fixed at deploy time.
func (TimerSchedule) NextDue ¶
func (s TimerSchedule) NextDue(now int64) (int64, bool)
NextDue returns the due date of the next firing after a timer fires at now, and whether the timer recurs at all. A one-shot (duration/date) returns ok=false. A finite cycle whose Repetitions has run out is handled by the caller via the Repetitions counter, not here — NextDue only computes when.
func (TimerSchedule) Repeats ¶
func (s TimerSchedule) Repeats() bool
Repeats reports whether the schedule recurs (a cycle), as opposed to firing once (a duration or date). A recurring non-interrupting boundary uses it to decide whether to re-arm after each fire (ADR-0054).
func (TimerSchedule) ResolveConstant ¶
func (s TimerSchedule) ResolveConstant() (TimerSchedule, error)
ResolveConstant evaluates a constant FEEL schedule — one whose expression reads no variables — exactly as the runtime would at arm (against an empty binding) and returns the concrete schedule, or an error if it does not resolve to a valid one. A timer *start* event's FEEL schedule is required to be constant (ADR-0056), so this lets deploy-time validation prove it will actually arm instead of being silently dropped at runtime (ADR-0111). A non-FEEL schedule resolves trivially. It must not be called on a FEEL schedule with variable inputs — those have no value at deploy — so callers check Expr.Inputs() first.
func (TimerSchedule) ResolveFeel ¶
func (s TimerSchedule) ResolveFeel(text string) (TimerSchedule, bool)
ResolveFeel turns the evaluated text of a FEEL timer expression into the concrete schedule the literal parser would have produced for the same field — a duration, date, or cycle — so downstream FirstDue/NextDue/Repetitions are identical to a literal timer's (ADR-0056). ok is false if the text is not valid for the field (the caller then treats the timer as unresolvable). Only valid on a FEEL schedule.
func (TimerSchedule) ResolveFeelValue ¶
func (s TimerSchedule) ResolveFeelValue(v expr.Value) (TimerSchedule, bool)
ResolveFeelValue turns a FEEL expression's evaluated *value* into the concrete schedule for the field (ADR-0057). It first reads a first-class FEEL temporal exactly — a duration's nanoseconds for a FEEL duration schedule, a date-time's instant for a FEEL date schedule — and only falls back to the canonical string form (Classify → ResolveFeel) when the value is not a usable temporal (e.g. a variable holding an ISO-8601 string, or any cycle). ok is false if neither path yields a valid schedule. Only valid on a FEEL schedule.
type TimerScheduleKind ¶
type TimerScheduleKind uint8
TimerScheduleKind discriminates how a timer's due dates are computed.
const ( // TimerDuration fires once, BaseNanos after the timer is armed (ISO-8601 // <timeDuration>, e.g. PT1H). TimerDuration TimerScheduleKind = iota // TimerDate fires once, at the absolute instant BaseNanos (ISO-8601 // <timeDate>, e.g. 2026-08-01T09:00:00Z). TimerDate // TimerCycleInterval recurs every BaseNanos, Repetitions more times after the // first (ISO-8601 repeating interval <timeCycle>, e.g. R3/PT1H or R/PT1H). TimerCycleInterval // TimerCycleCron recurs on a wall-clock cron schedule (<timeCycle> holding a // 5-field cron expression, e.g. "0 * * * *" — every full hour). Always // infinite. TimerCycleCron // TimerFeelDuration fires once, its delay a FEEL expression (Expr) evaluated // against the instance's variables when the timer is created; the result's text // is parsed as an ISO-8601 duration (ADR-0055). TimerFeelDuration // TimerFeelDate fires once, its instant a FEEL expression (Expr) evaluated when // the timer is created; the result's text is parsed as an RFC3339 instant // (ADR-0055). TimerFeelDate // TimerFeelCycle recurs, its cadence a FEEL expression (Expr) evaluated when the // timer is armed and again on each re-arm; the result's text is parsed as a // repeating interval or cron (ADR-0056). Boundary (non-interrupting) only. TimerFeelCycle )
type TimerStartDetail ¶
type TimerStartDetail struct {
Schedule TimerSchedule
}
TimerStartDetail is the per-timer-start-event data: the compiled schedule that the engine arms at deploy time and consults to compute each due date (ADR-0051).
type TimerStartEvent ¶
type TimerStartEvent struct {
Schedule TimerSchedule
ElementId int32
}
TimerStartEvent pairs a timer-start event's compiled schedule with its element index, so the engine can arm the right timer for the right node (ADR-0051).
type UserConnectorConfig ¶ added in v0.2.0
type UserConnectorConfig struct {
Operation string
Username RestExpr
Email RestExpr
DisplayName RestExpr
Roles RestExpr
Password RestExpr
Retries int32
}
UserConnectorConfig is the deploy-time configuration of a user-provisioning task (ADR-0123). Operation is one of "create", "set-password", or "disable". Username identifies the account; Email/DisplayName/Roles/Password are the create/update fields — each a literal-or-FEEL value (the parser compiles the FEEL ones) evaluated over the instance's variables at call time. There is no worker name and no credential: the worker mutates the internal user store directly, gated to the protected system project (ADR-0122) and opt-in server-side.
type UserTaskDetail ¶
type UserTaskDetail struct {
JobType int32
Retries int32
Name int32 // interned element name (the task's human title) → index, -1 if unset
Assignee int32
CandidateGroups int32
FormId int32 // interned form id bound via zeebe:formDefinition → index, -1 if unset (ADR-0028)
// Priority is the task's static importance from zeebe:priorityDefinition
// (default 50, Camunda's convention); higher sorts first in the inbox.
Priority int32
// DueDateNanos is the ISO-8601 duration (from zeebe:taskSchedule dueDate),
// in nanoseconds, after which the task is due — relative to its creation, so
// the absolute due instant is frozen when the job is created (ADR-0051).
// 0 means the task has no due date.
DueDateNanos int64
}
UserTaskDetail is the per-user-task data a behavior needs at runtime. A user task parks a token and creates a job like a service task; the "worker" is a person using the Tasks app (ADR-0028). Assignee and CandidateGroups are interned strings from the zeebe:assignmentDefinition extension (-1 if unset).
type ValidationError ¶
type ValidationError struct {
Problems []Problem
// Process is the compiled process the gate refused. The model is fully compiled
// by the time stage 5 runs — validation decides whether it may be *deployed*, it
// does not decide whether it can run (I5) — so the reload path, which re-reads a
// definition that passed the gate of its own day, can take the process from here
// instead of losing it to the gate a second time
// (ADR-0177). compileProcess always sets it; it is
// still the zero value of the field, so a caller checks it before use.
Process *CompiledProcess
}
ValidationError is the fatal compile error compileProcess returns when graph-wide validation finds an error-severity Problem, so a deploy is refused (invariant I5, preserving today's compile-gate behavior). It carries the full Problem list — warnings included — so a caller that wants the structured findings (a future /validate endpoint reusing the compile path) can recover them with a type assertion; Error() renders only the error-severity findings into one line, matching how the other compile failures read.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
type WebScrapeConfig ¶ added in v0.2.0
type WebScrapeConfig struct {
Url RestExpr
Selector RestExpr
Attribute string
Result string
Retries int32
}
WebScrapeConfig is the deploy-time configuration of a web-scraping task (ADR-0118). Url is the page to fetch and Selector the CSS selector whose matches are extracted — both literal-or-FEEL values (the parser compiles the FEEL ones) evaluated over the instance's variables at call time. Attribute, when set, names the HTML attribute to read from each match (empty → each match's text content); Result is the process variable the extracted values are written to as a JSON array. Like REST, the target lives entirely in the model, not a registry.
type WebScrapeExtractionConfig ¶ added in v0.5.0
type WebScrapeExtractionConfig struct {
Url RestExpr
Selector RestExpr
Attribute string
Format WebScrapeFormat
MaxItems int32
Fields []WebScrapeFieldConfig
AbsoluteLinks bool
PlainText bool
Result string
Retries int32
}
WebScrapeExtractionConfig is the ADR-0190 deploy-time configuration used by the XML compiler. It extends the original WebScrapeConfig without breaking callers of AddWebScrapeConnectorTask: Format is explicit and MaxItems is the deterministic first-N bound (0 = unlimited). Fields, AbsoluteLinks and PlainText are the structured-extraction additions (ADR-0231); their zero values are exactly the pre-existing behavior.
type WebScrapeFieldConfig ¶ added in v0.5.0
WebScrapeFieldConfig is one authored field of a structured HTML scrape (ADR-0231). Name is required and unique within a task; Selector is optional and relative to the matched item (empty = the item itself); Attribute is optional (empty = the element's text).
type WebScrapeFormat ¶ added in v0.5.0
type WebScrapeFormat uint8
WebScrapeFormat selects the document representation a web-scraping worker extracts (ADR-0190). It is compiled from the model and carried as a compact value in ConnectorTaskDetail so the worker never infers a representation from runtime content. Zero is HTML deliberately: ConnectorTaskDetail values produced by code written before ADR-0190 therefore keep their existing HTML semantics.
const ( // WebScrapeFormatHTML preserves ADR-0118's CSS-selector extraction. WebScrapeFormatHTML WebScrapeFormat = iota // WebScrapeFormatRSS extracts RSS 2.0 items into structured feed entries. WebScrapeFormatRSS // WebScrapeFormatAtom extracts Atom entries into structured feed entries. WebScrapeFormatAtom )
func (WebScrapeFormat) String ¶ added in v0.5.0
func (f WebScrapeFormat) String() string
String returns the model token for a compiled web-scrape format.