@5minds/processcube_app_sdk
Version:
The SDK for ProcessCube Apps
71 lines (70 loc) • 4.08 kB
TypeScript
import { DataModels } from '@5minds/processcube_engine_client';
import type { Identity } from '@5minds/processcube_engine_sdk';
import { Client } from './internal/EngineClient';
/**
* This function will return the ProcessInstance with the given ID.
*
* @param processInstanceId The ID of the ProcessInstance
* @returns {Promise<DataModels.ProcessInstances.ProcessInstance>} The {@link DataModels.ProcessInstances.ProcessInstance}
*/
export declare function getProcessInstanceById(processInstanceId: string): Promise<DataModels.ProcessInstances.ProcessInstance>;
/**
* This function will return the FlowNodeInstances of the ProcessInstance with the given ID.
*
* @param processInstanceId The ID of the {@link DataModels.ProcessInstances.ProcessInstance}
* @param options The options for the {@link Client.flowNodeInstances.query}
* @returns {Promise<DataModels.FlowNodeInstances.FlowNodeInstance[]>} The list of {@link DataModels.FlowNodeInstances.FlowNodeInstance}
*/
export declare function getFlowNodeInstancesByProcessInstanceId(processInstanceId: string, options?: Parameters<typeof Client.flowNodeInstances.query>[1]): Promise<DataModels.FlowNodeInstances.FlowNodeInstance[]>;
/**
* This function will return the FlowNodeInstances that are triggered by the FlowNodeInstances with the given IDs.
*
* @param flowNodeInstanceIds The IDs of the FlowNodeInstances
* @returns {Promise<DataModels.FlowNodeInstances.FlowNodeInstance[]>} The list of {@link DataModels.FlowNodeInstances.FlowNodeInstance}
*/
export declare function getFlowNodeInstancesTriggeredByFlowNodeInstanceIds(flowNodeInstanceIds: string[]): Promise<DataModels.FlowNodeInstances.FlowNodeInstance[]>;
/**
* This function will retry the ProcessInstance with the given ID.
* If the `flowNodeInstanceId` is given, the ProcessInstance will be retried from this FlowNodeInstance.
* If the `newStartToken` is given, the ProcessInstance will be retried with this StartToken.
*
* @param processInstanceId The ID of the ProcessInstance
* @param flowNodeInstanceId The ID of the FlowNodeInstance
* @param newStartToken The new StartToken
*/
export declare function retryProcessInstance(processInstanceId: string, flowNodeInstanceId?: string, newStartToken?: any): Promise<void>;
/**
* This function will terminate the ProcessInstance with the given ID.
*
* @param processInstanceId The ID of the ProcessInstance
* @param identity The Identity to use for the request
*/
export declare function terminateProcessInstance(processInstanceId: string): Promise<void>;
/**
* This function will return the running ProcessInstances.
* If `query` is given, the ProcessInstances will be filtered by this query.
* If `options` are given, the ProcessInstances will be queried with these options.
*
* @param query.query The query of {@link Client.processInstances.query}
* @param query.options The options of {@link Client.processInstances.query}
* @param indentity The Identity fo the User
* @returns The list of active process instances as promise {@link DataModels.ProcessInstances.ProcessInstanceList}
*/
export declare function getActiveProcessInstances(query?: {
query?: Omit<DataModels.ProcessInstances.ProcessInstanceQuery, 'state'>;
options: Omit<Parameters<typeof Client.processInstances.query>[1], 'identity'> & {
identity?: Identity | boolean;
};
}): Promise<DataModels.ProcessInstances.ProcessInstanceList>;
/**
* This function will wait until a ProcessInstance is finished, terminated or errored.
* If the ProcessInstance is already finished, it will instantly be returned.
*
* @param filterBy Additional filter options
* @param filterBy.processInstanceId The ID of the ProcessInstance to wait for
* @param identity The Identity to use for the request
* @returns {Promise<DataModels.ProcessInstances.ProcessInstance>} The {@link DataModels.ProcessInstances.ProcessInstance}
*/
export declare function waitForProcessEnd(filterBy?: {
processInstanceId?: string;
}, identity?: Identity | boolean): Promise<DataModels.ProcessInstances.ProcessInstance>;