import { BpmsEngine } from '../BpmsEngine'; import { DmnDefinitionRepository } from './DmnDefinitionRepository'; import { QueryOptions, QueryResult, ScalarOptions, FilterExpression, IdExpression } from '../data/Repository'; export interface DmnEvaluationContext { } export interface DmnDecisionTable { hitPolicy: 'FIRST' | 'UNIQUE' | 'COLLECT' | 'RULE ORDER' | 'ANY'; rules: DmnDecisionTableRule[]; input: string[]; output: string[]; inputExpressions?: any[]; parsedInputExpressions?: any[]; outputNames?: string[]; } export interface DmnDecisionTableRule { inputValues?: any[]; outputValues?: any[]; } export interface DmnDecision { name: string; decisionTable: DmnDecisionTable; requiredDecisions: any[]; } export interface DmnDefinition { [name: string]: DmnDecision; } export interface DmnEvaluateResult { } export interface DmnEngineOptions { name: string; dmnDefinitionRepository?: DmnDefinitionRepository; } export interface BpmsDmnDefinition { id?: string; name: string; definitions: string; createdAt?: Date; } export declare class DmnEngine { private bpmsEngine?; private id; private name; private options; private dmnDefinitionRepository; static createEngine(options?: DmnEngineOptions): DmnEngine; static createEngine(bpmsEngine?: BpmsEngine, options?: DmnEngineOptions): DmnEngine; constructor(bpmsEngine?: BpmsEngine | undefined, options?: DmnEngineOptions); get Id(): string; get Name(): string; get BpmsEngine(): BpmsEngine | undefined; /** * register Dmn Definitions * * @param {string} name definiion name * @param {DmnDecision[]} definitions decisions * @returns {Promise} return true * @memberof DmnEngine */ create(entity: BpmsDmnDefinition): Promise; update(entity: BpmsDmnDefinition): Promise; /** * Get decision from special definition name * * @param {string} name definition name * @returns {Promise} * @memberof DmnEngine */ getDecisionsByName(name: string): Promise; /** * Get decision from special definition name * * @param {string} name definition name * @returns {Promise} * @memberof DmnEngine */ getDecisionsById(id: IdExpression): Promise; /** * Get all cached Dmn definitions * * @returns {Promise} * @memberof DmnEngine */ getDefinitionNames(): Promise; /** * evaluate Decision from decision in the special context * * @param {DmnDecision} decision desicions to be evaluated * @param {*} context context to evaluate * @returns {(Promise)} * @memberof DmnEngine */ evaluateDecision>(decision: DmnDecision | string, context: any): Promise; /** * Parse dmn xml content to create dmn decisions * * @param {string} xmlContent xml content * @param {{ lax?: boolean; model?: any }} [options] xml reader options * @returns {Promise} * @memberof DmnEngine */ parseDmnXml(xmlContent: string, options?: { lax?: boolean; model?: any; }): Promise; clear(): Promise; count(): Promise; find(filter: IdExpression): Promise; find(filter: FilterExpression): Promise; load(filter?: FilterExpression): Promise; list(filter?: FilterExpression): Promise; remove(id: IdExpression): Promise; query(options: QueryOptions): Promise>; scalar(options: ScalarOptions): Promise; }