diff --git a/app/app.go b/app/app.go index 583eb369..5b2cb2a1 100644 --- a/app/app.go +++ b/app/app.go @@ -20,7 +20,7 @@ type Option func(*App) error func New(config *Config, runner action.Runner, options ...Option) (*App, error) { - app := &App{stopOnError: true, name: config.Name, version: config.Version} + app := &App{stopOnError: true, name: config.Name, version: config.Version, description: config.Description} for _, anImport := range config.Imports { registerImport(anImport) @@ -89,6 +89,7 @@ func FinalizeProperties(processors ...property.PostProcessor) func(*App) error { type App struct { name string version string + description string propManager *property.Manager resManager *resource.Manager actions map[string]action.Action diff --git a/app/instances.go b/app/instances.go index 00b5d0a9..4d7daaae 100644 --- a/app/instances.go +++ b/app/instances.go @@ -45,17 +45,19 @@ func (a *App) createSharedActions(actionConfigs []*action.Config) (map[string]ac func (a *App) createTriggers(tConfigs []*trigger.Config, runner action.Runner) (map[string]*triggerWrapper, error) { triggers := make(map[string]*triggerWrapper) - mapperFactory := mapper.NewFactory(resolve.GetBasicResolver()) expressionFactory := expression.NewFactory(resolve.GetBasicResolver()) - for _, tConfig := range tConfigs { + tConfig.AppConfig = map[string]interface{}{"Name": a.name, "Version": a.version, "Description": a.description, + "Trigger": tConfigs} + _, exists := triggers[tConfig.Id] if exists { return nil, fmt.Errorf("Trigger with id '%s' already registered, trigger ids have to be unique", tConfig.Id) } + if tConfig.Ref == "" { var ok bool tConfig.Ref, ok =support.GetAliasRef("trigger", tConfig.Type) @@ -152,7 +154,6 @@ func (a *App) createTriggers(tConfigs []*trigger.Config, runner action.Runner) ( triggers[tConfig.Id] = &triggerWrapper{ref: tConfig.Ref, trg: trg, status: &managed.StatusInfo{Name: tConfig.Id}} } - return triggers, nil } diff --git a/engine/channels/channels.go b/engine/channels/channels.go index ba0dac44..d62e0dd1 100644 --- a/engine/channels/channels.go +++ b/engine/channels/channels.go @@ -75,7 +75,7 @@ func Stop() error { log.RootLogger().Warnf("error stopping channel '%s', error: %s", channel.name, err.Error()) } } - + channels = make(map[string]*channelImpl) active = false return nil diff --git a/trigger/config.go b/trigger/config.go index 4bc61036..09e3bea5 100644 --- a/trigger/config.go +++ b/trigger/config.go @@ -11,11 +11,12 @@ import ( // Config is the configuration for a Trigger type Config struct { - Id string `json:"id"` - Type string `json:"type"` //an alias to the ref, can be used if imported - Ref string `json:"ref"` - Settings map[string]interface{} `json:"settings"` - Handlers []*HandlerConfig `json:"handlers"` + Id string `json:"id"` + Type string `json:"type"` //an alias to the ref, can be used if imported + Ref string `json:"ref"` + Settings map[string]interface{} `json:"settings"` + Handlers []*HandlerConfig `json:"handlers"` + AppConfig map[string]interface{} `json:"appconfig"` } func (c *Config) FixUp(md *Metadata) error {