Skip to content

Executor for tasks the needs to use javascript to process data or make decisions

License

Notifications You must be signed in to change notification settings

engineone/javascript_executor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

If Executor

The If Executor is a decision node that returns the next task to be performed based on the condition provided. The condition is written in Javascript and may contain Golang templating tags.

Note: This project was created to be used in Lepsta's EngineOne workflow engine. As such, it is structured to be compatible with that use.

EngineOne compatibility

To make sure that this project remains compatible with EngineOne, the following must be retained and left unchanged:

main.go

If you have to change this file, please refrain from modifying the line var Executor = executor.NewIfExecutor(). Without this line, this will no longer qualify as an EngineOne executor.

executor/executor.go

The IfExecutor struct must implement the following interface:

type Executor interface {
	New() Executor
	ID() string
	Name() string
	Description() string
	InputRules() map[string]interface{}
	OutputRules() map[string]interface{}
	Validate(ctx context.Context, task *types.Task, tasks []*types.Task) error
	Execute(ctx context.Context, task *types.Task, tasks []*types.Task) (Output, error)
}

Anything else can be changed.

Setup

After cloning this repository, you need to run:

go mod vendor

This will download all the dependencies.

Testing

To run the unit tests, we use Ginkgo, so you will need to install it using:

go install github.com/onsi/ginkgo/v2/ginkgo

You can then run the tests using:

make test

Build

To build this project into Golang modules, simply run:

make build

On an environment that supports Cgo.

About

Executor for tasks the needs to use javascript to process data or make decisions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published