middleware

package
v0.0.0-...-1ee731d Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const PostScriptPrefix = "postscript"
View Source
const PreScriptPrefix = "prescript"

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	ExchangeUserToken(userid string) (token auth.Token, err error)
}

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

type Middleware

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

func New

func New(handler camunda.Handler, repo VariablesRepo, auth Auth, iotClient client.Interface) *Middleware

func (*Middleware) Do

func (this *Middleware) Do(task model.CamundaExternalTask) (modules []model.Module, outputs map[string]interface{}, err error)

func (*Middleware) RunPostScripts

func (this *Middleware) RunPostScripts(userId string, inputs map[string]interface{}, existingOutputs map[string]interface{}, variables map[string]interface{}) (variableChanges map[string]interface{}, outputs map[string]interface{}, err error)

func (*Middleware) RunPreScripts

func (this *Middleware) RunPreScripts(userId string, inputs map[string]interface{}, variables map[string]interface{}) (variableChanges map[string]interface{}, outputs map[string]interface{}, err error)

func (*Middleware) RunScripts

func (this *Middleware) RunScripts(userId string, prefix string, inputs map[string]interface{}, existingOutputs map[string]interface{}, variables map[string]interface{}) (variableChanges map[string]interface{}, outputs map[string]interface{}, err error)

func (*Middleware) Undo

func (this *Middleware) Undo(modules []model.Module, reason error)

type ScriptContext

type ScriptContext interface {
	RegisterRuntime(runtime *goja.Runtime)
	GetEnvironment() map[string]interface{}
}

type VariablesRepo

type VariablesRepo interface {
	GetVariables(processId string) (result map[string]interface{}, err error)
	SetVariables(processId string, changes map[string]interface{}) error
	GetInstanceUser(instanceId string) (userId string, err error)
}

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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