Documentation ¶
Index ¶
- Variables
- type CancelEvent
- type CompensationEvent
- type ConditionalEvent
- type ConsumptionResult
- type EndEvent
- type ErrorEvent
- type EscalationEvent
- type FanOut
- type IConsumer
- type IDefinitionInstance
- type IDefinitionInstanceBuilder
- type IEvent
- type ISource
- type LinkEvent
- type MessageEvent
- type NoneEvent
- type SignalEvent
- type TerminateEvent
- type TimerEvent
- type VoidConsumer
- type VoidSource
Constants ¶
This section is empty.
Variables ¶
var WrappingDefinitionInstanceBuilder = wrappingDefinitionInstanceBuilder{}
Functions ¶
This section is empty.
Types ¶
type CancelEvent ¶
type CancelEvent struct{}
CancelEvent Cancellation event
func MakeCancelEvent ¶
func MakeCancelEvent() CancelEvent
func (CancelEvent) MatchesEventInstance ¶
func (ev CancelEvent) MatchesEventInstance(instance IDefinitionInstance) bool
type CompensationEvent ¶
type CompensationEvent struct {
// contains filtered or unexported fields
}
CompensationEvent Compensation event
func MakeCompensationEvent ¶
func MakeCompensationEvent(activityRef string) CompensationEvent
func (*CompensationEvent) ActivityRef ¶
func (ev *CompensationEvent) ActivityRef() *string
func (*CompensationEvent) MatchesEventInstance ¶
func (ev *CompensationEvent) MatchesEventInstance(instance IDefinitionInstance) bool
type ConditionalEvent ¶
type ConditionalEvent struct {
// contains filtered or unexported fields
}
ConditionalEvent represents an event that occurs when a certain timer is triggered.
func MakeConditionalEvent ¶
func MakeConditionalEvent(instance IDefinitionInstance) ConditionalEvent
func (*ConditionalEvent) Instance ¶
func (ev *ConditionalEvent) Instance() IDefinitionInstance
func (*ConditionalEvent) MatchesEventInstance ¶
func (ev *ConditionalEvent) MatchesEventInstance(instance IDefinitionInstance) bool
type ConsumptionResult ¶
type ConsumptionResult int
ConsumptionResult Result of event consumption
const ( // Consumed Consumer has successfully consumed the event Consumed ConsumptionResult = iota // ConsumptionError Consumer had an unexpected error consuming the event // // The error is returned as a second value. ConsumptionError // PartiallyConsumed Consumer with multiple sub-consumers was able to // have at least some of the sub-consumers consume the event // but there were some errors (the errors are returned as // `multierror` list in the second value) PartiallyConsumed // DropEventConsumer Event consumer should no longer receive events // // This is a mechanism for "unsubscribing" from an event source DropEventConsumer )
func ForwardEvent ¶
func ForwardEvent(ev IEvent, eventConsumers *[]IConsumer) (result ConsumptionResult, err error)
ForwardEvent Forwards a process event to a list of consumers
This function handles full and partial failure of consumers to consume the event. If none of them errors out, the result will be EventConsumed. If some do, the result will be EventPartiallyConsumed and err will be *multierror.Errors If all do, the result will be EventConsumptionError and err will be *multierror.Errors
type EndEvent ¶
EndEvent Process has ended
func MakeEndEvent ¶
func (EndEvent) MatchesEventInstance ¶
func (ev EndEvent) MatchesEventInstance(instance IDefinitionInstance) bool
type ErrorEvent ¶
type ErrorEvent struct {
// contains filtered or unexported fields
}
ErrorEvent Error event
func MakeErrorEvent ¶
func MakeErrorEvent(errorRef string, items ...data.IItem) ErrorEvent
func (*ErrorEvent) ErrorRef ¶
func (ev *ErrorEvent) ErrorRef() *string
func (*ErrorEvent) MatchesEventInstance ¶
func (ev *ErrorEvent) MatchesEventInstance(instance IDefinitionInstance) bool
type EscalationEvent ¶
type EscalationEvent struct {
// contains filtered or unexported fields
}
EscalationEvent Escalation event
func MakeEscalationEvent ¶
func MakeEscalationEvent(escalationRef string, items ...data.IItem) EscalationEvent
func (*EscalationEvent) EscalationRef ¶
func (ev *EscalationEvent) EscalationRef() *string
func (*EscalationEvent) MatchesEventInstance ¶
func (ev *EscalationEvent) MatchesEventInstance(instance IDefinitionInstance) bool
type FanOut ¶
type FanOut struct {
// contains filtered or unexported fields
}
FanOut is a straightforward Consumer + Source, forwards all consumed messages to all subscribers registered at it.
func (*FanOut) ConsumeEvent ¶
func (f *FanOut) ConsumeEvent(ev IEvent) (result ConsumptionResult, err error)
func (*FanOut) RegisterEventConsumer ¶
type IConsumer ¶
type IConsumer interface {
ConsumeEvent(IEvent) (ConsumptionResult, error)
}
IConsumer Process event consumer interface
type IDefinitionInstance ¶
type IDefinitionInstance interface {
EventDefinition() schema.EventDefinitionInterface
}
IDefinitionInstance is a unifying interface for representing event definition within an execution context (useful for event definitions like timer, condition, etc.)
func WrapEventDefinition ¶
func WrapEventDefinition(def schema.EventDefinitionInterface) IDefinitionInstance
WrapEventDefinition is a default event instance builder that creates Instance simply by enclosing schema.EventDefinitionInterface
type IDefinitionInstanceBuilder ¶
type IDefinitionInstanceBuilder interface {
NewEventDefinitionInstance(def schema.EventDefinitionInterface) (definitionInstance IDefinitionInstance, err error)
}
IDefinitionInstanceBuilder allows supplying custom instance builders that interact with the rest of the system and add context for further matching
func DefinitionInstanceBuildingChain ¶
func DefinitionInstanceBuildingChain(builders ...IDefinitionInstanceBuilder) IDefinitionInstanceBuilder
DefinitionInstanceBuildingChain creates a DefinitionInstanceBuilder that attempts supplied builders from left to right, until a builder returns a non-nil DefinitionInstanceBuilder, which is then returned from the call to DefinitionInstanceBuildingChain
type IEvent ¶
type IEvent interface {
MatchesEventInstance(IDefinitionInstance) bool
}
type LinkEvent ¶
type LinkEvent struct {
// contains filtered or unexported fields
}
LinkEvent Link event
func MakeLinkEvent ¶
func (*LinkEvent) MatchesEventInstance ¶
func (ev *LinkEvent) MatchesEventInstance(instance IDefinitionInstance) bool
type MessageEvent ¶
type MessageEvent struct {
// contains filtered or unexported fields
}
MessageEvent Message event
func MakeMessageEvent ¶
func MakeMessageEvent(messageRef string, operationRef *string, items ...data.IItem) MessageEvent
func NewMessageEvent ¶
func NewMessageEvent(messageRef string, operationRef *string, items ...data.IItem) *MessageEvent
func (*MessageEvent) MatchesEventInstance ¶
func (ev *MessageEvent) MatchesEventInstance(instance IDefinitionInstance) bool
func (*MessageEvent) MessageRef ¶
func (ev *MessageEvent) MessageRef() *string
func (*MessageEvent) OperationRef ¶
func (ev *MessageEvent) OperationRef() (result *string, present bool)
type NoneEvent ¶
type NoneEvent struct{}
NoneEvent None event
func MakeNoneEvent ¶
func MakeNoneEvent() NoneEvent
func (NoneEvent) MatchesEventInstance ¶
func (ev NoneEvent) MatchesEventInstance(instance IDefinitionInstance) bool
type SignalEvent ¶
type SignalEvent struct {
// contains filtered or unexported fields
}
SignalEvent Signal event
func MakeSignalEvent ¶
func MakeSignalEvent(signalRef string, items ...data.IItem) SignalEvent
func NewSignalEvent ¶
func NewSignalEvent(signalRef string, items ...data.IItem) *SignalEvent
func (*SignalEvent) MatchesEventInstance ¶
func (ev *SignalEvent) MatchesEventInstance(instance IDefinitionInstance) bool
func (*SignalEvent) SignalRef ¶
func (ev *SignalEvent) SignalRef() *string
type TerminateEvent ¶
type TerminateEvent struct{}
TerminateEvent Termination event
func MakeTerminateEvent ¶
func MakeTerminateEvent() TerminateEvent
func (TerminateEvent) MatchesEventInstance ¶
func (ev TerminateEvent) MatchesEventInstance(instance IDefinitionInstance) bool
type TimerEvent ¶
type TimerEvent struct {
// contains filtered or unexported fields
}
TimerEvent represents an event that occurs when a certain timer is triggered.
func MakeTimerEvent ¶
func MakeTimerEvent(instance IDefinitionInstance) TimerEvent
func (TimerEvent) Instance ¶
func (ev TimerEvent) Instance() IDefinitionInstance
func (TimerEvent) MatchesEventInstance ¶
func (ev TimerEvent) MatchesEventInstance(instance IDefinitionInstance) bool
type VoidConsumer ¶
type VoidConsumer struct{}
VoidConsumer Process event consumer that does nothing and returns EventConsumed result
func (VoidConsumer) ConsumeEvent ¶
func (t VoidConsumer) ConsumeEvent(ev IEvent) (result ConsumptionResult, err error)
type VoidSource ¶
type VoidSource struct{}
func (VoidSource) RegisterEventConsumer ¶
func (t VoidSource) RegisterEventConsumer(consumer IConsumer) (err error)