Documentation ¶
Index ¶
- func DeserializeAttributes(eventType EventType, attributes []byte) (attr interface{}, err error)
- func EventsByWorkflowInstance(events []*WorkflowEvent) map[core.WorkflowInstance][]*WorkflowEvent
- func SerializeAttributes(attributes interface{}) ([]byte, error)
- type ActivityCompletedAttributes
- type ActivityFailedAttributes
- type ActivityScheduledAttributes
- type Event
- type EventType
- type ExecutionCanceledAttributes
- type ExecutionCompletedAttributes
- type ExecutionContinuedAsNewAttributes
- type ExecutionStartedAttributes
- type HistoryEventOption
- type SideEffectResultAttributes
- type SignalReceivedAttributes
- type SubWorkflowCancellationRequestedAttributes
- type SubWorkflowCompletedAttributes
- type SubWorkflowFailedAttributes
- type SubWorkflowScheduledAttributes
- type TimerCanceledAttributes
- type TimerFiredAttributes
- type TimerScheduledAttributes
- type TraceStartedAttributes
- type WorkflowEvent
- type WorkflowTaskStartedAttributes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeserializeAttributes ¶
func EventsByWorkflowInstance ¶
func EventsByWorkflowInstance(events []*WorkflowEvent) map[core.WorkflowInstance][]*WorkflowEvent
func SerializeAttributes ¶
Types ¶
type ActivityFailedAttributes ¶
type ActivityFailedAttributes struct {
Error *workflowerrors.Error `json:"error,omitempty"`
}
type Event ¶
type Event struct { // ID is a unique identifier for this event ID string `json:"id,omitempty"` // SequenceID is a monotonically increasing sequence number this event. It's only set for events that have // been executed and are in the history SequenceID int64 `json:"sid,omitempty"` Type EventType `json:"t,omitempty"` Timestamp time.Time `json:"ts,omitempty"` // ScheduleEventID is used to correlate events belonging together // For example, if an activity is scheduled, ScheduleEventID of the schedule event and the // completion/failure event are the same. ScheduleEventID int64 `json:"seid,omitempty"` // Attributes are event type specific attributes Attributes interface{} `json:"attr,omitempty"` VisibleAt *time.Time `json:"vat,omitempty"` }
func NewHistoryEvent ¶
func NewPendingEvent ¶
func NewPendingEvent(timestamp time.Time, eventType EventType, attributes interface{}, opts ...HistoryEventOption) *Event
func (*Event) UnmarshalJSON ¶
type EventType ¶
type EventType uint
const ( // Workflow has started EventType_WorkflowExecutionStarted EventType // Workflow has finished EventType_WorkflowExecutionFinished // Workflow has continued as new EventType_WorkflowExecutionContinuedAsNew // Workflow has been terminated (not yet used) EventType_WorkflowExecutionTerminated // Workflow has been canceled EventType_WorkflowExecutionCanceled // Workflow task has been started. This event is added to the history every time a workflow task is // picked up by the worker. EventType_WorkflowTaskStarted // SubWorkflow has been scheduled EventType_SubWorkflowScheduled // SubWorkflow cancellation has been requested EventType_SubWorkflowCancellationRequested // SubWorkflow has completed EventType_SubWorkflowCompleted // SubWorkflow has failed EventType_SubWorkflowFailed // Activity task has been scheduled EventType_ActivityScheduled // Activity task has been completed EventType_ActivityCompleted // Activity task has failed EventType_ActivityFailed // Timer has been scheduled EventType_TimerScheduled // Timer has fired. This is the event received by a workflow when a previously scheduled timer fires. EventType_TimerFired // Timer has been canceled. EventType_TimerCanceled // Workflow has received a signal EventType_SignalReceived // Recorded result of a side-efect EventType_SideEffectResult // Distributed tracing span has been started EventType_TraceStarted )
type ExecutionCanceledAttributes ¶
type ExecutionCanceledAttributes struct { }
type ExecutionCompletedAttributes ¶
type ExecutionCompletedAttributes struct { Result payload.Payload `json:"result,omitempty"` Error *workflowerrors.Error `json:"error,omitempty"` }
type HistoryEventOption ¶
type HistoryEventOption func(e *Event)
func ScheduleEventID ¶
func ScheduleEventID(scheduleEventID int64) HistoryEventOption
func VisibleAt ¶
func VisibleAt(visibleAt time.Time) HistoryEventOption
type SubWorkflowCancellationRequestedAttributes ¶
type SubWorkflowCancellationRequestedAttributes struct {
SubWorkflowInstance *core.WorkflowInstance `json:"sub_workflow_instance,omitempty"`
}
type SubWorkflowFailedAttributes ¶
type SubWorkflowFailedAttributes struct {
Error *workflowerrors.Error `json:"error,omitempty"`
}
type SubWorkflowScheduledAttributes ¶
type SubWorkflowScheduledAttributes struct { SubWorkflowQueue core.Queue `json:"sub_workflow_queue,omitempty"` SubWorkflowInstance *core.WorkflowInstance `json:"sub_workflow_instance,omitempty"` Name string `json:"name,omitempty"` Inputs []payload.Payload `json:"inputs,omitempty"` Metadata *metadata.WorkflowMetadata `json:"metadata,omitempty"` WorkflowSpanID [8]byte `json:"workflow_span_id,omitempty"` }
type TimerCanceledAttributes ¶
type TimerCanceledAttributes struct{}
type TimerFiredAttributes ¶
type TraceStartedAttributes ¶ added in v0.19.0
type WorkflowEvent ¶
type WorkflowEvent struct { WorkflowInstance *core.WorkflowInstance `json:"workflow_instance,omitempty"` HistoryEvent *Event `json:"history_event,omitempty"` }
WorkflowEvent is a event addressed for a specific workflow instance
type WorkflowTaskStartedAttributes ¶
type WorkflowTaskStartedAttributes struct { }
Source Files ¶
- activity_completed.go
- activity_failed.go
- activity_scheduled.go
- grouping.go
- history.go
- serialization.go
- side_effect_result.go
- signal_received.go
- span_started.go
- subworkflow_cancelation_requested.go
- subworkflow_completed.go
- subworkflow_failed.go
- subworkflow_scheduled.go
- timer_canceled.go
- timer_fired.go
- timer_scheduled.go
- workflow_canceled.go
- workflow_completed.go
- workflow_continued_as_new.go
- workflow_started.go
- workflow_task_started.go
- workflowevent.go
Click to show internal directories.
Click to hide internal directories.