@5minds/processcube_app_sdk
Version:
The SDK for ProcessCube Apps
35 lines (34 loc) • 1.25 kB
TypeScript
type FlowNodeDefinition = {
id: string;
customProperties: Record<string, string>;
};
type CostCalculationResult = {
total: number;
errors: number;
average: number;
reference?: number;
critical?: number;
warning?: number;
};
export declare class ProcessCostsService {
private flowNodeInstances;
private processCostsExpressionParams;
private instances;
private costResultsByFlowNodeId;
private instanceCounter;
private thresholdsByFlowNodeId;
constructor(databaseProcessInstance: any, flowNodeDefinitions: FlowNodeDefinition[]);
getInstanceCount(flowNodeId: string): number | undefined;
getCostsForFlowNodeId(flowNodeId: string): Record<string, CostCalculationResult> | undefined;
getAllProcessCosts(): Record<string, Record<string, CostCalculationResult>>;
getFlowNodeExecutionCount(flowNodeId: string, flowNodeInstanceId: string): number;
getProcessInstanceCount(): number;
private splitCostProperties;
private precalculateCosts;
private getProcessCosts;
private setProcessCostExpressionParamsForInstance;
private getCurrentFlowNode;
private buildTokenHistoryForFlowNodeInstance;
private buildDataObjectsForFlowNodeInstance;
}
export {};