github.com/TIBCOSoftware/flogo-lib@v0.5.9/core/trigger/trigger.go (about)

     1  package trigger
     2  
     3  import (
     4  	"github.com/TIBCOSoftware/flogo-lib/core/action"
     5  	"github.com/TIBCOSoftware/flogo-lib/util/managed"
     6  )
     7  
     8  // Factory is used to create new instances for a trigger
     9  type Factory interface {
    10  	New(config *Config) Trigger
    11  }
    12  
    13  // Trigger is object that triggers/starts flow instances and
    14  // is managed by an engine
    15  type Trigger interface {
    16  	managed.Managed
    17  
    18  	// Metadata returns the metadata of the trigger
    19  	Metadata() *Metadata
    20  }
    21  
    22  // Initializable interface should be implemented by all Triggers, the Initialize method
    23  // will eventually move up to Trigger to replace the the old "Init" method
    24  type Initializable interface {
    25  
    26  	// Initialize is called to initialize the Trigger
    27  	Initialize(ctx InitContext) error
    28  }
    29  
    30  // InitContext is the initialization context for the trigger instance
    31  type InitContext interface {
    32  
    33  	// GetHandlers gets the handlers associated with the trigger
    34  	GetHandlers() []*Handler
    35  }
    36  
    37  // Deprecated: No longer used
    38  type InitOld interface {
    39  
    40  	// Deprecated: Triggers should implement trigger.Initializable interface
    41  	Init(actionRunner action.Runner)
    42  }