export

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package export provides exporters for converting PIDL protocols to workflow engine formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BPMNExporter

type BPMNExporter struct {
	// TargetNamespace for the BPMN definition.
	TargetNamespace string
}

BPMNExporter exports PIDL process specs to BPMN 2.0 XML format.

func NewBPMNExporter

func NewBPMNExporter() *BPMNExporter

NewBPMNExporter creates a new BPMN exporter with defaults.

func (*BPMNExporter) Export

func (e *BPMNExporter) Export(p *pidl.Protocol) (string, error)

Export converts a PIDL protocol to BPMN 2.0 XML.

type Branch

type Branch struct {
	StartAt string           `json:"StartAt"`
	States  map[string]State `json:"States"`
}

Branch defines a parallel branch.

type Catch

type Catch struct {
	ErrorEquals []string `json:"ErrorEquals"`
	Next        string   `json:"Next"`
	ResultPath  string   `json:"ResultPath,omitempty"`
}

Catch defines error handling for a state.

type Choice

type Choice struct {
	Variable      string `json:"Variable,omitempty"`
	StringEquals  string `json:"StringEquals,omitempty"`
	NumericEquals int    `json:"NumericEquals,omitempty"`
	BooleanEquals *bool  `json:"BooleanEquals,omitempty"`
	Next          string `json:"Next"`
}

Choice defines a choice rule for Choice states.

type PrefectExporter

type PrefectExporter struct {
	// FlowName overrides the generated flow name.
	FlowName string
	// IncludeTasks generates task stubs.
	IncludeTasks bool
	// UseAsync generates async flow/tasks.
	UseAsync bool
}

PrefectExporter exports PIDL process specs to Prefect workflow Python code.

func NewPrefectExporter

func NewPrefectExporter() *PrefectExporter

NewPrefectExporter creates a new Prefect exporter with defaults.

func (*PrefectExporter) Export

func (e *PrefectExporter) Export(p *pidl.Protocol) (string, error)

Export converts a PIDL protocol to Prefect workflow Python code.

type PrefectFlow

type PrefectFlow struct {
	FlowName       string
	FlowID         string
	Description    string
	Tasks          []PrefectTask
	ParallelBlocks []PrefectParallelBlock
	UseAsync       bool
}

PrefectFlow represents a generated Prefect flow.

type PrefectParallelBlock

type PrefectParallelBlock struct {
	ID       string
	Tasks    []string
	JoinMode string
}

PrefectParallelBlock represents a parallel execution block.

type PrefectTask

type PrefectTask struct {
	Name        string
	FuncName    string
	Description string
	Retries     int
	RetryDelay  string
	Timeout     string
	Tags        []string
	StepType    string
}

PrefectTask represents a Prefect task.

type Retry

type Retry struct {
	ErrorEquals     []string `json:"ErrorEquals"`
	IntervalSeconds int      `json:"IntervalSeconds,omitempty"`
	MaxAttempts     int      `json:"MaxAttempts,omitempty"`
	BackoffRate     float64  `json:"BackoffRate,omitempty"`
}

Retry defines retry behavior for a state.

type State

type State struct {
	Type       string  `json:"Type"`
	Comment    string  `json:"Comment,omitempty"`
	Resource   string  `json:"Resource,omitempty"`
	Next       string  `json:"Next,omitempty"`
	End        bool    `json:"End,omitempty"`
	Retry      []Retry `json:"Retry,omitempty"`
	Catch      []Catch `json:"Catch,omitempty"`
	ResultPath string  `json:"ResultPath,omitempty"`

	// Task-specific fields
	TimeoutSeconds   int `json:"TimeoutSeconds,omitempty"`
	HeartbeatSeconds int `json:"HeartbeatSeconds,omitempty"`

	// Choice state fields
	Choices []Choice `json:"Choices,omitempty"`
	Default string   `json:"Default,omitempty"`

	// Parallel state fields
	Branches []Branch `json:"Branches,omitempty"`

	// Wait state fields
	Seconds     int    `json:"Seconds,omitempty"`
	SecondsPath string `json:"SecondsPath,omitempty"`

	// Pass state fields
	Result interface{} `json:"Result,omitempty"`

	// Map state fields
	ItemsPath      string        `json:"ItemsPath,omitempty"`
	MaxConcurrency int           `json:"MaxConcurrency,omitempty"`
	Iterator       *StateMachine `json:"Iterator,omitempty"`
}

State represents a state in the state machine.

type StateMachine

type StateMachine struct {
	Comment        string           `json:"Comment,omitempty"`
	StartAt        string           `json:"StartAt"`
	States         map[string]State `json:"States"`
	TimeoutSeconds int              `json:"TimeoutSeconds,omitempty"`
}

StateMachine represents an AWS Step Functions state machine definition.

type StepFunctionsExporter

type StepFunctionsExporter struct {
	// StateMachineName overrides the generated state machine name.
	StateMachineName string
	// Comment adds a comment to the state machine definition.
	Comment string
	// TimeoutSeconds sets the default timeout for the state machine.
	TimeoutSeconds int
}

StepFunctionsExporter exports PIDL process specs to AWS Step Functions (Amazon States Language).

func NewStepFunctionsExporter

func NewStepFunctionsExporter() *StepFunctionsExporter

NewStepFunctionsExporter creates a new Step Functions exporter with defaults.

func (*StepFunctionsExporter) Export

func (e *StepFunctionsExporter) Export(p *pidl.Protocol) (string, error)

Export converts a PIDL protocol to AWS Step Functions state machine JSON.

type TemporalActivity

type TemporalActivity struct {
	Name        string
	Description string
	InputType   string
	OutputType  string
	Timeout     string
	Retries     int
	StepType    string
}

TemporalActivity represents a workflow activity.

type TemporalExporter

type TemporalExporter struct {
	// PackageName is the Go package name for generated code.
	PackageName string
	// WorkflowName overrides the generated workflow name.
	WorkflowName string
	// IncludeActivities generates activity stubs.
	IncludeActivities bool
}

TemporalExporter exports PIDL process specs to Temporal workflow code.

func NewTemporalExporter

func NewTemporalExporter() *TemporalExporter

NewTemporalExporter creates a new Temporal exporter with defaults.

func (*TemporalExporter) Export

func (e *TemporalExporter) Export(p *pidl.Protocol) (string, error)

Export converts a PIDL protocol to Temporal workflow Go code.

type TemporalParallelBlock

type TemporalParallelBlock struct {
	ID       string
	Branches []string
	JoinMode string
}

TemporalParallelBlock represents a parallel execution block.

type TemporalStep

type TemporalStep struct {
	Name            string
	ActivityName    string
	Description     string
	IsParallelStart bool
	IsParallelEnd   bool
	Condition       string
}

TemporalStep represents a step in the workflow.

type TemporalWorkflow

type TemporalWorkflow struct {
	PackageName    string
	WorkflowName   string
	WorkflowID     string
	Description    string
	Activities     []TemporalActivity
	Steps          []TemporalStep
	ParallelBlocks []TemporalParallelBlock
}

TemporalWorkflow represents a generated Temporal workflow.

Jump to

Keyboard shortcuts

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