Parameters

Each "Automation module" will have a task form created whenever it is deployed, the name of which coming from the Golang package name.

The fields of this form start with a few default parameters while the rest will correspond to the fields of the Parameter type struct. Conditional expressions can be defined as JSON in the field struct tags to control how these appear.

Parameter types

All primitive types are supported. In addition to this, the following are also supported:

basicgroupsprotocol.EntryProvided[T]chevron-rightbasicgroupsprotocol.Provider[T]chevron-rightsmsprotocol.Verifierchevron-rightcaptchaprotocol.Solverchevron-right

Example

package example

import (
	"github.com/futura-platform/protocol"
	"github.com/futura-platform/protocol/flowprotocol"
)

type SomeMode string

const (
	mode1 SomeMode = "mode1"
	mode2 SomeMode = "mode2"
)

type Params struct {
	SomeModeParam     SomeMode
	SomeOtherParam    int
	SomeListParam     []string
	SomeOptionalParam *string

	SomeDependentParam    string `{"Condition": ["SomeModeParam", "mode1"]}`
	SomeANDDependentParam string `{"Condition": ["$and", [["SomeModeParam", "mode1"], ["SomeOtherParam", 1]]]}`
	SomeORDependentParam  string `{"Condition": ["$or", [["SomeModeParam", "mode1"], ["SomeOtherParam", 1]]]}`
}

type Task struct {
	*protocol.Task[Params]
}

func ConstructTask(base *protocol.Task[Params]) (protocol.BaseTask, []flowprotocol.TaskStep, error) {
	...
}

Will produce this task form:

Last updated