Documentation ¶
Index ¶
- Constants
- func DefaultConfig() *util.ServiceConfig
- type RequestProcessor
- func (rp *RequestProcessor) RestartFlow(restartRequest *RestartRequest) (results map[string]*data.Attribute, err error)
- func (rp *RequestProcessor) ResumeFlow(resumeRequest *ResumeRequest) (results map[string]*data.Attribute, err error)
- func (rp *RequestProcessor) StartFlow(startRequest *StartRequest) (results map[string]*data.Attribute, err error)
- type RestEngineTester
- func (et *RestEngineTester) Enabled() bool
- func (et *RestEngineTester) Name() string
- func (et *RestEngineTester) RestartFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (et *RestEngineTester) ResumeFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (et *RestEngineTester) Start() error
- func (et *RestEngineTester) StartFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (et *RestEngineTester) Status(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (et *RestEngineTester) Stop() error
- type RestartRequest
- type ResumeRequest
- type Server
- type StartRequest
- type TesterProvider
- func (fp *TesterProvider) GetDefaultFlowModel() *model.FlowModel
- func (fp *TesterProvider) GetFlowProvider() definition.Provider
- func (fp *TesterProvider) GetFlowTester() *RestEngineTester
- func (fp *TesterProvider) GetLinkExprManagerFactory() definition.LinkExprManagerFactory
- func (fp *TesterProvider) GetMapperFactory() definition.MapperFactory
- func (fp *TesterProvider) GetStateRecorder() instance.StateRecorder
Constants ¶
const ( ENV_ENABLED = "TESTER_ENABLED" ENV_SETTING_PORT = "TESTER_PORT" ENV_SETTING_SR_HOST = "TESTER_SR_SERVER" )
const (
FLOW_REF = "github.com/TIBCOSoftware/flogo-contrib/action/flow"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶
func DefaultConfig() *util.ServiceConfig
Types ¶
type RequestProcessor ¶
type RequestProcessor struct {
// contains filtered or unexported fields
}
RequestProcessor processes request objects and invokes the corresponding flow Manager methods
func NewRequestProcessor ¶
func NewRequestProcessor() *RequestProcessor
NewRequestProcessor creates a new RequestProcessor
func (*RequestProcessor) RestartFlow ¶
func (rp *RequestProcessor) RestartFlow(restartRequest *RestartRequest) (results map[string]*data.Attribute, err error)
RestartFlow handles a RestartRequest for a FlowInstance. This will generate an ID for the new FlowInstance and queue a RestartRequest.
func (*RequestProcessor) ResumeFlow ¶
func (rp *RequestProcessor) ResumeFlow(resumeRequest *ResumeRequest) (results map[string]*data.Attribute, err error)
ResumeFlow handles a ResumeRequest for a FlowInstance. This will queue a RestartRequest.
func (*RequestProcessor) StartFlow ¶
func (rp *RequestProcessor) StartFlow(startRequest *StartRequest) (results map[string]*data.Attribute, err error)
StartFlow handles a StartRequest for a FlowInstance. This will generate an ID for the new FlowInstance and queue a StartRequest.
type RestEngineTester ¶
type RestEngineTester struct {
// contains filtered or unexported fields
}
RestEngineTester is default REST implementation of the EngineTester
func NewRestEngineTester ¶
func NewRestEngineTester(config *util.ServiceConfig) *RestEngineTester
NewRestEngineTester creates a new REST EngineTester
func (*RestEngineTester) Enabled ¶
func (et *RestEngineTester) Enabled() bool
func (*RestEngineTester) Name ¶
func (et *RestEngineTester) Name() string
func (*RestEngineTester) RestartFlow ¶
func (et *RestEngineTester) RestartFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
RestartFlow restarts a Flow Instance (POST "/flow/restart").
To post a restart flow, try this at a shell: $ curl -H "Content-Type: application/json" -X POST -d '{...}' http://localhost:8080/flow/restart
func (*RestEngineTester) ResumeFlow ¶
func (et *RestEngineTester) ResumeFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
ResumeFlow resumes a Flow Instance (POST "/flow/resume").
To post a resume flow, try this at a shell: $ curl -H "Content-Type: application/json" -X POST -d '{...}' http://localhost:8080/flow/resume
func (*RestEngineTester) Start ¶
func (et *RestEngineTester) Start() error
Start implements engine.EngineTester.Start
func (*RestEngineTester) StartFlow ¶
func (et *RestEngineTester) StartFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
StartFlow starts a new Flow Instance (POST "/flow/start").
To post a start flow, try this at a shell: $ curl -H "Content-Type: application/json" -X POST -d '{"flowUri":"base"}' http://localhost:8080/flow/start
func (*RestEngineTester) Status ¶
func (et *RestEngineTester) Status(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
Status is a basic health check for the server to determine if it is up
func (*RestEngineTester) Stop ¶
func (et *RestEngineTester) Stop() error
Stop implements engine.EngineTester.Stop
type RestartRequest ¶
type RestartRequest struct { InitialState *instance.IndependentInstance `json:"initialState"` Data map[string]interface{} `json:"data"` Interceptor *support.Interceptor `json:"interceptor"` Patch *support.Patch `json:"patch"` }
RestartRequest describes a request for restarting a FlowInstance todo: can be merged into StartRequest
type ResumeRequest ¶
type ResumeRequest struct { State *instance.IndependentInstance `json:"state"` Data map[string]interface{} `json:"data"` Interceptor *support.Interceptor `json:"interceptor"` Patch *support.Patch `json:"patch"` }
ResumeRequest describes a request for resuming a FlowInstance todo: Data for resume request should be directed to waiting task
type Server ¶
Server the server structure
func NewServer ¶
NewServer creates a new server instance param server - is a instance of http.Server, can be nil and a default one will be created
func (*Server) InstanceID ¶
InstanceID is the server instance ID
func (*Server) IsStarted ¶
IsStarted checks if the server is started note: will return true even if the server is stopped but there are still some requests to finish
type StartRequest ¶
type StartRequest struct { FlowURI string `json:"flowUri"` Data map[string]interface{} `json:"data"` Attrs []*data.Attribute `json:"attrs"` Interceptor *support.Interceptor `json:"interceptor"` Patch *support.Patch `json:"patch"` ReplyTo string `json:"replyTo"` }
StartRequest describes a request for starting a FlowInstance
type TesterProvider ¶
type TesterProvider struct {
// contains filtered or unexported fields
}
ExtensionProvider is the extension provider for the flow action
func NewExtensionProvider ¶
func NewExtensionProvider() *TesterProvider
func (*TesterProvider) GetDefaultFlowModel ¶ added in v0.5.2
func (fp *TesterProvider) GetDefaultFlowModel() *model.FlowModel
func (*TesterProvider) GetFlowProvider ¶
func (fp *TesterProvider) GetFlowProvider() definition.Provider
func (*TesterProvider) GetFlowTester ¶
func (fp *TesterProvider) GetFlowTester() *RestEngineTester
func (*TesterProvider) GetLinkExprManagerFactory ¶
func (fp *TesterProvider) GetLinkExprManagerFactory() definition.LinkExprManagerFactory
func (*TesterProvider) GetMapperFactory ¶
func (fp *TesterProvider) GetMapperFactory() definition.MapperFactory
func (*TesterProvider) GetStateRecorder ¶
func (fp *TesterProvider) GetStateRecorder() instance.StateRecorder