camunda_client_go

package module
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: MIT Imports: 12 Imported by: 0

README

Camunda REST API client for golang

Build Status GoDoc

Installation

latest stable version:

go get gopkg.in/citilinkru/camunda-client-go.v1

latest unstable version (master branch):

go get github.com/gasparyanyur/camunda-client-go

Usage

Create client:

client := camunda_client_go.NewClient(camunda_client_go.ClientOptions{
	EndpointUrl: "http://localhost:8080/engine-rest",
    ApiUser: "demo",
    ApiPassword: "demo",
    Timeout: time.Second * 10,
})

Create deployment:

file, err := os.Open("demo.bpmn")
if err != nil {
    fmt.Printf("Error read file: %s\n", err)
    return
}
result, err := client.Deployment.Create(camunda_client_go.ReqDeploymentCreate{
    DeploymentName: "DemoProcess",
    Resources: map[string]interface{}{
        "demo.bpmn": file,
    },
})
if err != nil {
    fmt.Printf("Error deploy process: %s\n", err)
    return
}

fmt.Printf("Result: %#+v\n", result)

Start instance:

processKey := "demo-process"
result, err := client.ProcessDefinition.StartInstance(
	camunda_client_go.QueryProcessDefinitionBy{Key: &processKey},
	camunda_client_go.ReqStartInstance{},
)
if err != nil {
    fmt.Printf("Error start process: %s\n", err)
    return
}

fmt.Printf("Result: %#+v\n", result)

More examples

Examples documentation

Usage for External task

Create external task processor:

logger := func(err error) {
	fmt.Println(err.Error())
}
asyncResponseTimeout := 5000
proc := processor.NewProcessor(client, &processor.ProcessorOptions{
    WorkerId: "demo-worker",
    LockDuration: time.Second * 5,
    MaxTasks: 10,
    MaxParallelTaskPerHandler: 100,
    AsyncResponseTimeout: &asyncResponseTimeout,
}, logger)

Add and subscribe external task handler:

proc.AddHandler(
    &[]camunda_client_go.QueryFetchAndLockTopic{
        {TopicName: "HelloWorldSetter"},
    },
    func(ctx *processor.Context) error {
        fmt.Printf("Running task %s. WorkerId: %s. TopicName: %s\n", ctx.Task.Id, ctx.Task.WorkerId, ctx.Task.TopicName)

        err := ctx.Complete(processor.QueryComplete{
            Variables: &map[string]camunda_client_go.Variable {
                "result": {Value: "Hello world!", Type: "string"},
            },
        })
        if err != nil {
            fmt.Printf("Error set complete task %s: %s\n", ctx.Task.Id, err)
            
            return ctx.HandleFailure(processor.QueryHandleFailure{
                ErrorMessage: &errTxt,
                Retries: &retries,
                RetryTimeout: &retryTimeout,
            })
        }
        
        fmt.Printf("Task %s completed\n", ctx.Task.Id)
        return nil
    },
)

Features

  • Support api version 7.11
  • Full support API External Task
  • Full support API Process Definition
  • Full support API Deployment
  • Without external dependencies

Road map

  • Full coverage by tests
  • Full support references api

Testing

Unit-tests:

go test -v -race ./...

Run linter:

golangci-lint run

LICENSE

MIT

AUTHOR

Konstantin Osipov k.osipov.msk@gmail.com

Documentation

Index

Constants

View Source
const (
	DelegationStatePending  = "PENDING"
	DelegationStateResolved = "RESOLVED"
)
View Source
const (
	VariableFilterExpressionOperatorEqual              = "eq"
	VariableFilterExpressionOperatorNotEqual           = "neq"
	VariableFilterExpressionOperatorGreaterThan        = "gt"
	VariableFilterExpressionOperatorGreaterThanOrEqual = "gteq"
	VariableFilterExpressionOperatorLessThan           = "lt"
	VariableFilterExpressionOperatorLessThanOrEqual    = "lteq"
	VariableFilterExpressionOperatorLike               = "like"
)
View Source
const DefaultDateTimeFormat = "2006-01-02T15:04:05.000-0700"
View Source
const DefaultEndpointUrl = "http://localhost:8080/engine-rest"
View Source
const DefaultTimeoutSec = 60
View Source
const DefaultUserAgent = "CamundaClientGo/" + PackageVersion
View Source
const PackageVersion = "{{version}}"

Variables

View Source
var ErrorNotFound = &Error{
	Type:    "NotFound",
	Message: "Not found",
}

Functions

This section is empty.

Types

type Client

type Client struct {
	ExternalTask      *ExternalTask
	Deployment        *Deployment
	ProcessDefinition *ProcessDefinition
	UserTask          *userTaskApi
	// contains filtered or unexported fields
}

Client a client for Camunda API

func NewClient

func NewClient(options ClientOptions) *Client

NewClient a create new instance Client

func (*Client) SetCustomTransport

func (c *Client) SetCustomTransport(customHTTPTransport http.RoundTripper)

SetCustomTransport set new custom transport

type ClientOptions

type ClientOptions struct {
	UserAgent   string
	EndpointUrl string
	Timeout     time.Duration
	ApiUser     string
	ApiPassword string
}

ClientOptions a client options

type Deployment

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

Deployment a client for Deployment API

func (*Deployment) Create

func (d *Deployment) Create(deploymentCreate ReqDeploymentCreate) (deployment *ResDeploymentCreate, err error)

Create creates a deployment

func (*Deployment) Delete

func (d *Deployment) Delete(id string, query map[string]string) error

Delete deletes a deployment by id

func (*Deployment) Get

func (d *Deployment) Get(id string) (deployment ResDeployment, err error)

Get retrieves a deployment by id, according to the Deployment interface of the engine

func (*Deployment) GetList

func (d *Deployment) GetList(query map[string]string) (deployments []*ResDeployment, err error)

GetList a queries for deployments that fulfill given parameters. Parameters may be the properties of deployments, such as the id or name or a range of the deployment time. The size of the result set can be retrieved by using the Get Deployment count method. Query parameters described in the documentation: https://docs.camunda.org/manual/latest/reference/rest/deployment/get-query/#query-parameters

func (*Deployment) GetListCount

func (d *Deployment) GetListCount(query map[string]string) (count int, err error)

GetListCount a queries for the number of deployments that fulfill given parameters. Takes the same parameters as the Get Deployments method

func (*Deployment) GetResource

func (d *Deployment) GetResource(id, resourceId string) (resource *ResDeploymentResource, err error)

GetResource retrieves a deployment resource by resource id for the given deployment

func (*Deployment) GetResourceBinary

func (d *Deployment) GetResourceBinary(id, resourceId string) (data []byte, err error)

GetResourceBinary retrieves the binary content of a deployment resource for the given deployment by id

func (*Deployment) GetResources

func (d *Deployment) GetResources(id string) (resources []*ResDeploymentResource, err error)

GetResources retrieves all deployment resources of a given deployment

func (*Deployment) Redeploy

func (d *Deployment) Redeploy(id string, req ReqRedeploy) (deployment *ResDeploymentCreate, err error)

Redeploy a re-deploys an existing deployment. The deployment resources to re-deploy can be restricted by using the properties resourceIds or resourceNames. If no deployment resources to re-deploy are passed then all existing resources of the given deployment are re-deployed

type Error

type Error struct {
	Type    string `json:"type"`
	Message string `json:"message"`
}

Error a custom error type

func (*Error) Error

func (e *Error) Error() string

Error error message

type ExternalTask

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

ExternalTask a client for ExternalTask API

func (*ExternalTask) Complete

func (e *ExternalTask) Complete(id string, query QueryComplete) error

Complete a completes an external task by id and updates process variables

func (*ExternalTask) ExtendLock

func (e *ExternalTask) ExtendLock(id string, query QueryExtendLock) error

ExtendLock a extends the timeout of the lock by a given amount of time

func (*ExternalTask) FetchAndLock

func (e *ExternalTask) FetchAndLock(query QueryFetchAndLock) ([]*ResLockedExternalTask, error)

FetchAndLock fetches and locks a specific number of external tasks for execution by a worker. Query can be restricted to specific task topics and for each task topic an individual lock time can be provided

func (*ExternalTask) Get

func (e *ExternalTask) Get(id string) (*ResExternalTask, error)

Get retrieves an external task by id, corresponding to the ExternalTask interface in the engine

func (*ExternalTask) GetList

func (e *ExternalTask) GetList(query map[string]string) ([]*ResExternalTask, error)

GetList queries for the external tasks that fulfill given parameters. Parameters may be static as well as dynamic runtime properties of executions Query parameters described in the documentation: https://docs.camunda.org/manual/latest/reference/rest/external-task/get-query/#query-parameters

func (*ExternalTask) GetListCount

func (e *ExternalTask) GetListCount(query map[string]string) (int, error)

GetListCount queries for the number of external tasks that fulfill given parameters. Takes the same parameters as the Get External Tasks method. Query parameters described in the documentation: https://docs.camunda.org/manual/latest/reference/rest/external-task/get-query-count/#query-parameters

func (*ExternalTask) GetListPost

func (e *ExternalTask) GetListPost(query QueryGetListPost, firstResult, maxResults int) ([]*ResExternalTask, error)

GetListPost queries for external tasks that fulfill given parameters in the form of a JSON object. This method is slightly more powerful than the Get External Tasks method because it allows to specify a hierarchical result sorting.

func (*ExternalTask) GetListPostCount

func (e *ExternalTask) GetListPostCount(query QueryGetListPost) (int, error)

GetListPostCount queries for the number of external tasks that fulfill given parameters. This method takes the same message body as the Get External Tasks (POST) method

func (*ExternalTask) HandleBPMNError

func (e *ExternalTask) HandleBPMNError(id string, query QueryHandleBPMNError) error

HandleBPMNError reports a business error in the context of a running external task by id. The error code must be specified to identify the BPMN error handler

func (*ExternalTask) HandleFailure

func (e *ExternalTask) HandleFailure(id string, query QueryHandleFailure) error

HandleFailure reports a failure to execute an external task by id. A number of retries and a timeout until the task can be retried can be specified. If retries are set to 0, an incident for this task is created

func (*ExternalTask) SetPriority

func (e *ExternalTask) SetPriority(id string, priority int) error

SetPriority a sets the priority of an existing external task by id. The default value of a priority is 0

func (*ExternalTask) SetRetries

func (e *ExternalTask) SetRetries(id string, retries int) error

SetRetries a sets the number of retries left to execute an external task by id. If retries are set to 0, an incident is created

func (*ExternalTask) SetRetriesAsync

func (e *ExternalTask) SetRetriesAsync(id string, query QuerySetRetriesAsync) (*ResBatch, error)

SetRetriesAsync a set Retries For Multiple External Tasks Async (Batch). Sets the number of retries left to execute external tasks by id asynchronously. If retries are set to 0, an incident is created

func (*ExternalTask) SetRetriesSync

func (e *ExternalTask) SetRetriesSync(id string, query QuerySetRetriesSync) error

SetRetriesSync a set Retries For Multiple External Tasks Sync. Sets the number of retries left to execute external tasks by id synchronously. If retries are set to 0, an incident is created

func (*ExternalTask) Unlock

func (e *ExternalTask) Unlock(id string) error

Unlock a unlocks an external task by id. Clears the task’s lock expiration time and worker id

type ProcessDefinition

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

ProcessDefinition a client for ProcessDefinition

func (*ProcessDefinition) ActivateOrSuspendById

ActivateOrSuspendById activates or suspends a given process definition by id or by latest version of process definition key

func (*ProcessDefinition) ActivateOrSuspendByKey

func (p *ProcessDefinition) ActivateOrSuspendByKey(req ReqActivateOrSuspendByKey) error

ActivateOrSuspendByKey activates or suspends process definitions with the given process definition key

func (*ProcessDefinition) Delete

Delete deletes a process definition from a deployment by id https://docs.camunda.org/manual/latest/reference/rest/process-definition/delete-process-definition/#query-parameters

func (*ProcessDefinition) Get

func (p *ProcessDefinition) Get(by QueryProcessDefinitionBy) (processDefinition *ResProcessDefinition, err error)

Get retrieves a process definition according to the ProcessDefinition interface in the engine

func (*ProcessDefinition) GetActivityInstanceStatistics

func (p *ProcessDefinition) GetActivityInstanceStatistics(by QueryProcessDefinitionBy, query map[string]string) (statistic []*ResActivityInstanceStatistics, err error)

GetActivityInstanceStatistics retrieves runtime statistics of a given process definition, grouped by activities. These statistics include the number of running activity instances, optionally the number of failed jobs and also optionally the number of incidents either grouped by incident types or for a specific incident type. Note: This does not include historic data https://docs.camunda.org/manual/latest/reference/rest/process-definition/get-activity-statistics/#query-parameters

func (*ProcessDefinition) GetDeployedStartForm

func (p *ProcessDefinition) GetDeployedStartForm(by QueryProcessDefinitionBy) (htmlForm string, err error)

GetDeployedStartForm retrieves the deployed form that can be referenced from a start event. For further information please refer to User Guide

func (*ProcessDefinition) GetDiagram

func (p *ProcessDefinition) GetDiagram(by QueryProcessDefinitionBy) (data []byte, err error)

GetDiagram retrieves the diagram of a process definition. If the process definition’s deployment contains an image resource with the same file name as the process definition, the deployed image will be returned by the Get Diagram endpoint. Example: someProcess.bpmn and someProcess.png. Supported file extentions for the image are: svg, png, jpg, and gif

func (*ProcessDefinition) GetList

func (p *ProcessDefinition) GetList(query map[string]string) (processDefinitions []*ResProcessDefinition, err error)

GetList queries for process definitions that fulfill given parameters. Parameters may be the properties of process definitions, such as the name, key or version. The size of the result set can be retrieved by using the Get Definition Count method https://docs.camunda.org/manual/latest/reference/rest/process-definition/get-query/#query-parameters

func (*ProcessDefinition) GetListCount

func (p *ProcessDefinition) GetListCount(query map[string]string) (count int, err error)

GetListCount requests the number of process definitions that fulfill the query criteria. Takes the same filtering parameters as the Get Definitions method https://docs.camunda.org/manual/latest/reference/rest/process-definition/get-query-count/#query-parameters

func (*ProcessDefinition) GetProcessInstanceStatistics

func (p *ProcessDefinition) GetProcessInstanceStatistics(query map[string]string) (statistic []*ResInstanceStatistics, err error)

GetProcessInstanceStatistics retrieves runtime statistics of the process engine, grouped by process definitions. These statistics include the number of running process instances, optionally the number of failed jobs and also optionally the number of incidents either grouped by incident types or for a specific incident type. Note: This does not include historic data https://docs.camunda.org/manual/latest/reference/rest/process-definition/get-statistics/#query-parameters

func (*ProcessDefinition) GetRenderedStartForm

func (p *ProcessDefinition) GetRenderedStartForm(by QueryProcessDefinitionBy) (htmlForm string, err error)

GetRenderedStartForm retrieves the rendered form for a process definition. This method can be used for getting the HTML rendering of a Generated Task Form

func (*ProcessDefinition) GetStartFormKey

func (p *ProcessDefinition) GetStartFormKey(by QueryProcessDefinitionBy) (resp *ResGetStartFormKey, err error)

GetStartFormKey retrieves the key of the start form for a process definition. The form key corresponds to the FormData#formKey property in the engine

func (*ProcessDefinition) GetStartFormVariables

func (p *ProcessDefinition) GetStartFormVariables(by QueryProcessDefinitionBy, query map[string]string) (variables map[string]Variable, err error)

GetStartFormVariables Retrieves the start form variables for a process definition (only if they are defined via the Generated Task Form approach). The start form variables take form data specified on the start event into account. If form fields are defined, the variable types and default values of the form fields are taken into account https://docs.camunda.org/manual/latest/reference/rest/process-definition/get-form-variables/#query-parameters

func (*ProcessDefinition) GetXML

GetXML retrieves the BPMN 2.0 XML of a process definition

func (*ProcessDefinition) RestartProcessInstance

func (p *ProcessDefinition) RestartProcessInstance(id string, req ReqRestartInstance) error

RestartProcessInstance restarts process instances that were canceled or terminated synchronously. To execute the restart asynchronously, use the Restart Process Instance Async method For more information about the difference between synchronous and asynchronous execution, please refer to the related section of the user guide

func (*ProcessDefinition) RestartProcessInstanceAsync

func (p *ProcessDefinition) RestartProcessInstanceAsync(id string, req ReqRestartInstance) (resp *ResBatch, err error)

RestartProcessInstanceAsync restarts process instances that were canceled or terminated asynchronously. To execute the restart synchronously, use the Restart Process Instance method For more information about the difference between synchronous and asynchronous execution, please refer to the related section of the user guide

func (*ProcessDefinition) StartInstance

func (p *ProcessDefinition) StartInstance(by QueryProcessDefinitionBy, req ReqStartInstance) (processDefinition *ResStartedProcessDefinition, err error)

StartInstance instantiates a given process definition. Process variables and business key may be supplied in the request body

func (*ProcessDefinition) SubmitStartForm

SubmitStartForm starts a process instance using a set of process variables and the business key. If the start event has Form Field Metadata defined, the process engine will perform backend validation for any form fields which have validators defined. See Documentation on Generated Task Forms

func (*ProcessDefinition) UpdateHistoryTimeToLive

func (p *ProcessDefinition) UpdateHistoryTimeToLive(by QueryProcessDefinitionBy, historyTimeToLive int) error

UpdateHistoryTimeToLive updates history time to live for process definition. The field is used within History cleanup

type QueryComplete

type QueryComplete struct {
	// The id of the worker that completes the task.
	// Must match the id of the worker who has most recently locked the task
	WorkerId *string `json:"workerId,omitempty"`
	// A JSON object containing variable key-value pairs
	Variables *map[string]Variable `json:"variables"`
	// A JSON object containing variable key-value pairs.
	// Local variables are set only in the scope of external task
	LocalVariables *map[string]Variable `json:"localVariables"`
}

QueryComplete a query for Complete request

type QueryExtendLock

type QueryExtendLock struct {
	//	An amount of time (in milliseconds). This is the new lock duration starting from the current moment
	NewDuration *int `json:"newDuration,omitempty"`
	// The ID of a worker who is locking the external task
	WorkerId *string `json:"workerId,omitempty"`
}

QueryExtendLock a query for ExtendLock request

type QueryFetchAndLock

type QueryFetchAndLock struct {
	// Mandatory. The id of the worker on which behalf tasks are fetched. The returned tasks are locked
	// for that worker and can only be completed when providing the same worker id
	WorkerId string `json:"workerId"`
	// Mandatory. The maximum number of tasks to return
	MaxTasks int `json:"maxTasks"`
	// A boolean value, which indicates whether the task should be fetched based on its priority or arbitrarily
	UsePriority *bool `json:"usePriority,omitempty"`
	// The Long Polling timeout in milliseconds.
	// Note: The value cannot be set larger than 1.800.000 milliseconds (corresponds to 30 minutes)
	AsyncResponseTimeout *int `json:"asyncResponseTimeout,omitempty"`
	// A JSON array of topic objects for which external tasks should be fetched.
	// The returned tasks may be arbitrarily distributed among these topics
	Topics *[]QueryFetchAndLockTopic `json:"topics,omitempty"`
}

QueryFetchAndLock query for FetchAndLock request

type QueryFetchAndLockTopic

type QueryFetchAndLockTopic struct {
	// Mandatory. The topic's name
	TopicName string `json:"topicName"`
	// Mandatory. The duration to lock the external tasks for in milliseconds
	LockDuration int `json:"lockDuration"`
	// A JSON array of String values that represent variable names. For each result task belonging to this topic,
	// the given variables are returned as well if they are accessible from the external task's execution.
	// If not provided - all variables will be fetched
	Variables *[]string `json:"variables,omitempty"`
	// If true only local variables will be fetched
	LocalVariables *bool `json:"localVariables,omitempty"`
	// A String value which enables the filtering of tasks based on process instance business key
	BusinessKey *string `json:"businessKey,omitempty"`
	// Filter tasks based on process definition id
	ProcessDefinitionId *string `json:"processDefinitionId,omitempty"`
	// Filter tasks based on process definition ids
	ProcessDefinitionIdIn *string `json:"processDefinitionIdIn,omitempty"`
	// Filter tasks based on process definition key
	ProcessDefinitionKey *string `json:"processDefinitionKey,omitempty"`
	// Filter tasks based on process definition keys
	ProcessDefinitionKeyIn *string `json:"processDefinitionKeyIn,omitempty"`
	// 	Filter tasks without tenant id
	WithoutTenantId *string `json:"withoutTenantId,omitempty"`
	// Filter tasks based on tenant ids
	TenantIdIn *string `json:"tenantIdIn,omitempty"`
	// A JSON object used for filtering tasks based on process instance variable values.
	// A property name of the object represents a process variable name, while the property value
	// represents the process variable value to filter tasks by
	ProcessVariables map[string]Variable `json:"processVariables,omitempty"`
	// Determines whether serializable variable values (typically variables that store custom Java objects)
	// should be deserialized on server side (default false).
	// If set to true, a serializable variable will be deserialized on server side and transformed to JSON
	// using Jackson's POJO/bean property introspection feature. Note that this requires the Java classes
	// of the variable value to be on the REST API's classpath.
	// If set to false, a serializable variable will be returned in its serialized format.
	// For example, a variable that is serialized as XML will be returned as a JSON string containing XML
	DeserializeValues *bool `json:"deserializeValues,omitempty"`
}

QueryFetchAndLockTopic a JSON array of topic objects for which external tasks should be fetched

type QueryGetListPost

type QueryGetListPost struct {
	// Filter by an external task's id
	ExternalTaskId *string `json:"externalTaskId,omitempty"`
	// Filter by an external task topic
	TopicName *string `json:"topicName,omitempty"`
	// Filter by the id of the worker that the task was most recently locked by
	WorkerId *string `json:"workerId,omitempty"`
	// Only include external tasks that are currently locked (i.e., they have a lock time and it has not expired).
	// Value may only be true, as false matches any external task
	Locked *bool `json:"locked,omitempty"`
	// Only include external tasks that are currently not locked (i.e., they have no lock or it has expired).
	// Value may only be true, as false matches any external task
	NotLocked *bool `json:"notLocked,omitempty"`
	// Only include external tasks that have a positive (> 0) number of retries (or null). Value may only be true,
	// as false matches any external task
	WithRetriesLeft *bool `json:"withRetriesLeft,omitempty"`
	// Only include external tasks that have 0 retries. Value may only be true, as false matches any external task
	NoRetriesLeft *bool `json:"noRetriesLeft,omitempty"`
	// Restrict to external tasks that have a lock that expires after a given date. By default*,
	// the date must have the format yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g., 2013-01-23T14:42:45.000+0200
	LockExpirationAfter *Time `json:"lockExpirationAfter,omitempty"`
	// Restrict to external tasks that have a lock that expires before a given date. By default*,
	// the date must have the format yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g., 2013-01-23T14:42:45.000+0200
	LockExpirationBefore *Time `json:"lockExpirationBefore,omitempty"`
	// Filter by the id of the activity that an external task is created for
	ActivityId *string `json:"activityId,omitempty"`
	// Filter by the comma-separated list of ids of the activities that an external task is created for
	ActivityIdIn *string `json:"activityIdIn,omitempty"`
	// Filter by the id of the execution that an external task belongs to
	ExecutionId *string `json:"executionId,omitempty"`
	// Filter by the id of the process instance that an external task belongs to
	ProcessInstanceId *string `json:"processInstanceId,omitempty"`
	// Filter by the id of the process definition that an external task belongs to
	ProcessDefinitionId *string `json:"processDefinitionId,omitempty"`
	// Filter by a comma-separated list of tenant ids. An external task must have one of the given tenant ids
	TenantIdIn *string `json:"tenantIdIn,omitempty"`
	// Only include active tasks. Value may only be true, as false matches any external task
	Active *bool `json:"active,omitempty"`
	// Only include suspended tasks. Value may only be true, as false matches any external task
	Suspended *bool `json:"suspended,omitempty"`
	// Only include jobs with a priority higher than or equal to the given value. Value must be a valid long value
	PriorityHigherThanOrEquals *int `json:"priorityHigherThanOrEquals,omitempty"`
	// Only include jobs with a priority lower than or equal to the given value. Value must be a valid long value
	PriorityLowerThanOrEquals *int `json:"priorityLowerThanOrEquals,omitempty"`
	// A JSON array of criteria to sort the result by. Each element of the array is a JSON object
	// that specifies one ordering. The position in the array identifies the rank of an ordering,
	// i.e., whether it is primary, secondary, etc.
	Sorting *QueryListPostSorting `json:"sorting,omitempty"`
}

QueryGetListPost a query for ListPost request

type QueryHandleBPMNError

type QueryHandleBPMNError struct {
	// The id of the worker that reports the failure.
	// Must match the id of the worker who has most recently locked the task
	WorkerId *string `json:"workerId,omitempty"`
	// An error code that indicates the predefined error. Is used to identify the BPMN error handler
	ErrorCode *string `json:"errorCode,omitempty"`
	// An error message that describes the error
	ErrorMessage *string `json:"errorMessage,omitempty"`
	// A JSON object containing the variables which will be passed to the execution.
	// Each key corresponds to a variable name and each value to a variable value
	Variables *map[string]Variable `json:"variables"`
}

QueryHandleBPMNError a query for HandleBPMNError request

type QueryHandleFailure

type QueryHandleFailure struct {
	// The id of the worker that reports the failure.
	// Must match the id of the worker who has most recently locked the task
	WorkerId *string `json:"workerId,omitempty"`
	// An message indicating the reason of the failure
	ErrorMessage *string `json:"errorMessage,omitempty"`
	// A detailed error description
	ErrorDetails *string `json:"errorDetails,omitempty"`
	// A number of how often the task should be retried.
	// Must be >= 0. If this is 0, an incident is created and the task cannot be fetched anymore unless
	// the retries are increased again. The incident's message is set to the errorMessage parameter
	Retries *int `json:"retries,omitempty"`
	// A timeout in milliseconds before the external task becomes available again for fetching. Must be >= 0
	RetryTimeout *int `json:"retryTimeout,omitempty"`
}

QueryHandleFailure a query for HandleFailure request

type QueryListPostSorting

type QueryListPostSorting struct {
	// Mandatory. Sort the results lexicographically by a given criterion. Valid values are id, lockExpirationTime,
	// processInstanceId, processDefinitionId, processDefinitionKey, taskPriority and tenantId
	SortBy string `json:"sortBy"`
	// Mandatory. Sort the results in a given order. Values may be asc for ascending order or desc for descending order
	SortOrder string `json:"sortOrder"`
}

QueryListPostSorting a JSON array of criteria to sort the result by

type QueryProcessDefinitionBy

type QueryProcessDefinitionBy struct {
	Id       *string
	Key      *string
	TenantId *string
}

QueryProcessDefinitionBy path builder

func (*QueryProcessDefinitionBy) String

func (q *QueryProcessDefinitionBy) String() string

String a build path part

type QuerySetRetriesAsync

type QuerySetRetriesAsync struct {
	// The number of retries to set for the external task. Must be >= 0. If this is 0, an incident is created and the
	// task cannot be fetched anymore unless the retries are increased again. Can not be null
	Retries int `json:"retries"`
	// The ids of the external tasks to set the number of retries for
	ExternalTaskIds *string `json:"externalTaskIds,omitempty"`
	// The ids of process instances containing the tasks to set the number of retries for
	ProcessInstanceIds *string `json:"processInstanceIds,omitempty"`
	// Query for the external tasks to set the number of retries for
	ExternalTaskQuery *string `json:"externalTaskQuery,omitempty"`
	// Query for the process instances containing the tasks to set the number of retries for
	ProcessInstanceQuery *string `json:"processInstanceQuery,omitempty"`
	// Query for the historic process instances containing the tasks to set the number of retries for
	HistoricProcessInstanceQuery *string `json:"historicProcessInstanceQuery,omitempty"`
}

QuerySetRetriesAsync a query for SetRetriesAsync request

type QuerySetRetriesSync

type QuerySetRetriesSync struct {
	// The number of retries to set for the external task. Must be >= 0. If this is 0, an incident is created
	// and the task cannot be fetched anymore unless the retries are increased again. Can not be null
	Retries int `json:"retries"`
	// The ids of the external tasks to set the number of retries for
	ExternalTaskIds *string `json:"externalTaskIds,omitempty"`
	// The ids of process instances containing the tasks to set the number of retries for
	ProcessInstanceIds *string `json:"processInstanceIds,omitempty"`
	// Query for the external tasks to set the number of retries for
	ExternalTaskQuery *string `json:"externalTaskQuery,omitempty"`
	// Query for the process instances containing the tasks to set the number of retries for
	ProcessInstanceQuery *string `json:"processInstanceQuery,omitempty"`
	// Query for the historic process instances containing the tasks to set the number of retries for
	HistoricProcessInstanceQuery *string `json:"historicProcessInstanceQuery,omitempty"`
}

QuerySetRetriesSync a query for SetRetriesSync request

type QueryUserTaskComplete added in v1.1.1

type QueryUserTaskComplete struct {
	// A JSON object containing variable key-value pairs
	Variables map[string]Variable `json:"variables"`
}

QueryUserTaskComplete a query for Complete user task request

type ReqActivateOrSuspendById

type ReqActivateOrSuspendById struct {
	// A Boolean value which indicates whether to activate or suspend a given process definition. When the value
	// is set to true, the given process definition will be suspended and when the value is set to false,
	// the given process definition will be activated
	Suspended *bool `json:"suspended,omitempty"`
	// A Boolean value which indicates whether to activate or suspend also all process instances of the given process
	// definition. When the value is set to true, all process instances of the provided process definition will be
	// activated or suspended and when the value is set to false, the suspension state of all process instances of
	// the provided process definition will not be updated
	IncludeProcessInstances *bool `json:"includeProcessInstances,omitempty"`
	// The date on which the given process definition will be activated or suspended. If null, the suspension state
	// of the given process definition is updated immediately. The date must have the format yyyy-MM-dd'T'HH:mm:ss,
	// e.g., 2013-01-23T14:42:45
	ExecutionDate *Time `json:"executionDate,omitempty"`
}

ReqActivateOrSuspendById response ActivateOrSuspendById

type ReqActivateOrSuspendByKey

type ReqActivateOrSuspendByKey struct {
	// The key of the process definitions to activate or suspend
	ProcessDefinitionKey string `json:"processDefinitionKey"`
	// A Boolean value which indicates whether to activate or suspend a given process definition. When the value
	// is set to true, the given process definition will be suspended and when the value is set to false,
	// the given process definition will be activated
	Suspended *bool `json:"suspended,omitempty"`
	// A Boolean value which indicates whether to activate or suspend also all process instances of the given process
	// definition. When the value is set to true, all process instances of the provided process definition will be
	// activated or suspended and when the value is set to false, the suspension state of all process instances of
	// the provided process definition will not be updated
	IncludeProcessInstances *bool `json:"includeProcessInstances,omitempty"`
	// The date on which the given process definition will be activated or suspended. If null, the suspension state
	// of the given process definition is updated immediately. The date must have the format yyyy-MM-dd'T'HH:mm:ss,
	// e.g., 2013-01-23T14:42:45
	ExecutionDate *Time `json:"executionDate,omitempty"`
}

ReqActivateOrSuspendByKey response ActivateOrSuspendByKey

type ReqDeploymentCreate

type ReqDeploymentCreate struct {
	DeploymentName           string
	EnableDuplicateFiltering *bool
	DeployChangedOnly        *bool
	DeploymentSource         *string
	TenantId                 *string
	Resources                map[string]interface{}
}

ReqDeploymentCreate a request to deployment create

type ReqRedeploy

type ReqRedeploy struct {
	// A list of deployment resource ids to re-deploy
	ResourceIds *string `json:"resourceIds,omitempty"`
	// A list of deployment resource names to re-deploy
	ResourceNames *string `json:"resourceNames,omitempty"`
	// Sets the source of the deployment
	Source *string `json:"source,omitempty"`
}

ReqRedeploy a request to redeploy

type ReqRestartInstance

type ReqRestartInstance struct {
	// A list of process instance ids to restart
	ProcessInstanceIds *string `json:"processInstanceIds,omitempty"`
	// A historic process instance query like the request body described by POST /history/process-instance
	HistoricProcessInstanceQuery *string `json:"historicProcessInstanceQuery,omitempty"`
	// Optional. A JSON array of instructions that specify which activities to start the process instance at.
	// If this property is omitted, the process instance starts at its default blank start event
	StartInstructions *ReqStartInstructions `json:"startInstructions,omitempty"`
	// Skip execution listener invocation for activities that are started or ended as part of this request
	// Note: This option is currently only respected when start instructions are submitted via
	// the startInstructions property
	SkipCustomListeners *bool `json:"skipCustomListeners,omitempty"`
	// Skip execution of input/output variable mappings for activities that are started or ended as part of this request
	// Note: This option is currently only respected when start instructions are submitted via
	// the startInstructions property
	SkipIoMappings *bool `json:"skipIoMappings,omitempty"`
	// Set the initial set of variables during restart. By default, the last set of variables is used
	InitialVariables *bool `json:"initialVariables,omitempty"`
	// Do not take over the business key of the historic process instance.
	WithoutBusinessKey *bool `json:"withoutBusinessKey,omitempty"`
}

ReqRestartInstance a request to restart instance

type ReqStartInstance

type ReqStartInstance struct {
	// A JSON object containing the variables the process is to be initialized with
	Variables *map[string]Variable `json:"variables,omitempty"`
	// The business key the process instance is to be initialized with.
	// The business key uniquely identifies the process instance in the context of the given process definition
	BusinessKey *string `json:"businessKey,omitempty"`
	// The case instance id the process instance is to be initialized with
	CaseInstanceId *string `json:"caseInstanceId,omitempty"`
	// Optional. A JSON array of instructions that specify which activities to start the process instance at.
	// If this property is omitted, the process instance starts at its default blank start event
	StartInstructions *ReqStartInstructions `json:"startInstructions,omitempty"`
	// Skip execution listener invocation for activities that are started or ended as part of this request
	// Note: This option is currently only respected when start instructions are submitted via
	// the startInstructions property
	SkipCustomListeners *bool `json:"skipCustomListeners,omitempty"`
	// Skip execution of input/output variable mappings for activities that are started or ended as part of this request
	// Note: This option is currently only respected when start instructions are submitted via
	// the startInstructions property
	SkipIoMappings *bool `json:"skipIoMappings,omitempty"`
	// Indicates if the variables, which was used by the process instance during execution, should be returned. Default value: false
	WithVariablesInReturn *bool `json:"withVariablesInReturn,omitempty"`
}

ReqStartInstance a JSON object with the following properties: (at least an empty JSON object {} or an empty request body)

type ReqStartInstructions

type ReqStartInstructions struct {
	// Mandatory. One of the following values: startBeforeActivity, startAfterActivity, startTransition.
	// A startBeforeActivity instruction requests to start execution before entering a given activity.
	// A startAfterActivity instruction requests to start at the single outgoing sequence flow of a given activity.
	// A startTransition instruction requests to execute a specific sequence flow
	Type string `json:"type"`
	// Can be used with instructions of types startBeforeActivity and startAfterActivity.
	// Specifies the activity the instruction targets
	ActivityId *string `json:"activityId,omitempty"`
	// Can be used with instructions of types startTransition. Specifies the sequence flow to start
	TransitionId *string `json:"transitionId,omitempty"`
	// Can be used with instructions of type startBeforeActivity, startAfterActivity, and startTransition.
	// A JSON object containing variable key-value pairs
	Variables *map[string]VariableSet `json:"variables,omitempty"`
}

ReqStartInstructions a JSON array of instructions that specify which activities to start the process instance at

type ReqSubmitStartForm

type ReqSubmitStartForm struct {
	// A JSON object containing the variables the process is to be initialized with.
	// Each key corresponds to a variable name and each value to a variable value
	Variables map[string]Variable `json:"variables"`
	// A JSON object containing the business key the process is to be initialized with.
	// The business key uniquely identifies the process instance in the context of the given process definition
	BusinessKey string `json:"businessKey"`
}

ReqSubmitStartForm request a SubmitStartForm

type ResActivityInstanceStatistics

type ResActivityInstanceStatistics struct {
	// The id of the activity the results are aggregated for
	Id string `json:"id"`
	// The total number of running instances of this activity
	Instances int `json:"instances"`
	// Number	The total number of failed jobs for the running instances.
	// Note: Will be 0 (not null), if failed jobs were excluded
	FailedJobs int `json:"failedJobs"`
	// Each item in the resulting array is an object which contains the following properties
	Incidents []ResActivityInstanceStatisticsIncident `json:"incidents"`
}

ResActivityInstanceStatistics a JSON array containing statistics results per activity

type ResActivityInstanceStatisticsIncident

type ResActivityInstanceStatisticsIncident struct {
	// The type of the incident the number of incidents is aggregated for.
	// See the User Guide for a list of incident types
	IncidentType string `json:"incidentType"`
	// The total number of incidents for the corresponding incident type
	IncidentCount int `json:"incidentCount"`
}

ResActivityInstanceStatisticsIncident a statistics incident

type ResBPMNProcessDefinition

type ResBPMNProcessDefinition struct {
	// The id of the process definition
	Id string `json:"id"`
	// An escaped XML string containing the XML that this definition was deployed with.
	// Carriage returns, line feeds and quotation marks are escaped
	Bpmn20Xml string `json:"bpmn20Xml"`
}

ResBPMNProcessDefinition a JSON object containing the id of the definition and the BPMN 2.0 XML

type ResBatch

type ResBatch struct {
	// The id of the created batch
	Id string `json:"id"`
	// The type of the created batch
	Type string `json:"type"`
	// The total jobs of a batch is the number of batch execution jobs required to complete the batch
	TotalJobs int `json:"totalJobs"`
	// The number of batch execution jobs created per seed job invocation. The batch seed job is invoked until
	// it has created all batch execution jobs required by the batch (see totalJobs property)
	BatchJobsPerSeed int `json:"batchJobsPerSeed"`
	// Every batch execution job invokes the command executed by the batch invocationsPerBatchJob times.
	// E.g., for a process instance migration batch this specifies the number of process instances which are
	// migrated per batch execution job
	InvocationsPerBatchJob int `json:"invocationsPerBatchJob"`
	// The job definition id for the seed jobs of this batch
	SeedJobDefinitionId string `json:"seedJobDefinitionId"`
	// The job definition id for the monitor jobs of this batch
	MonitorJobDefinitionId string `json:"monitorJobDefinitionId"`
	// The job definition id for the batch execution jobs of this batch
	BatchJobDefinitionId string `json:"batchJobDefinitionId"`
	// The tenant id of the batch
	TenantId string `json:"tenantId"`
}

ResBatch a JSON object corresponding to the Batch interface in the engine

type ResCaseDefinition

type ResCaseDefinition struct {
	// The id of the case definition
	Id string `json:"id"`
	// The key of the case definition, i.e., the id of the CMMN 2.0 XML case definition
	Key string `json:"key"`
	// The category of the case definition
	Category string `json:"category"`
	// The name of the case definition
	Name string `json:"name"`
	// The version of the case definition that the engine assigned to it
	Version int `json:"Version"`
	// The file name of the case definition
	Resource string `json:"resource"`
	// The deployment id of the case definition
	DeploymentId string `json:"deploymentId"`
	// The tenant id of the case definition
	TenantId string `json:"tenantId"`
	// History time to live value of the case definition. Is used within History cleanup
	HistoryTimeToLive int `json:"historyTimeToLive"`
}

ResCaseDefinition a JSON object corresponding to the CaseDefinition interface in the engine

type ResCount

type ResCount struct {
	Count int `json:"count"`
}

ResCount a count response

type ResDecisionDefinition

type ResDecisionDefinition struct {
	// The id of the decision definition
	Id string `json:"id"`
	// The key of the decision definition, i.e., the id of the DMN 1.0 XML decision definition
	Key string `json:"key"`
	// The category of the decision definition
	Category string `json:"category"`
	// The name of the decision definition
	Name string `json:"name"`
	// The version of the decision definition that the engine assigned to it
	Version int `json:"Version"`
	// The file name of the decision definition
	Resource string `json:"resource"`
	// The deployment id of the decision definition
	DeploymentId string `json:"deploymentId"`
	// The tenant id of the decision definition
	TenantId string `json:"tenantId"`
	// The id of the decision requirements definition this decision definition belongs to
	DecisionRequirementsDefinitionId string `json:"decisionRequirementsDefinitionId"`
	// The key of the decision requirements definition this decision definition belongs to
	DecisionRequirementsDefinitionKey string `json:"decisionRequirementsDefinitionKey"`
	// The version tag of the process definition
	VersionTag string `json:"versionTag"`
	// History time to live value of the decision definition. Is used within History cleanup
	HistoryTimeToLive int `json:"historyTimeToLive"`
}

ResDecisionDefinition a JSON object corresponding to the DecisionDefinition interface in the engine

type ResDecisionRequirementsDefinition

type ResDecisionRequirementsDefinition struct {
	// The id of the decision requirements definition
	Id string `json:"id"`
	// The key of the decision requirements definition, i.e., the id of the DMN 1.1 XML decision definition
	Key string `json:"key"`
	// The category of the decision requirements definition
	Category string `json:"category"`
	// The name of the decision requirements definition
	Name string `json:"name"`
	// The version of the decision requirements definition that the engine assigned to it
	Version int `json:"Version"`
	// The file name of the decision requirements definition
	Resource string `json:"resource"`
	// The deployment id of the decision requirements definition
	DeploymentId string `json:"deploymentId"`
	// The tenant id of the decision requirements definition
	TenantId string `json:"tenantId"`
}

ResDecisionRequirementsDefinition a JSON object corresponding to the DecisionRequirementsDefinition interface in the engine

type ResDeployment

type ResDeployment struct {
	// The id of the deployment
	Id string `json:"id"`
	// The name of the deployment
	Name string `json:"name"`
	// The source of the deployment
	Source string `json:"source"`
	// The tenant id of the deployment
	TenantId string `json:"tenantId"`
	// The date and time of the deployment.
	DeploymentTime Time `json:"deploymentTime"`
}

ResDeployment a JSON array of deployment objects

type ResDeploymentCreate

type ResDeploymentCreate struct {
	// The id of the deployment
	Id string `json:"id"`
	// The name of the deployment
	Name string `json:"name"`
	// The source of the deployment
	Source string `json:"source"`
	// The tenant id of the deployment
	TenantId string `json:"tenant_id"`
	// The time when the deployment was created
	DeploymentTime Time `json:"deployment_time"`
	// Link to the newly created deployment with method, href and rel
	Links []ResLink `json:"links"`
	// A JSON Object containing a property for each of the process definitions,
	// which are successfully deployed with that deployment
	DeployedProcessDefinitions map[string]ResProcessDefinition `json:"deployedProcessDefinitions"`
	// A JSON Object containing a property for each of the case definitions,
	// which are successfully deployed with that deployment
	DeployedCaseDefinitions map[string]ResCaseDefinition `json:"deployedCaseDefinitions"`
	// A JSON Object containing a property for each of the decision definitions,
	// which are successfully deployed with that deployment
	DeployedDecisionDefinitions map[string]ResDecisionDefinition `json:"deployedDecisionDefinitions"`
	// A JSON Object containing a property for each of the decision requirements definitions,
	// which are successfully deployed with that deployment
	DeployedDecisionRequirementsDefinitions map[string]ResDecisionRequirementsDefinition `json:"deployedDecisionRequirementsDefinitions"`
}

ResDeploymentCreate a JSON object corresponding to the DeploymentWithDefinitions interface in the engine

type ResDeploymentResource

type ResDeploymentResource struct {
	// The id of the deployment resource
	Id string `json:"id"`
	// The name of the deployment resource
	Name string `json:"name"`
	// The id of the deployment
	DeploymentId string `json:"deploymentId"`
}

ResDeploymentResource a JSON array containing all deployment resources of the given deployment

type ResExternalTask

type ResExternalTask struct {
	// The id of the activity that this external task belongs to
	ActivityId string `json:"activityId"`
	// The id of the activity instance that the external task belongs to
	ActivityInstanceId string `json:"activityInstanceId"`
	// The full error message submitted with the latest reported failure executing this task;
	// null if no failure was reported previously or if no error message was submitted
	ErrorMessage string `json:"errorMessage"`
	// The error details submitted with the latest reported failure executing this task.
	// null if no failure was reported previously or if no error details was submitted
	ErrorDetails string `json:"errorDetails"`
	// The id of the execution that the external task belongs to
	ExecutionId string `json:"executionId"`
	// The id of the external task
	Id string `json:"id"`
	// The date that the task's most recent lock expires or has expired
	LockExpirationTime string `json:"lockExpirationTime"`
	// The id of the process definition the external task is defined in
	ProcessDefinitionId string `json:"processDefinitionId"`
	// The key of the process definition the external task is defined in
	ProcessDefinitionKey string `json:"processDefinitionKey"`
	// The id of the process instance the external task belongs to
	ProcessInstanceId string `json:"processInstanceId"`
	// The id of the tenant the external task belongs to
	TenantId string `json:"tenantId"`
	// The number of retries the task currently has left
	Retries int `json:"retries"`
	// A flag indicating whether the external task is suspended or not
	Suspended bool `json:"suspended"`
	// The id of the worker that possesses or possessed the most recent lock
	WorkerId string `json:"workerId"`
	// The priority of the external task
	Priority int `json:"priority"`
	// The topic name of the external task
	TopicName string `json:"topicName"`
	// The business key of the process instance the external task belongs to
	BusinessKey string `json:"businessKey"`
}

ResExternalTask a ExternalTask response

type ResGetStartFormKey

type ResGetStartFormKey struct {
	// The form key for the process definition
	Key string `json:"key"`
	// The context path of the process application
	ContextPath string `json:"contextPath"`
}

ResGetStartFormKey a response from GetStartFormKey method

type ResInstanceStatistics

type ResInstanceStatistics struct {
	// The id of the activity the results are aggregated for
	Id string `json:"id"`
	// The total number of running instances of this activity
	Instances int `json:"instances"`
	// Number	The total number of failed jobs for the running instances.
	// Note: Will be 0 (not null), if failed jobs were excluded
	FailedJobs int `json:"failedJobs"`
	// The process definition with the properties as described in the get single definition method
	Definition ResProcessDefinition `json:"definition"`
	// Each item in the resulting array is an object which contains the following properties
	Incidents []ResActivityInstanceStatisticsIncident `json:"incidents"`
}

ResInstanceStatistics a JSON array containing statistics results per process definition

type ResLink struct {
	Method string `json:"method"`
	Href   string `json:"href"`
	Rel    string `json:"rel"`
}

ResLink a link struct

type ResLockedExternalTask

type ResLockedExternalTask struct {
	// The id of the activity that this external task belongs to
	ActivityId string `json:"activityId"`
	// The id of the activity instance that the external task belongs to
	ActivityInstanceId string `json:"activityInstanceId"`
	// The full error message submitted with the latest reported failure executing this task;
	// null if no failure was reported previously or if no error message was submitted
	ErrorMessage string `json:"errorMessage"`
	// The error details submitted with the latest reported failure executing this task.
	// null if no failure was reported previously or if no error details was submitted
	ErrorDetails string `json:"errorDetails"`
	// The id of the execution that the external task belongs to
	ExecutionId string `json:"executionId"`
	// The id of the external task
	Id string `json:"id"`
	// The date that the task's most recent lock expires or has expired
	LockExpirationTime string `json:"lockExpirationTime"`
	// The id of the process definition the external task is defined in
	ProcessDefinitionId string `json:"processDefinitionId"`
	// The key of the process definition the external task is defined in
	ProcessDefinitionKey string `json:"processDefinitionKey"`
	// The id of the process instance the external task belongs to
	ProcessInstanceId string `json:"processInstanceId"`
	// The id of the tenant the external task belongs to
	TenantId string `json:"tenantId"`
	// The number of retries the task currently has left
	Retries int `json:"retries"`
	// The id of the worker that possesses or possessed the most recent lock
	WorkerId string `json:"workerId"`
	// The priority of the external task
	Priority int `json:"priority"`
	// The topic name of the external task
	TopicName string `json:"topicName"`
	// The business key of the process instance the external task belongs to
	BusinessKey string `json:"businessKey"`
	// A JSON object containing a property for each of the requested variables
	Variables map[string]Variable `json:"variables"`
}

ResLockedExternalTask a response FetchAndLock method

type ResProcessDefinition

type ResProcessDefinition struct {
	// The id of the process definition
	Id string `json:"id"`
	// The key of the process definition, i.e., the id of the BPMN 2.0 XML process definition
	Key string `json:"key"`
	// The category of the process definition
	Category string `json:"category"`
	// The description of the process definition
	Description string `json:"description"`
	// The name of the process definition
	Name string `json:"name"`
	// The version of the process definition that the engine assigned to it
	Version int `json:"Version"`
	// The file name of the process definition
	Resource string `json:"resource"`
	// The deployment id of the process definition
	DeploymentId string `json:"deploymentId"`
	// The file name of the process definition diagram, if it exists
	Diagram string `json:"diagram"`
	// A flag indicating whether the definition is suspended or not
	Suspended bool `json:"suspended"`
	// The tenant id of the process definition
	TenantId string `json:"tenantId"`
	// The version tag of the process definition
	VersionTag string `json:"versionTag"`
	// History time to live value of the process definition. Is used within History cleanup
	HistoryTimeToLive int `json:"historyTimeToLive"`
	// A flag indicating whether the process definition is startable in Tasklist or not
	StartableInTasklist bool `json:"startableInTasklist"`
}

ResProcessDefinition a JSON object corresponding to the ProcessDefinition interface in the engine

type ResStartedProcessDefinition

type ResStartedProcessDefinition struct {
	// The id of the process definition
	Id string `json:"id"`
	// The id of the process definition
	DefinitionId string `json:"definitionId"`
	// The business key of the process instance
	BusinessKey string `json:"businessKey"`
	// The case instance id of the process instance
	CaseInstanceId string `json:"caseInstanceId"`
	// The tenant id of the process instance
	TenantId string `json:"tenantId"`
	// A flag indicating whether the instance is still running or not
	Ended bool `json:"ended"`
	// A flag indicating whether the instance is suspended or not
	Suspended bool `json:"suspended"`
	// A JSON array containing links to interact with the instance
	Links []ResLink `json:"links"`
	// A JSON object containing a property for each of the latest variables
	Variables map[string]Variable `json:"variables"`
}

ResStartedProcessDefinition ProcessDefinition for started

type ResSubmitStartForm

type ResSubmitStartForm struct {
	Links        []ResLink `json:"links"`
	Id           string    `json:"id"`
	DefinitionId string    `json:"definitionId"`
	BusinessKey  string    `json:"businessKey"`
	Ended        bool      `json:"ended"`
	Suspended    bool      `json:"suspended"`
}

ReqSubmitStartForm response rrom SubmitStartForm method

type Time

type Time struct {
	time.Time
}

Time a custom time format

func (*Time) MarshalJSON

func (t *Time) MarshalJSON() ([]byte, error)

MarshalJSON

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON

type UserTask added in v1.1.0

type UserTask struct {
	*UserTaskResponse
	// contains filtered or unexported fields
}

UserTask camunda user task

func (*UserTask) Complete added in v1.1.0

func (t *UserTask) Complete(query QueryUserTaskComplete) error

Complete complete user task

type UserTaskGetListQuery added in v1.1.0

type UserTaskGetListQuery struct {
	// Restrict to tasks that belong to process instances with the given id.
	ProcessInstanceId string `json:"processInstanceId,omitempty"`
	// Restrict to tasks that belong to process instances with the given business key.
	ProcessInstanceBusinessKey string `json:"processInstanceBusinessKey,omitempty"`
	// Restrict to tasks that belong to process instances with one of the give business keys. The keys need to be in a comma-separated list.
	ProcessInstanceBusinessKeyIn []string `json:"processInstanceBusinessKeyIn,omitempty"`
	// Restrict to tasks that have a process instance business key that has the parameter value as a substring.
	ProcessInstanceBusinessKeyLike string `json:"processInstanceBusinessKeyLike,omitempty"`
	// Restrict to tasks that belong to a process definition with the given id.
	ProcessDefinitionId string `json:"processDefinitionId,omitempty"`
	// Restrict to tasks that belong to a process definition with the given key.
	ProcessDefinitionKey string `json:"processDefinitionKey,omitempty"`
	// Restrict to tasks that belong to a process definition with one of the given keys. The keys need to be in a comma-separated list.
	ProcessDefinitionKeyIn []string `json:"processDefinitionKeyIn,omitempty"`
	// Restrict to tasks that belong to a process definition with the given name.
	ProcessDefinitionName string `json:"processDefinitionName,omitempty"`
	// Restrict to tasks that have a process definition name that has the parameter value as a substring.
	ProcessDefinitionNameLike string `json:"processDefinitionNameLike,omitempty"`
	// Restrict to tasks that belong to an execution with the given id.
	ExecutionId string `json:"executionId,omitempty"`
	// Restrict to tasks that belong to case instances with the given id.
	CaseInstanceId string `json:"caseInstanceId,omitempty"`
	// Restrict to tasks that belong to case instances with the given business key.
	CaseInstanceBusinessKey string `json:"caseInstanceBusinessKey,omitempty"`
	// Restrict to tasks that have a case instance business key that has the parameter value as a substring.
	CaseInstanceBusinessKeyLike string `json:"caseInstanceBusinessKeyLike,omitempty"`
	// Restrict to tasks that belong to a case definition with the given id.
	CaseDefinitionId string `json:"caseDefinitionId,omitempty"`
	// Restrict to tasks that belong to a case definition with the given key.
	CaseDefinitionKey string `json:"caseDefinitionKey,omitempty"`
	// Restrict to tasks that belong to a case definition with the given name.
	CaseDefinitionName string `json:"caseDefinitionName,omitempty"`
	// Restrict to tasks that have a case definition name that has the parameter value as a substring.
	CaseDefinitionNameLike string `json:"caseDefinitionNameLike,omitempty"`
	// Restrict to tasks that belong to a case execution with the given id.
	CaseExecutionId string `json:"caseExecutionId,omitempty"`
	// Only include tasks which belong to one of the passed and comma-separated activity instance ids.
	ActivityInstanceIdIn []string `json:"activityInstanceIdIn,omitempty"`
	// Only include tasks which belong to one of the passed and comma-separated tenant ids.
	TenantIdIn []string `json:"tenantIdIn,omitempty"`
	// Only include tasks which belong to no tenant. Value may only be true, as false is the default behavior.
	WithoutTenantId string `json:"withoutTenantId,omitempty"`
	// Restrict to tasks that the given user is assigned to.
	Assignee string `json:"assignee,omitempty"`
	// Restrict to tasks that the user described by the given expression is assigned to. See the user guide for more information on available functions.
	AssigneeExpression string `json:"assigneeExpression,omitempty"`
	// Restrict to tasks that have an assignee that has the parameter value as a substring.
	AssigneeLike string `json:"assigneeLike,omitempty"`
	// Restrict to tasks that have an assignee that has the parameter value described by the given expression as a substring. See the user guide for more information on available functions.
	AssigneeLikeExpression string `json:"assigneeLikeExpression,omitempty"`
	// Restrict to tasks that the given user owns.
	Owner string `json:"owner,omitempty"`
	// Restrict to tasks that the user described by the given expression owns. See the user guide for more information on available functions.
	OwnerExpression string `json:"ownerExpression,omitempty"`
	// Only include tasks that are offered to the given group.
	CandidateGroup string `json:"candidateGroup,omitempty"`
	// Only include tasks that are offered to the group described by the given expression. See the user guide for more information on available functions.
	CandidateGroupExpression string `json:"candidateGroupExpression,omitempty"`
	// Only include tasks that are offered to the given user or to one of his groups.
	CandidateUser string `json:"candidateUser,omitempty"`
	// Only include tasks that are offered to the user described by the given expression. See the user guide for more information on available functions.
	CandidateUserExpression string `json:"candidateUserExpression,omitempty"`
	// Also include tasks that are assigned to users in candidate queries. Default is to only include tasks that are not assigned to any user if you query by candidate user or group(s).
	IncludeAssignedTasks bool `json:"includeAssignedTasks,omitempty"`
	// Only include tasks that the given user is involved in. A user is involved in a task if an identity link exists between task and user (e.g., the user is the assignee).
	InvolvedUser string `json:"involvedUser,omitempty"`
	// Only include tasks that the user described by the given expression is involved in. A user is involved in a task if an identity link exists between task and user (e.g., the user is the assignee). See the user guide for more information on available functions.
	InvolvedUserExpression string `json:"involvedUserExpression,omitempty"`
	// If set to true, restricts the query to all tasks that are assigned.
	Assigned bool `json:"assigned,omitempty"`
	// If set to true, restricts the query to all tasks that are unassigned.
	Unassigned bool `json:"unassigned,omitempty"`
	// Restrict to tasks that have the given key.
	TaskDefinitionKey string `json:"taskDefinitionKey,omitempty"`
	// Restrict to tasks that have one of the given keys. The keys need to be in a comma-separated list.
	TaskDefinitionKeyIn []string `json:"taskDefinitionKeyIn,omitempty"`
	// Restrict to tasks that have a key that has the parameter value as a substring.
	TaskDefinitionKeyLike string `json:"taskDefinitionKeyLike,omitempty"`
	// Restrict to tasks that have the given name.
	Name string `json:"name,omitempty"`
	// Restrict to tasks that do not have the given name.
	NameNotEqual string `json:"nameNotEqual,omitempty"`
	// Restrict to tasks that have a name with the given parameter value as substring.
	NameLike string `json:"nameLike,omitempty"`
	// Restrict to tasks that do not have a name with the given parameter value as substring.
	NameNotLike string `json:"nameNotLike,omitempty"`
	// Restrict to tasks that have the given description.
	Description string `json:"description,omitempty"`
	// Restrict to tasks that have a description that has the parameter value as a substring.
	DescriptionLike string `json:"descriptionLike,omitempty"`
	// Restrict to tasks that have the given priority.
	Priority int64 `json:"priority,omitempty"`
	// Restrict to tasks that have a lower or equal priority.
	MaxPriority int64 `json:"maxPriority,omitempty"`
	// Restrict to tasks that have a higher or equal priority.
	MinPriority int64 `json:"minPriority,omitempty"`
	// Restrict to tasks that are due on the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45.
	DueDate time.Time `json:"dueDate"`
	// Restrict to tasks that are due on the date described by the given expression. See the user guide for more information on available functions. The expression must evaluate to a java.util.Date or org.joda.time.DateTime object.
	DueDateExpression time.Time `json:"dueDateExpression,omitempty"`
	// Restrict to tasks that are due after the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45.
	DueAfter time.Time `json:"dueAfter,omitempty"`
	// Restrict to tasks that are due after the date described by the given expression. See the user guide for more information on available functions. The expression must evaluate to a java.util.Date or org.joda.time.DateTime object.
	DueAfterExpression string `json:"dueAfterExpression,omitempty"`
	// Restrict to tasks that are due before the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45.
	DueBefore time.Time `json:"dueBefore,omitempty"`
	// Restrict to tasks that are due before the date described by the given expression. See the user guide for more information on available functions. The expression must evaluate to a java.util.Date or org.joda.time.DateTime object.
	DueBeforeExpression string `json:"dueBeforeExpression,omitempty"`
	// Restrict to tasks that have a followUp date on the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45.
	FollowUpDate time.Time `json:"followUpDate,omitempty"`
	// Restrict to tasks that have a followUp date on the date described by the given expression. See the user guide for more information on available functions. The expression must evaluate to a java.util.Date or org.joda.time.DateTime object.
	FollowUpDateExpression string `json:"followUpDateExpression,omitempty"`
	// Restrict to tasks that have a followUp date after the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45.
	FollowUpAfter time.Time `json:"followUpAfter,omitempty"`
	// Restrict to tasks that have a followUp date after the date described by the given expression. See the user guide for more information on available functions. The expression must evaluate to a java.util.Date or org.joda.time.DateTime object.
	FollowUpAfterExpression string `json:"followUpAfterExpression,omitempty"`
	// Restrict to tasks that have a followUp date before the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45.
	FollowUpBefore time.Time `json:"followUpBefore,omitempty"`
	// Restrict to tasks that have a followUp date before the date described by the given expression. See the user guide for more information on available functions. The expression must evaluate to a java.util.Date or org.joda.time.DateTime object.
	FollowUpBeforeExpression string `json:"followUpBeforeExpression,omitempty"`
	// Restrict to tasks that have no followUp date or a followUp date before the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45. The typical use case is to query all "active" tasks for a user for a given date.
	FollowUpBeforeOrNotExistent time.Time `json:"followUpBeforeOrNotExistent,omitempty"`
	// Restrict to tasks that have no followUp date or a followUp date before the date described by the given expression. See the user guide for more information on available functions. The expression must evaluate to a java.util.Date or org.joda.time.DateTime object.
	FollowUpBeforeOrNotExistentExpression string `json:"followUpBeforeOrNotExistentExpression,omitempty"`
	// Restrict to tasks that were created on the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45. Note: if the used database saves dates with milliseconds precision this query only will return tasks created on the given timestamp with zero milliseconds.
	CreatedOn time.Time `json:"createdOn,omitempty"`
	// Restrict to tasks that were created on the date described by the given expression. See the user guide for more information on available functions. The expression must evaluate to a java.util.Date or org.joda.time.DateTime object.
	CreatedOnExpression string `json:"createdOnExpression,omitempty"`
	// Restrict to tasks that were created after the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45.
	CreatedAfter time.Time `json:"createdAfter,omitempty"`
	// Restrict to tasks that were created after the date described by the given expression. See the user guide for more information on available functions. The expression must evaluate to a java.util.Date or org.joda.time.DateTime object.
	CreatedAfterExpression string `json:"createdAfterExpression,omitempty"`
	// Restrict to tasks that were created before the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45.
	CreatedBefore time.Time `json:"createdBefore,omitempty"`
	// Restrict to tasks that were created before the date described by the given expression. See the user guide for more information on available functions. The expression must evaluate to a java.util.Date or org.joda.time.DateTime object.
	CreatedBeforeExpression string `json:"createdBeforeExpression,omitempty"`
	// Restrict to tasks that are in the given delegation state. Valid values are PENDING and RESOLVED.
	DelegationState delegationState `json:"delegationState,omitempty"`
	// Restrict to tasks that are offered to any of the given candidate groups.Takes a comma-separated list of group names, so for example developers, support, sales.
	CandidateGroups []string `json:"candidateGroups,omitempty"`
	// Restrict to tasks that are offered to any of the candidate groups described by the given expression.See the user guide for more information on available functions.The expression must evaluate to java.util.List of Strings.
	CandidateGroupsExpression []string `json:"candidateGroupsExpression,omitempty"`
	// Only include tasks which have a candidate group.Value may only be true, as false is the default behavior.
	WithCandidateGroups bool `json:"withCandidateGroups,omitempty"`
	// Only include tasks which have no candidate group.Value may only be true, as false is the default behavior.
	WithoutCandidateGroups bool `json:"withoutCandidateGroups,omitempty"`
	// Only include tasks which have a candidate user.Value may only be true, as false is the default behavior.
	WithCandidateUsers bool `json:"withCandidateUsers,omitempty"`
	// Only include tasks which have no candidate users.Value may only be true, as false is the default behavior.
	WithoutCandidateUsers bool `json:"withoutCandidateUsers,omitempty"`
	// Only include active tasks.Value may only be true, as false is the default behavior.
	Active bool `json:"active,omitempty"`
	// Only include suspended tasks.Value may only be true, as false is the default behavior.
	Suspended bool `json:"suspended,omitempty"`
	// Only include tasks that have variables with certain values.Variable filtering expressions are comma-separated and are structured as follows:
	// A valid parameter value has the form key_operator_value.key is the variable name, operator is the comparison operator to be used and value the variable value.
	// Note: Values are always treated as String objects on server side.
	//
	// Valid operator values are: eq - equal to;
	// neq - not equal to;
	// gt - greater than;
	// gteq - greater than or equal to;
	// lt - lower than;
	// lteq - lower than or equal to;
	// like.
	// key and value may not contain underscore or comma characters.
	TaskVariables []VariableFilterExpression `json:"taskVariables,omitempty"`
	// Only include tasks that belong to process instances that have variables with certain values.Variable filtering expressions are comma-separated and are structured as follows:
	// A valid parameter value has the form key_operator_value.key is the variable name, operator is the comparison operator to be used and value the variable value.
	// Note: Values are always treated as String objects on server side.
	//
	// Valid operator values are: eq - equal to;
	// neq - not equal to;
	// gt - greater than;
	// gteq - greater than or equal to;
	// lt - lower than;
	// lteq - lower than or equal to;
	// like.
	// key and value may not contain underscore or comma characters.
	ProcessVariables []VariableFilterExpression `json:"processVariables,omitempty"`
	// Only include tasks that belong to case instances that have variables with certain values.Variable filtering expressions are comma-separated and are structured as follows:
	// A valid parameter value has the form key_operator_value.key is the variable name, operator is the comparison operator to be used and value the variable value.
	// Note: Values are always treated as String objects on server side.
	//
	// Valid operator values are: eq - equal to;
	// neq - not equal to;
	// gt - greater than;
	// gteq - greater than or equal to;
	// lt - lower than;
	// lteq - lower than or equal to;
	// like.
	// key and value may not contain underscore or comma characters.
	CaseInstanceVariables []VariableFilterExpression `json:"caseInstanceVariables,omitempty"`
	// Restrict query to all tasks that are sub tasks of the given task.Takes a task id.
	ParentTaskId string `json:"parentTaskId,omitempty"`
	// Sort the results lexicographically by a given criterion.Valid values are instanceId, caseInstanceId, dueDate, executionId, caseExecutionId, assignee, created, description, id, name, nameCaseInsensitive and priority.Must be used in conjunction with the sortOrder parameter.
	SortBy string `json:"sortBy,omitempty"`
	// Sort the results in a given order.Values may be asc for ascending order or desc for descending order.Must be used in conjunction with the sortBy parameter.
	SortOrder string `json:"sortOrder,omitempty"`
	// Pagination of results.Specifies the index of the first result to return.
	FirstResult int64 `json:"firstResult,omitempty"`
	// Pagination of results.Specifies the maximum number of results to return.Will return less results if there are no more results left.
	MaxResults int64 `json:"maxResults,omitempty"`
}

UserTaskGetListQuery query for GetList,

func (*UserTaskGetListQuery) MarshalJSON added in v1.1.0

func (q *UserTaskGetListQuery) MarshalJSON() ([]byte, error)

MarshalJSON marshal to json

type UserTaskResponse added in v1.1.0

type UserTaskResponse struct {
	// The id of the task.
	Id string `json:"id"`
	// The tasks name.
	Name string `json:"name"`
	// The user assigned to this task.
	Assignee string `json:"assignee"`
	// The time the task was created.Format yyyy-MM-dd'T'HH:mm:ss.
	Created string `json:"created"`
	// The due date for the task.Format yyyy-MM-dd'T'HH:mm:ss.
	Due string `json:"due"`
	// The follow-up date for the task.Format yyyy-MM-dd'T'HH:mm:ss.
	FollowUp string `json:"followUp"`
	// The delegation state of the task.Corresponds to the DelegationState enum in the engine.Possible values are RESOLVED and PENDING.
	DelegationState string `json:"delegationState"`
	// The task description.
	Description string `json:"description"`
	// The id of the execution the task belongs to.
	ExecutionId string `json:"executionId"`
	// The owner of the task.
	Owner string `json:"owner"`
	// The id of the parent task, if this task is a subtask.
	ParentTaskId string `json:"parentTaskId"`
	// The priority of the task.
	Priority int64 `json:"priority"`
	// The id of the process definition this task belongs to.
	ProcessDefinitionId string `json:"processDefinitionId"`
	// The id of the process instance this task belongs to.
	ProcessInstanceId string `json:"processInstanceId"`
	// The id of the case execution the task belongs to.
	CaseExecutionId string `json:"caseExecutionId"`
	// The id of the case definition the task belongs to.
	CaseDefinitionId string `json:"caseDefinitionId"`
	// The id of the case instance the task belongs to.
	CaseInstanceId string `json:"caseInstanceId"`
	// The task definition key.
	TaskDefinitionKey string `json:"taskDefinitionKey"`
	// Whether the task belongs to a process instance that is suspended.
	Suspended bool `json:"suspended"`
	// If not null, the form key for the task.
	FormKey *string `json:"formKey"`
	// If not null, the tenantId for the task.
	TenantId *string `json:"tenantId"`
}

UserTaskResponse get task response

type ValueInfo

type ValueInfo struct {
	// A string representation of the object's type name
	ObjectTypeName *string `json:"objectTypeName"`
	// The serialization format used to store the variable.
	SerializationDataFormat *string `json:"serializationDataFormat"`
}

ValueInfo a value info in variable

type Variable

type Variable struct {
	// The variable's value
	Value interface{} `json:"value"`
	// The value type of the variable.
	Type string `json:"type"`
	// A JSON object containing additional, value-type-dependent properties
	ValueInfo ValueInfo `json:"valueInfo"`
}

Variable a variable

type VariableFilterExpression added in v1.1.0

type VariableFilterExpression struct {
	Name     string                           `json:"name"`
	Operator variableFilterExpressionOperator `json:"operator"`
	Value    string                           `json:"value"`
}

VariableFilterExpression filter expression

type VariableSet

type VariableSet struct {
	// The variable's value
	Value string `json:"value"`
	// The value type of the variable.
	Type string `json:"type"`
	// A JSON object containing additional, value-type-dependent properties
	ValueInfo ValueInfo `json:"valueInfo"`
	// Indicates whether the variable should be a local variable or not. If set to true, the variable becomes a local
	// variable of the execution entering the target activity
	Local bool `json:"local"`
}

VariableSet a variable for set

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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