timer

package
v0.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2018 License: BSD-3-Clause Imports: 8 Imported by: 0

README


title: Timer weight: 4707

tibco-timer

This trigger provides your flogo application the ability to schedule a flow via scheduling service

Installation

flogo add trigger github.com/TIBCOSoftware/flogo-contrib/trigger/timer

Schema

Outputs and Handler:

{
  "output": [
    {
      "name": "params",
      "type": "params"
    },
    {
      "name": "content",
      "type": "object"
    }
  ],
  "handler": {
    "settings": [
      {
        "name": "repeating",
        "type": "string",
        "value": "false",
      },
      {
        "name": "notImmediate",
        "type": "string",
        "value": "true",
      },
      {
        "name": "startDate",
        "type": "string",
        "value": "2018-01-01T12:00:00Z00:00"
      },
      {
        "name": "hours",
        "type": "string"
      },
      {
        "name": "minutes",
        "type": "string"
      },
      {
        "name": "seconds",
        "type": "string"
      }
    ]
  }
}

Example Configurations

Triggers are configured via the triggers.json of your application. The following are some example configuration of the Timer Trigger.

Only once and immediate

Configure the Trigger to run a flow immediately

{
  "triggers": [
    {
      "name": "flogo-timer",
      "settings": {
      },
      "handlers": [
        {
          "actionType": "flow",
          "actionURI": "embedded://myflow",
          "settings": {
            "repeating": "false"
          }
        }
      ]
    }
  ]
}

Only once at schedule time

Configure the Trigger to run a flow at a certain date/time. "startDate" settings format = "mm/dd/yyyy, hours:minutes:seconds"

{
  "triggers": [
    {
      "name": "flogo-rest",
      "settings": {
        "port": "8080"
      },
      "handlers": [
        {
          "actionType": "flow",
          "actionURI": "embedded://myflow",
          "settings": {
            "repeating": "false",
            "startDate" : "2018-01-01T12:00:00Z00:00"
          }
        }
      ]
    }
  ]
}

Repeating

Configure the Trigger to run a flow repeating every hours|minutes|seconds. If "notImmediate" set to true, the trigger will not fire immediately. In this case the first execution will occur in 24 hours. If set to false the first execuction will will occur immediately.

{
  "triggers": [
    {
      "name": "flogo-rest",
      "settings": {
        "port": "8080"
      },
      "handlers": [
        {
          "actionType": "flow",
          "actionURI": "embedded://myflow",
          "settings": {
            "repeating": "true",
            "notImmediate": "true",
            "hours": "24"
          }
        }
      ]
    }
  ]
}

Repeating with start date

Configure the Trigger to run a flow at a certain date/time and repeating every hours|minutes|seconds

{
  "triggers": [
    {
      "name": "flogo-rest",
      "settings": {
        "port": "8080"
      },
      "handlers": [
        {
          "actionType": "flow",
          "actionURI": "embedded://myflow",
          "settings": {
            "repeating": "true",
            "startDate" : "2018-01-01T12:00:00Z00:00",
            "hours": "64"
          }
        }
      ]
    }
  ]
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory(md *trigger.Metadata) trigger.Factory

NewFactory create a new Trigger factory

Types

type PrintJob

type PrintJob struct {
	Msg string
}

func (*PrintJob) Run

func (j *PrintJob) Run() error

type TimerFactory

type TimerFactory struct {
	// contains filtered or unexported fields
}

TimerFactory Timer Trigger factory

func (*TimerFactory) New

func (t *TimerFactory) New(config *trigger.Config) trigger.Trigger

New Creates a new trigger instance for a given id

type TimerTrigger

type TimerTrigger struct {
	// contains filtered or unexported fields
}

func (*TimerTrigger) Initialize added in v0.5.2

func (t *TimerTrigger) Initialize(ctx trigger.InitContext) error

Init implements trigger.Init

func (*TimerTrigger) Metadata

func (t *TimerTrigger) Metadata() *trigger.Metadata

Metadata implements trigger.Trigger.Metadata

func (*TimerTrigger) Start

func (t *TimerTrigger) Start() error

Start implements ext.Trigger.Start

func (*TimerTrigger) Stop

func (t *TimerTrigger) Stop() error

Stop implements ext.Trigger.Stop

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL