API decision - RapturePlatform/Rapture GitHub Wiki

Decision API

The Decision Process api is used to manage and control decision processes and decision packets.

getAllWorkflows

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
List<Workflow> retVal = decisionApi.getAllWorkflows();
retVal = baseAPI.doDecision_GetAllWorkflows();

Entitlement: /decision/read

Returns all workflow definitions

Function Parameters

This function takes no parameters.

Return value

Type Description
List

getWorkflowChildren

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
List<RaptureFolderInfo> retVal = decisionApi.getWorkflowChildren(workflowURI);
retVal = baseAPI.doDecision_GetWorkflowChildren(workflowURI);

Entitlement: /decision/read

Returns a list of full display names of the paths below this one. Ideally optimized depending on the repo.

Function Parameters

Parameter Type Description
workflowURI String

Return value

Type Description
List

getWorkOrderChildren

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
List<RaptureFolderInfo> retVal = decisionApi.getWorkOrderChildren(parentPath);
retVal = baseAPI.doDecision_GetWorkOrderChildren(parentPath);

Entitlement: /decision/read

Return a list of full display names of the paths below this one. Ideally optimized depending on the repo.

Function Parameters

Parameter Type Description
parentPath String

Return value

Type Description
List

putWorkflow

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.putWorkflow(workflow);
retVal = baseAPI.doDecision_PutWorkflow(workflow);

Entitlement: /decision/write

Create or update a workflow to contain only the specified nodes and transitions.

Function Parameters

Parameter Type Description
workflow Workflow

Return value

Type Description
void
Types used in this function

Workflow

Defines a workflow. Each workflow is a flowchart of WorkflowSteps and Transitions.

Field Type
workflowURI WorkflowURI
semaphoreType SemaphoreType
semaphoreConfig String
steps List
startStep String
category String
view Map<String, String>
expectedArguments List
defaultAppStatusNamePattern String

getWorkflow

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
Workflow retVal = decisionApi.getWorkflow(workflowURI);
retVal = baseAPI.doDecision_GetWorkflow(workflowURI);

Entitlement: /decision/read/$f(workflowURI)

Returns a workflow definition, or null if not found.

Function Parameters

Parameter Type Description
workflowURI String

Return value

Type Description
Workflow
Types used in this function

Workflow

Defines a workflow. Each workflow is a flowchart of WorkflowSteps and Transitions.

Field Type
workflowURI WorkflowURI
semaphoreType SemaphoreType
semaphoreConfig String
steps List
startStep String
category String
view Map<String, String>
expectedArguments List
defaultAppStatusNamePattern String

getWorkflowStep

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
Step retVal = decisionApi.getWorkflowStep(stepURI);
retVal = baseAPI.doDecision_GetWorkflowStep(stepURI);

Entitlement: /decision/read/$f(stepURI)

Returns a step definition, or null if not found

Function Parameters

Parameter Type Description
stepURI String

Return value

Type Description
Step
Types used in this function

Step

An executable step with config data.

Field Type
name String
description String
executable String
view Map<String,String>
transitions List
categoryOverride String
softTimeout Integer

getStepCategory

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
String retVal = decisionApi.getStepCategory(stepURI);
retVal = baseAPI.doDecision_GetStepCategory(stepURI);

Entitlement: /decision/read/$f(stepURI)

Gets the category associated with a step. This is the step's own categoryOverride, if present, or otherwise the category associated with the entire workflow.

Function Parameters

Parameter Type Description
stepURI String

Return value

Type Description
String

addStep

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.addStep(workflowURI, step);
retVal = baseAPI.doDecision_AddStep(workflowURI, step);

Entitlement: /decision/write/$f(workflowURI)

Adds a new step to an existing workflow initially containing the specified transitions

Function Parameters

Parameter Type Description
workflowURI String
step Step

Return value

Type Description
void
Types used in this function

Step

An executable step with config data.

Field Type
name String
description String
executable String
view Map<String,String>
transitions List
categoryOverride String
softTimeout Integer

removeStep

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.removeStep(workflowURI, stepName);
retVal = baseAPI.doDecision_RemoveStep(workflowURI, stepName);

Entitlement: /decision/write/$f(workflowURI)

Removes a step from a workflow.

Function Parameters

Parameter Type Description
workflowURI String
stepName String

Return value

Type Description
void

addTransition

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.addTransition(workflowURI, stepName, transition);
retVal = baseAPI.doDecision_AddTransition(workflowURI, stepName, transition);

Entitlement: /decision/write/$f(workflowURI)

Adds a new Transition to a workflow.

Function Parameters

Parameter Type Description
workflowURI String
stepName String
transition Transition

Return value

Type Description
void
Types used in this function

Transition

Points to the next step in a given sequence.

Field Type
name String
targetStep String

removeTransition

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.removeTransition(workflowURI, stepName, transitionName);
retVal = baseAPI.doDecision_RemoveTransition(workflowURI, stepName, transitionName);

Entitlement: /decision/write/$f(workflowURI)

Removes a transition from a workflow.

Function Parameters

Parameter Type Description
workflowURI String
stepName String
transitionName String

Return value

Type Description
void

deleteWorkflow

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.deleteWorkflow(workflowURI);
retVal = baseAPI.doDecision_DeleteWorkflow(workflowURI);

Entitlement: /decision/write/$f(workflowURI)

Deletes a workflow.

Function Parameters

Parameter Type Description
workflowURI String

Return value

Type Description
void

putWorkflowStepTemplate

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.putWorkflowStepTemplate(template);
retVal = baseAPI.doDecision_PutWorkflowStepTemplate(template);

Entitlement: /decision/write

Creates a workflow step template

Function Parameters

Parameter Type Description
template WorkflowStepTemplate

Return value

Type Description
void
Types used in this function

WorkflowStepTemplate

A workflow step template

Field Type
workflowStepTemplateURI WorkflowStepTemplateURI
description String
executable String
inputVariables List
outputVariables List
outputTransitionNames List

getWorkflowStepTemplate

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
WorkflowStepTemplate retVal = decisionApi.getWorkflowStepTemplate(workflowStepTemplateURI);
retVal = baseAPI.doDecision_GetWorkflowStepTemplate(workflowStepTemplateURI);

Entitlement: /decision/read/$f(workflowStepTemplateURI)

Retrieve a workflow step template

Function Parameters

Parameter Type Description
workflowStepTemplateURI String

Return value

Type Description
WorkflowStepTemplate
Types used in this function

WorkflowStepTemplate

A workflow step template

Field Type
workflowStepTemplateURI WorkflowStepTemplateURI
description String
executable String
inputVariables List
outputVariables List
outputTransitionNames List

deleteWorkflowStepTemplate

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.deleteWorkflowStepTemplate(workflowStepTemplateURI);
retVal = baseAPI.doDecision_DeleteWorkflowStepTemplate(workflowStepTemplateURI);

Entitlement: /decision/write/$f(workflowStepTemplateURI)

Deletes a workflow step template

Function Parameters

Parameter Type Description
workflowStepTemplateURI String

Return value

Type Description
void

getWorflowStepTemplateChildren

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
List<RaptureFolderInfo> retVal = decisionApi.getWorflowStepTemplateChildren(parentPath);
retVal = baseAPI.doDecision_GetWorflowStepTemplateChildren(parentPath);

Entitlement: /decision/read

Return a list of full display names of the paths below this one. Ideally optimized depending on the repo.

Function Parameters

Parameter Type Description
parentPath String

Return value

Type Description
List

createWorkOrder

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
String retVal = decisionApi.createWorkOrder(workflowURI, argsMap);
retVal = baseAPI.doDecision_CreateWorkOrder(workflowURI, argsMap);

Entitlement: /decision/execute/$f(workflowURI)

Creates and executes a workflow. If there is a defaultAppStatusUriPattern set for this Workflow then it will be used for the appstatus URI.Otherwise, no appstatus will be created.TODO make workOrderURI format align with permission checks.

Function Parameters

Parameter Type Description
workflowURI String
argsMap Map<String,String>

Return value

Type Description
String

createWorkOrderP

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
CreateResponse retVal = decisionApi.createWorkOrderP(workflowURI, argsMap, appStatusUriPattern);
retVal = baseAPI.doDecision_CreateWorkOrderP(workflowURI, argsMap, appStatusUriPattern);

Entitlement: /decision/execute/$f(workflowURI)

Creates and executes a workflow. Same as createWorkOrder, but the appStatusUriPattern is passed as an explicit argument instead of using the default appStatusUriPattern (if one has been set).Note that the app status allows the Workflow and its output to be accessed via the web interface; workflows without an app status are not accessible in this way.

Function Parameters

Parameter Type Description
workflowURI String
argsMap Map<String,String>
appStatusUriPattern String

Return value

Type Description
CreateResponse
Types used in this function

CreateResponse

An object returned by public API calls that create things. If the object was created, the URI is returned. Otherwise, the message contains the reason the object was not created.

Field Type
isCreated Boolean
uri RaptureURI
message String

releaseWorkOrderLock

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.releaseWorkOrderLock(workOrderURI);
retVal = baseAPI.doDecision_ReleaseWorkOrderLock(workOrderURI);

Entitlement: /decision/admin

Releases the lock associated with this WorkOrder. This method should only be used by admins, in case therewas an unexpected problem that caused a WorkOrder to finish or die without releasing the lock.

Function Parameters

Parameter Type Description
workOrderURI String

Return value

Type Description
void

getWorkOrderStatus

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
WorkOrderStatus retVal = decisionApi.getWorkOrderStatus(workOrderURI);
retVal = baseAPI.doDecision_GetWorkOrderStatus(workOrderURI);

Entitlement: /decision/read/$f(workOrderURI)

Gets the status of a workOrder

Function Parameters

Parameter Type Description
workOrderURI String

Return value

Type Description
WorkOrderStatus
Types used in this function

WorkOrderStatus

The status of a work order.

Field Type
workerIds List
status WorkOrderExecutionState

writeWorkflowAuditEntry

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.writeWorkflowAuditEntry(workOrderURI, message, error);
retVal = baseAPI.doDecision_WriteWorkflowAuditEntry(workOrderURI, message, error);

Entitlement: /decision/write/$f(workOrderURI)

Writes an audit entry related to a workOrder. Messages may be INFO or ERROR based on the boolean fourth parameter

Function Parameters

Parameter Type Description
workOrderURI String
message String
error boolean

Return value

Type Description
void

getWorkOrdersByDay

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
List<WorkOrder> retVal = decisionApi.getWorkOrdersByDay(startTimeInstant);
retVal = baseAPI.doDecision_GetWorkOrdersByDay(startTimeInstant);

Entitlement: /decision/read

Gets the WorkOrder objects starting on a given day. Orders that carried over from the previous day are not included.

Function Parameters

Parameter Type Description
startTimeInstant Long

Return value

Type Description
List

getWorkOrder

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
WorkOrder retVal = decisionApi.getWorkOrder(workOrderURI);
retVal = baseAPI.doDecision_GetWorkOrder(workOrderURI);

Entitlement: /decision/read/$f(workOrderURI)

Gets the top-level status object associated with the work order

Function Parameters

Parameter Type Description
workOrderURI String

Return value

Type Description
WorkOrder
Types used in this function

WorkOrder

Each time a Workflow is executed, the execution is identified by a matching WorkOrder. A WorkOrderURI may be qualified with an id (index) of a particular Worker, e.g. workorder://myProj/myFlow#0

Field Type
workOrderURI WorkOrderURI
workflowURI WorkflowURI
workerIds List
pendingIds List
priority Integer
startTime Long
endTime Long
semaphoreType SemaphoreType
semaphoreConfig String
status WorkOrderExecutionState

getWorker

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
Worker retVal = decisionApi.getWorker(workOrderURI, workerId);
retVal = baseAPI.doDecision_GetWorker(workOrderURI, workerId);

Entitlement: /decision/read/$f(workOrderURI)

Get the worker

Function Parameters

Parameter Type Description
workOrderURI String
workerId String

Return value

Type Description
Worker
Types used in this function

Worker

Workers keep track of progress when executing a work order. Each worker handles one thread of execution.

Field Type
workOrderURI WorkOrderURI
id String
viewOverlay Map<String,String>
stack List
localView List<Map<String,String>>
stepExecutionRecords List
stepRecords List
status WorkerExecutionState
detail String
effectiveUser String
priority Integer
callingContext CallingContext
activityId String
appStatusNameStack List
parent String
siblingCount Integer
siblingPosition Integer
waitCount Integer
exceptionInfo ErrorWrapper
myActivityId String

cancelWorkOrder

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.cancelWorkOrder(workOrderURI);
retVal = baseAPI.doDecision_CancelWorkOrder(workOrderURI);

Entitlement: /decision/write/$f(workOrderURI)

Requests cancellation of a work order. This method returns immediately once the cancellation is recorded, but the individual workers may continue for some time before stopping, depending on the type of step being executed.

Function Parameters

Parameter Type Description
workOrderURI String

Return value

Type Description
void

resumeWorkOrder

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
CreateResponse retVal = decisionApi.resumeWorkOrder(workOrderURI, resumeStepURI);
retVal = baseAPI.doDecision_ResumeWorkOrder(workOrderURI, resumeStepURI);

Entitlement: /decision/write/$f(workOrderURI)

Resume work order

Function Parameters

Parameter Type Description
workOrderURI String
resumeStepURI String

Return value

Type Description
CreateResponse
Types used in this function

CreateResponse

An object returned by public API calls that create things. If the object was created, the URI is returned. Otherwise, the message contains the reason the object was not created.

Field Type
isCreated Boolean
uri RaptureURI
message String

wasCancelCalled

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
boolean retVal = decisionApi.wasCancelCalled(workOrderURI);
retVal = baseAPI.doDecision_WasCancelCalled(workOrderURI);

Entitlement: /decision/read/$f(workOrderURI)

Returns true if CancelWorkOrder was called.

Function Parameters

Parameter Type Description
workOrderURI String

Return value

Type Description
boolean

getCancellationDetails

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
WorkOrderCancellation retVal = decisionApi.getCancellationDetails(workOrderURI);
retVal = baseAPI.doDecision_GetCancellationDetails(workOrderURI);

Entitlement: /decision/read/$f(workOrderURI)

Gets details for the cancellation for a workOrder -- or null if not cancelled.

Function Parameters

Parameter Type Description
workOrderURI String

Return value

Type Description
WorkOrderCancellation
Types used in this function

WorkOrderCancellation

A request to cancel a work order.

Field Type
workOrderURI WorkOrderURI
time Long

getWorkOrderDebug

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
WorkOrderDebug retVal = decisionApi.getWorkOrderDebug(workOrderURI);
retVal = baseAPI.doDecision_GetWorkOrderDebug(workOrderURI);

Entitlement: /decision/debug/$f(workOrderURI)

Gets the detailed context information for a work order in progress

Function Parameters

Parameter Type Description
workOrderURI String

Return value

Type Description
WorkOrderDebug
Types used in this function

WorkOrderDebug

Contains extra information about a work order, useful mainly for debugging.

Field Type
order WorkOrder
workerDebugs List
passedArguments List
context ExecutionContext
logURI String
argsHashValue String
parentJobURI String

setWorkOrderIdGenConfig

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.setWorkOrderIdGenConfig(config, force);
retVal = baseAPI.doDecision_SetWorkOrderIdGenConfig(config, force);

Entitlement: /decision/admin

Defines the IdGen config for work order items.

Function Parameters

Parameter Type Description
config String
force boolean

Return value

Type Description
void

setContextLiteral

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.setContextLiteral(workerURI, varAlias, literalValue);
retVal = baseAPI.doDecision_SetContextLiteral(workerURI, varAlias, literalValue);

Entitlement: /decision/write

Sets a literal in the context. The literal value that is stored will be returned after a read. The workerURI is a workOrderURI with the element set to the worker ID.

Function Parameters

Parameter Type Description
workerURI String
varAlias String
literalValue String

Return value

Type Description
void

setContextLink

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.setContextLink(workerURI, varAlias, expressionValue);
retVal = baseAPI.doDecision_SetContextLink(workerURI, varAlias, expressionValue);

Entitlement: /decision/write

Set a literal in the context. This means that whatever is stored will be evaluated before being returned, so it must be a valid expression. The workerURI is a workOrderURI with the element set to the worker id

Function Parameters

Parameter Type Description
workerURI String
varAlias String
expressionValue String

Return value

Type Description
void

getContextValue

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
String retVal = decisionApi.getContextValue(workerURI, varAlias);
retVal = baseAPI.doDecision_GetContextValue(workerURI, varAlias);

Entitlement: /decision/read

Gets a value in the context, as json. The workerURI is a workOrderURI with the element set to the worker id.

Function Parameters

Parameter Type Description
workerURI String
varAlias String

Return value

Type Description
String

addErrorToContext

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.addErrorToContext(workerURI, errorWrapper);
retVal = baseAPI.doDecision_AddErrorToContext(workerURI, errorWrapper);

Entitlement: /decision/write

Adds an error to the context of a particular worker. The workerURI is a workOrderURI with the element set to the worker id

Function Parameters

Parameter Type Description
workerURI String
errorWrapper ErrorWrapper

Return value

Type Description
void
Types used in this function

ErrorWrapper

Contains information associated with an error captured by the Rapture system.

Field Type
id String
status Integer
message String

getErrorsFromContext

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
List<ErrorWrapper> retVal = decisionApi.getErrorsFromContext(workerURI);
retVal = baseAPI.doDecision_GetErrorsFromContext(workerURI);

Entitlement: /decision/read

Gets the errors from the context for a given worker. The workerURI is a workOrderURI with the element set to the worker id.

Function Parameters

Parameter Type Description
workerURI String

Return value

Type Description
List

getExceptionInfo

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
List<ErrorWrapper> retVal = decisionApi.getExceptionInfo(workOrderURI);
retVal = baseAPI.doDecision_GetExceptionInfo(workOrderURI);

Entitlement: /decision/read

Get info about any exception(s) thrown during execution of this workorder

Function Parameters

Parameter Type Description
workOrderURI String

Return value

Type Description
List

reportStepProgress

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
void retVal = decisionApi.reportStepProgress(workerURI, stepStartTime, message, progress, max);
retVal = baseAPI.doDecision_ReportStepProgress(workerURI, stepStartTime, message, progress, max);

Entitlement: /decision/read

Report status of the step - workerURI: the uri of this WorkOrder with the element set to the worker ID - stepStartTime: the time when the step being reported started

  • message: a human-friendly message to display - progress: how many units are currently complete - max: how many units in total would mark this as done

Function Parameters

Parameter Type Description
workerURI String
stepStartTime Long
message String
progress Long
max Long

Return value

Type Description
void

getAppStatuses

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
List<AppStatus> retVal = decisionApi.getAppStatuses(prefix);
retVal = baseAPI.doDecision_GetAppStatuses(prefix);

Entitlement: /decision/read

Gets app statuses by prefix.

Function Parameters

Parameter Type Description
prefix String

Return value

Type Description
List

getAppStatusDetails

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
List<AppStatusDetails> retVal = decisionApi.getAppStatusDetails(prefix, extraContextValues);
retVal = baseAPI.doDecision_GetAppStatusDetails(prefix, extraContextValues);

Entitlement: /decision/read

Gets detailed app status info by prefix. Also returns any context values requested in the second argument.

Function Parameters

Parameter Type Description
prefix String
extraContextValues List

Return value

Type Description
List

getMonthlyMetrics

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
WorkflowHistoricalMetrics retVal = decisionApi.getMonthlyMetrics(workflowURI, jobURI, argsHashValue, state);
retVal = baseAPI.doDecision_GetMonthlyMetrics(workflowURI, jobURI, argsHashValue, state);

Entitlement: /decision/read

Get any defined average runtimes for the past month for a workflow

Function Parameters

Parameter Type Description
workflowURI String
jobURI String
argsHashValue String
state String

Return value

Type Description
WorkflowHistoricalMetrics
Types used in this function

WorkflowHistoricalMetrics

Workflow historical metrics

Field Type
workflowAverage Double
jobAverage Double
workflowWithArgsAverage Double
workflowMetricName String
jobMetricName String
argsHashMetricName String

queryLogs

HttpDecisionApi decisionApi = new HttpDecisionApi(loginApi);
LogQueryResponse retVal = decisionApi.queryLogs(workOrderURI, startTime, endTime, keepAlive, bufferSize, nextBatchId, stepName, stepStartTime);
retVal = baseAPI.doDecision_QueryLogs(workOrderURI, startTime, endTime, keepAlive, bufferSize, nextBatchId, stepName, stepStartTime);

Entitlement: /decision/read

Get log messages for a workflow. Note: logs get deleted after a certain number of days, so this only retrieves any log messages that are within theconfigured log retention period. If the retention period is before the startTime, an empty response is returned.workOrderURI: requiredstartTime: requiredendTime: requiredkeepAlive: required, milliseconds to keep alive the batch, max 30000bufferSize: required, max 100nextBatchId: optional, if null start from beginningstepName: optionalstepStartTime: optional, this is a timestamp in a string because of a limitation in Rapture where int or long arguments cannot be null

Function Parameters

Parameter Type Description
workOrderURI String
startTime Long
endTime Long
keepAlive Long
bufferSize Long
nextBatchId String
stepName String
stepStartTime String

Return value

Type Description
LogQueryResponse
Types used in this function

LogQueryResponse

A response to a query on log messages

Field Type
isLast Boolean
nextBatchId String
messages List
⚠️ **GitHub.com Fallback** ⚠️