Documentation ¶
Index ¶
- Constants
- func NewManualTrigger(env utils.Environment, contact *flows.Contact, flow flows.Flow, ...) flows.Trigger
- func ReadFlowActionTrigger(session flows.Session, envelope *utils.TypedEnvelope) (flows.Trigger, error)
- func ReadManualTrigger(session flows.Session, envelope *utils.TypedEnvelope) (flows.Trigger, error)
- func ReadTrigger(session flows.Session, envelope *utils.TypedEnvelope) (flows.Trigger, error)
- type FlowActionTrigger
- func (t *FlowActionTrigger) Contact() *flows.Contact
- func (t *FlowActionTrigger) Describe() string
- func (t *FlowActionTrigger) Environment() utils.Environment
- func (t *FlowActionTrigger) Flow() flows.Flow
- func (t *FlowActionTrigger) MarshalJSON() ([]byte, error)
- func (t *FlowActionTrigger) Params() types.XValue
- func (t *FlowActionTrigger) Reduce() types.XPrimitive
- func (t *FlowActionTrigger) Resolve(key string) types.XValue
- func (t *FlowActionTrigger) Run() flows.RunSummary
- func (t *FlowActionTrigger) ToXJSON() types.XText
- func (t *FlowActionTrigger) TriggeredOn() time.Time
- func (t *FlowActionTrigger) Type() string
- type ManualTrigger
- func (t *ManualTrigger) Contact() *flows.Contact
- func (t *ManualTrigger) Describe() string
- func (t *ManualTrigger) Environment() utils.Environment
- func (t *ManualTrigger) Flow() flows.Flow
- func (t *ManualTrigger) MarshalJSON() ([]byte, error)
- func (t *ManualTrigger) Params() types.XValue
- func (t *ManualTrigger) Reduce() types.XPrimitive
- func (t *ManualTrigger) Resolve(key string) types.XValue
- func (t *ManualTrigger) ToXJSON() types.XText
- func (t *ManualTrigger) TriggeredOn() time.Time
- func (t *ManualTrigger) Type() string
Constants ¶
const TypeFlowAction string = "flow_action"
TypeFlowAction is a constant for sessions triggered by flow actions in other sessions
const TypeManual string = "manual"
TypeManual is the type for manually triggered sessions
Variables ¶
This section is empty.
Functions ¶
func NewManualTrigger ¶
func NewManualTrigger(env utils.Environment, contact *flows.Contact, flow flows.Flow, params types.XValue, triggeredOn time.Time) flows.Trigger
NewManualTrigger creates a new manual trigger
func ReadFlowActionTrigger ¶
func ReadManualTrigger ¶
func ReadTrigger ¶
Types ¶
type FlowActionTrigger ¶
type FlowActionTrigger struct {
// contains filtered or unexported fields
}
FlowActionTrigger is used when another session triggered this run using a trigger_flow action.
```
{ "type": "flow_action", "flow": {"uuid": "ea7d8b6b-a4b2-42c1-b9cf-c0370a95a721", "name": "Registration"}, "triggered_on": "2000-01-01T00:00:00.000000000-00:00", "run": { "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d", "flow": {"uuid": "93c554a1-b90d-4892-b029-a2a87dec9b87", "name": "Other Flow"}, "contact": { "uuid": "c59b0033-e748-4240-9d4c-e85eb6800151", "name": "Bob", "fields": {"state": {"value": "Azuay", "created_on": "2000-01-01T00:00:00.000000000-00:00"}} }, "status": "active", "results": { "age": { "result_name": "Age", "value": "33", "node": "cd2be8c4-59bc-453c-8777-dec9a80043b8", "created_on": "2000-01-01T00:00:00.000000000-00:00" } } } }
```
func (*FlowActionTrigger) Describe ¶ added in v0.10.1
func (t *FlowActionTrigger) Describe() string
Describe returns a representation of this type for error messages
func (*FlowActionTrigger) Environment ¶ added in v0.5.0
func (t *FlowActionTrigger) Environment() utils.Environment
func (*FlowActionTrigger) MarshalJSON ¶
func (t *FlowActionTrigger) MarshalJSON() ([]byte, error)
MarshalJSON marshals this trigger into JSON
func (*FlowActionTrigger) Reduce ¶ added in v0.8.0
func (t *FlowActionTrigger) Reduce() types.XPrimitive
Reduce is called when this object needs to be reduced to a primitive
func (*FlowActionTrigger) Resolve ¶ added in v0.5.0
func (t *FlowActionTrigger) Resolve(key string) types.XValue
Resolve resolves the given key when this trigger is referenced in an expression
func (*FlowActionTrigger) Run ¶
func (t *FlowActionTrigger) Run() flows.RunSummary
func (*FlowActionTrigger) ToXJSON ¶ added in v0.8.0
func (t *FlowActionTrigger) ToXJSON() types.XText
ToXJSON is called when this type is passed to @(json(...))
func (*FlowActionTrigger) TriggeredOn ¶
func (*FlowActionTrigger) Type ¶
func (t *FlowActionTrigger) Type() string
Type returns the type of this trigger
type ManualTrigger ¶
type ManualTrigger struct {
// contains filtered or unexported fields
}
ManualTrigger is used when a session was triggered manually by a user
```
{ "type": "manual", "flow": {"uuid": "ea7d8b6b-a4b2-42c1-b9cf-c0370a95a721", "name": "Registration"}, "contact": { "uuid": "9f7ede93-4b16-4692-80ad-b7dc54a1cd81", "name": "Bob" }, "triggered_on": "2000-01-01T00:00:00.000000000-00:00" }
```
func (*ManualTrigger) Describe ¶ added in v0.10.1
func (t *ManualTrigger) Describe() string
Describe returns a representation of this type for error messages
func (*ManualTrigger) Environment ¶ added in v0.5.0
func (t *ManualTrigger) Environment() utils.Environment
func (*ManualTrigger) MarshalJSON ¶
func (t *ManualTrigger) MarshalJSON() ([]byte, error)
MarshalJSON marshals this trigger into JSON
func (*ManualTrigger) Reduce ¶ added in v0.8.0
func (t *ManualTrigger) Reduce() types.XPrimitive
Reduce is called when this object needs to be reduced to a primitive
func (*ManualTrigger) Resolve ¶ added in v0.5.0
func (t *ManualTrigger) Resolve(key string) types.XValue
Resolve resolves the given key when this trigger is referenced in an expression
func (*ManualTrigger) ToXJSON ¶ added in v0.8.0
func (t *ManualTrigger) ToXJSON() types.XText
ToXJSON is called when this type is passed to @(json(...))
func (*ManualTrigger) TriggeredOn ¶
func (*ManualTrigger) Type ¶
func (t *ManualTrigger) Type() string
Type returns the type of this trigger