mirror of
https://github.com/kmitresse/Compo-Service-Log-Project.git
synced 2026-05-13 17:11:49 +00:00
refactor: DMN files
This commit is contained in:
+13
-10
@@ -1,21 +1,24 @@
|
||||
import DmnModdle from "dmn-moddle";
|
||||
import { DMN_Decision, Is_DMN_Decision } from "./interfaces/DMN_Decision";
|
||||
import { Is_DMN_DecisionTable } from "./interfaces/DMN_DecisionTable";
|
||||
import { Name_of_DMN_InputClause } from "./interfaces/DMN_InputClause";
|
||||
import { Name_of_DMN_OutputClause } from "./interfaces/DMN_OutputClause";
|
||||
import { DMN_Definitions } from "./interfaces/DMN_Definitions";
|
||||
import {
|
||||
Decision,
|
||||
Is_DMN_Decision,
|
||||
Is_DMN_DecisionTable,
|
||||
Name_of_DMN_InputClause,
|
||||
Name_of_DMN_OutputClause,
|
||||
Definitions,
|
||||
} from "./interfaces";
|
||||
|
||||
export class DMN {
|
||||
static async parse(xml: string): Promise<DMN_Definitions> {
|
||||
static async parse(xml: string): Promise<Definitions> {
|
||||
const { rootElement, warnings } = await new DmnModdle().fromXML(xml);
|
||||
if (warnings.length !== 0)
|
||||
console.warn(warnings.map((warning: any) => warning.message).join(" * "));
|
||||
return rootElement as DMN_Definitions;
|
||||
return rootElement as Definitions;
|
||||
}
|
||||
|
||||
public static getSchema(dmnDefinitions: DMN_Definitions) {
|
||||
const descisions: DMN_Decision[] = dmnDefinitions.drgElement.filter(
|
||||
(element) => Is_DMN_Decision(element)
|
||||
public static getSchema(dmnDefinitions: Definitions) {
|
||||
const descisions: Decision[] = dmnDefinitions.drgElement.filter((element) =>
|
||||
Is_DMN_Decision(element)
|
||||
);
|
||||
const { input, output } = descisions
|
||||
.map((decision) => decision.decisionLogic)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ModdleElement } from "../interfaces/ModdleElement";
|
||||
import { Name_of_ModdleElement } from "../interfaces/DMN_enums";
|
||||
import { Name_of_ModdleElement } from "../interfaces/enums";
|
||||
|
||||
export class DmnError extends Error {
|
||||
static readonly Inconsistent_DMN_diagram =
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { ModdleElementReference } from "./ModdleElementReference";
|
||||
|
||||
const _DMN_AuthorityRequirement: "dmn:AuthorityRequirement" =
|
||||
"dmn:AuthorityRequirement";
|
||||
|
||||
interface AuthorityRequirement extends ModdleElement {
|
||||
$type: typeof _DMN_AuthorityRequirement;
|
||||
requiredAuthority?: ModdleElementReference;
|
||||
requiredDecision?: ModdleElementReference;
|
||||
}
|
||||
|
||||
// class AuthorityRequirement extends ModdleElement {
|
||||
// readonly $type: string = "dmn:AuthorityRequirement";
|
||||
// requiredAuthority?: ModdleElementReference;
|
||||
// requiredDecision?: ModdleElementReference;
|
||||
// }
|
||||
|
||||
export { AuthorityRequirement, _DMN_AuthorityRequirement };
|
||||
@@ -0,0 +1,18 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
|
||||
const _DMN_BusinessKnowledgeModel: "dmn:BusinessKnowledgeModel" =
|
||||
"dmn:BusinessKnowledgeModel";
|
||||
|
||||
interface DMN_BusinessKnowledgeModel extends ModdleElement {
|
||||
$type: typeof _DMN_BusinessKnowledgeModel;
|
||||
}
|
||||
|
||||
// class BusinessKnowledgeModel extends ModdleElement {
|
||||
// readonly $type: string = "dmn:BusinessKnowledgeModel";
|
||||
// }
|
||||
|
||||
export {
|
||||
// BusinessKnowledgeModel,
|
||||
DMN_BusinessKnowledgeModel,
|
||||
_DMN_BusinessKnowledgeModel,
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { ContextEntry } from "./ContextEntry";
|
||||
import { DMN_type_reference_ } from "./enums";
|
||||
|
||||
const _DMN_Context: "dmn:Context" = "dmn:Context";
|
||||
|
||||
interface Context extends ModdleElement {
|
||||
$type: typeof _DMN_Context;
|
||||
contextEntry: Array<ContextEntry>;
|
||||
typeRef: DMN_type_reference_;
|
||||
}
|
||||
|
||||
function Is_DMN_Context(me: ModdleElement): me is Context {
|
||||
return (
|
||||
"$type" in me &&
|
||||
me.$type === _DMN_Context &&
|
||||
"contextEntry" in me &&
|
||||
"typeRef" in me
|
||||
);
|
||||
}
|
||||
|
||||
// class Context extends ModdleElement {
|
||||
// readonly $type: string = "dmn:Context";
|
||||
// contextEntry: ContextEntry[] = [];
|
||||
// typeRef: DMN_type_reference_ ;
|
||||
// }
|
||||
|
||||
export { Context, _DMN_Context, Is_DMN_Context };
|
||||
@@ -0,0 +1,19 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { LiteralExpression } from "./LiteralExpression";
|
||||
import { InformationItem } from "./InformationItem";
|
||||
|
||||
const _DMN_ContextEntry: "dmn:ContextEntry" = "dmn:ContextEntry";
|
||||
|
||||
interface ContextEntry extends ModdleElement {
|
||||
$type: typeof _DMN_ContextEntry;
|
||||
value: LiteralExpression;
|
||||
variable: InformationItem;
|
||||
}
|
||||
|
||||
// class ContextEntry extends ModdleElement {
|
||||
// readonly $type: string = "dmn:ContextEntry";
|
||||
// value: LiteralExpression = new LiteralExpression();
|
||||
// variable: InformationItem;
|
||||
// }
|
||||
|
||||
export { ContextEntry, _DMN_ContextEntry };
|
||||
@@ -1,11 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_DMNElementReference } from "./DMN_DMNElementReference";
|
||||
|
||||
export const _DMN_AuthorityRequirement: "dmn:AuthorityRequirement" =
|
||||
"dmn:AuthorityRequirement";
|
||||
|
||||
export interface DMN_AuthorityRequirement extends ModdleElement {
|
||||
$type: typeof _DMN_AuthorityRequirement;
|
||||
requiredAuthority?: DMN_DMNElementReference;
|
||||
requiredDecision?: DMN_DMNElementReference;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
|
||||
export const _DMN_BusinessKnowledgeModel: "dmn:BusinessKnowledgeModel" =
|
||||
"dmn:BusinessKnowledgeModel";
|
||||
|
||||
export interface DMN_BusinessKnowledgeModel extends ModdleElement {
|
||||
$type: typeof _DMN_BusinessKnowledgeModel;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_ContextEntry } from "./DMN_ContextEntry";
|
||||
import { DMN_type_reference_ } from "./DMN_enums";
|
||||
|
||||
const _DMN_Context: "dmn:Context" = "dmn:Context";
|
||||
|
||||
export interface DMN_Context extends ModdleElement {
|
||||
$type: typeof _DMN_Context;
|
||||
contextEntry: Array<DMN_ContextEntry>;
|
||||
typeRef: DMN_type_reference_;
|
||||
}
|
||||
|
||||
export function Is_DMN_Context(me: ModdleElement): me is DMN_Context {
|
||||
return (
|
||||
"$type" in me &&
|
||||
me.$type === _DMN_Context &&
|
||||
"contextEntry" in me &&
|
||||
"typeRef" in me
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_LiteralExpression } from "./DMN_LiteralExpression";
|
||||
import { DMN_InformationItem } from "./DMN_InformationItem";
|
||||
|
||||
export const _DMN_ContextEntry: "dmn:ContextEntry" = "dmn:ContextEntry";
|
||||
|
||||
export interface DMN_ContextEntry extends ModdleElement {
|
||||
$type: typeof _DMN_ContextEntry;
|
||||
value: DMN_LiteralExpression;
|
||||
variable: DMN_InformationItem;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
|
||||
export const _DMN_DMNElementReference: "dmn:DMNElementReference" =
|
||||
"dmn:DMNElementReference";
|
||||
export interface DMN_DMNElementReference extends ModdleElement {
|
||||
$type: typeof _DMN_DMNElementReference;
|
||||
href: string; // Example: "#temperature_id"
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_AuthorityRequirement } from "./DMN_AuthorityRequirement";
|
||||
import { DMN_Context } from "./DMN_Context";
|
||||
import { DMN_DecisionTable } from "./DMN_DecisionTable";
|
||||
import { DMN_Definitions } from "./DMN_Definitions";
|
||||
import { DMN_LiteralExpression } from "./DMN_LiteralExpression";
|
||||
import { DMN_InformationRequirement } from "./DMN_InformationRequirement";
|
||||
import { DMN_KnowledgeRequirement } from "./DMN_KnowledgeRequirement";
|
||||
import { DMN_InformationItem } from "./DMN_InformationItem";
|
||||
|
||||
export const _DMN_Decision: "dmn:Decision" = "dmn:Decision";
|
||||
|
||||
export interface DMN_Decision extends ModdleElement {
|
||||
$parent: DMN_Definitions;
|
||||
$type: typeof _DMN_Decision;
|
||||
allowedAnswers?: string;
|
||||
authorityRequirement?: Array<DMN_AuthorityRequirement>; // Knowledge source(s)
|
||||
decisionLogic: DMN_Context | DMN_DecisionTable | DMN_LiteralExpression;
|
||||
description?: string;
|
||||
informationRequirement?: Array<DMN_InformationRequirement>; // Input data
|
||||
knowledgeRequirement?: Array<DMN_KnowledgeRequirement>; // Knowledge model(s)
|
||||
question?: string;
|
||||
variable?: DMN_InformationItem;
|
||||
}
|
||||
|
||||
export function Is_DMN_Decision(me: ModdleElement): me is DMN_Decision {
|
||||
return "$type" in me && me.$type === _DMN_Decision && "decisionLogic" in me;
|
||||
}
|
||||
|
||||
export function Name_of_DMN_Decision(decision: DMN_Decision): string {
|
||||
return "name" in decision ? decision.name! : decision.id;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_UnaryTests } from "./DMN_UnaryTests";
|
||||
import { DMN_LiteralExpression } from "./DMN_LiteralExpression";
|
||||
export const _DMN_DecisionRule: "dmn:DecisionRule" = "dmn:DecisionRule";
|
||||
|
||||
export interface DMN_DecisionRule extends ModdleElement {
|
||||
$type: typeof _DMN_DecisionRule;
|
||||
description: string;
|
||||
inputEntry: Array<DMN_UnaryTests>;
|
||||
outputEntry: Array<DMN_LiteralExpression>;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_Decision } from "./DMN_Decision";
|
||||
import { DMN_DecisionRule } from "./DMN_DecisionRule";
|
||||
import { DMN_RuleAnnotationClause } from "./DMN_RuleAnnotationClause";
|
||||
import { Hit_policy } from "./DMN_enums";
|
||||
import { DMN_InputClause } from "./DMN_InputClause";
|
||||
import { DMN_OutputClause } from "./DMN_OutputClause";
|
||||
|
||||
export const _DMN_DecisionTable: "dmn:DecisionTable" = "dmn:DecisionTable";
|
||||
|
||||
export interface DMN_DecisionTable extends ModdleElement {
|
||||
$parent: DMN_Decision; // Overriding...
|
||||
$type: typeof _DMN_DecisionTable;
|
||||
annotation?: Array<DMN_RuleAnnotationClause>;
|
||||
hitPolicy?: Hit_policy;
|
||||
input?: Array<DMN_InputClause>;
|
||||
output?: Array<DMN_OutputClause>;
|
||||
outputLabel?: string;
|
||||
rule?: Array<DMN_DecisionRule>;
|
||||
}
|
||||
|
||||
export function Is_DMN_DecisionTable(
|
||||
me: ModdleElement
|
||||
): me is DMN_DecisionTable {
|
||||
return (
|
||||
"$type" in me &&
|
||||
me.$type === _DMN_DecisionTable &&
|
||||
"input" in me &&
|
||||
"output" in me &&
|
||||
"rule" in me
|
||||
);
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_BusinessKnowledgeModel } from "./DMN_BusinessKnoledgeModel";
|
||||
import { DMN_Decision } from "./DMN_Decision";
|
||||
import { DMN_InputData } from "./DMN_InputData";
|
||||
import { DMN_KnowledgeSource } from "./DMN_KnowledgSource";
|
||||
import { DMN_ItemDefinition } from "./DMN_ItemDefinition";
|
||||
import { DMN_type_reference_, Trace } from "./DMN_enums";
|
||||
|
||||
export const _DMN_Definitions: "dmn:Definitions" = "dmn:Definitions";
|
||||
|
||||
export interface DMN_Definitions extends ModdleElement {
|
||||
$type: typeof _DMN_Definitions;
|
||||
// artifact?: Array<ModdleElement>; // 'dmn:Association' | 'dmn:TextAnnotation'
|
||||
// dmnDI: DMNDI_DMNDI;
|
||||
drgElement: Array<
|
||||
| DMN_BusinessKnowledgeModel
|
||||
| DMN_Decision
|
||||
| DMN_InputData
|
||||
| DMN_KnowledgeSource
|
||||
>;
|
||||
itemDefinition: Array<DMN_ItemDefinition>;
|
||||
}
|
||||
|
||||
export function _Get_type_reference_from_DMN_Definitions(
|
||||
me: DMN_Definitions,
|
||||
type_name: string | undefined
|
||||
): DMN_type_reference_ | undefined {
|
||||
if (Trace)
|
||||
console.assert(
|
||||
Is_DMN_Definitions(me),
|
||||
"'_Get_type_reference_from_DMN_Definitions' >> 'Is_DMN_Definitions(me)', untrue"
|
||||
);
|
||||
if (type_name === undefined) return undefined;
|
||||
const index = me.itemDefinition.findIndex(
|
||||
(item: DMN_ItemDefinition) => item.name === type_name
|
||||
);
|
||||
return index !== -1 ? me.itemDefinition[index].typeRef : undefined;
|
||||
}
|
||||
|
||||
export function Is_DMN_Definitions(me: ModdleElement): me is DMN_Definitions {
|
||||
return "$type" in me && me.$type === _DMN_Definitions && "drgElement" in me;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_type_reference_ } from "./DMN_enums";
|
||||
|
||||
export const _DMN_InformationItem: "dmn:InformationItem" =
|
||||
"dmn:InformationItem";
|
||||
|
||||
export interface DMN_InformationItem extends ModdleElement {
|
||||
$type: typeof _DMN_InformationItem;
|
||||
typeRef: DMN_type_reference_;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_DMNElementReference } from "./DMN_DMNElementReference";
|
||||
|
||||
const _DMN_InformationRequirement: "dmn:InformationRequirement" =
|
||||
"dmn:InformationRequirement";
|
||||
|
||||
export interface DMN_InformationRequirement extends ModdleElement {
|
||||
$type: typeof _DMN_InformationRequirement;
|
||||
requiredDecision?: DMN_DMNElementReference;
|
||||
requiredInput?: DMN_DMNElementReference;
|
||||
}
|
||||
|
||||
export function Is_DMN_InformationRequirement(
|
||||
me: ModdleElement
|
||||
): me is DMN_InformationRequirement {
|
||||
return (
|
||||
"$type" in me &&
|
||||
me.$type === _DMN_InformationRequirement &&
|
||||
"requiredInput" in me
|
||||
);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_InformationItem } from "./DMN_InformationItem";
|
||||
|
||||
export const _DMN_InputData: "dmn:InputData" = "dmn:InputData";
|
||||
|
||||
export interface DMN_InputData extends ModdleElement {
|
||||
$type: typeof _DMN_InputData;
|
||||
name: string;
|
||||
variable?: DMN_InformationItem;
|
||||
}
|
||||
|
||||
export function Is_DMN_InputData(me: ModdleElement): me is DMN_InputData {
|
||||
return "$type" in me && me.$type === _DMN_InputData;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import { DMN_UnaryTests } from "./DMN_UnaryTests";
|
||||
import { DMN_type_reference_ } from "./DMN_enums";
|
||||
|
||||
const _DMN_ItemDefinition: "dmn:ItemDefinition" = "dmn:ItemDefinition";
|
||||
|
||||
export interface DMN_ItemDefinition {
|
||||
$type: typeof _DMN_ItemDefinition;
|
||||
allowedValues?: DMN_UnaryTests;
|
||||
itemComponent?: Array<DMN_ItemDefinition>;
|
||||
label: string;
|
||||
name: string;
|
||||
typeRef?: DMN_type_reference_;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_AuthorityRequirement } from "./DMN_AuthorityRequirement";
|
||||
|
||||
export const _DMN_KnowledgeSource: "dmn:KnowledgeSource" =
|
||||
"dmn:KnowledgeSource";
|
||||
|
||||
export interface DMN_KnowledgeSource extends ModdleElement {
|
||||
$type: typeof _DMN_KnowledgeSource;
|
||||
authorityRequirement?: Array<DMN_AuthorityRequirement>;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_DMNElementReference } from "./DMN_DMNElementReference";
|
||||
|
||||
const _DMN_KnowledgeRequirement: "dmn:KnowledgeRequirement" =
|
||||
"dmn:KnowledgeRequirement";
|
||||
|
||||
export interface DMN_KnowledgeRequirement extends ModdleElement {
|
||||
$type: typeof _DMN_KnowledgeRequirement;
|
||||
requiredKnowledge: DMN_DMNElementReference;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_type_reference_ } from "./DMN_enums";
|
||||
|
||||
export const _DMN_LiteralExpression: "dmn:LiteralExpression" =
|
||||
"dmn:LiteralExpression";
|
||||
|
||||
export interface DMN_LiteralExpression extends ModdleElement {
|
||||
$type: typeof _DMN_LiteralExpression;
|
||||
text: string;
|
||||
typeRef: DMN_type_reference_;
|
||||
}
|
||||
|
||||
export function Is_DMN_LiteralExpression(
|
||||
me: ModdleElement
|
||||
): me is DMN_LiteralExpression {
|
||||
return (
|
||||
"$type" in me &&
|
||||
me.$type === _DMN_LiteralExpression &&
|
||||
"text" in me &&
|
||||
"typeRef" in me
|
||||
);
|
||||
}
|
||||
@@ -1,11 +1,16 @@
|
||||
import { Drop_mode, Status_mode } from "./DMN_enums";
|
||||
import { Drop_mode, Status_mode } from "./enums";
|
||||
|
||||
export interface Data {
|
||||
interface Data {
|
||||
action: Drop_mode | Status_mode;
|
||||
data: Array<Object>;
|
||||
}
|
||||
|
||||
export function Is_Data(data: Data): data is Data {
|
||||
// class Data {
|
||||
// action: Drop_mode | Status_mode;
|
||||
// data: object[];
|
||||
// }
|
||||
|
||||
function Is_Data(data: Data): boolean {
|
||||
return (
|
||||
"action" in data &&
|
||||
(Object.values(Drop_mode).includes(
|
||||
@@ -18,3 +23,5 @@ export function Is_Data(data: Data): data is Data {
|
||||
Array.isArray(data.data)
|
||||
);
|
||||
}
|
||||
|
||||
export { Data, Is_Data };
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { AuthorityRequirement } from "./AuthorityRequirement";
|
||||
import { Context } from "./Context";
|
||||
import { DecisionTable } from "./DecisionTable";
|
||||
import { Definitions } from "./Definitions";
|
||||
import { LiteralExpression } from "./LiteralExpression";
|
||||
import { InformationRequirement } from "./InformationRequirement";
|
||||
import { KnowledgeRequirement } from "./KnowledgeRequirement";
|
||||
import { InformationItem } from "./InformationItem";
|
||||
|
||||
const _DMN_Decision: "dmn:Decision" = "dmn:Decision";
|
||||
|
||||
interface Decision extends ModdleElement {
|
||||
$parent: Definitions;
|
||||
$type: typeof _DMN_Decision;
|
||||
decisionLogic: Context | DecisionTable | LiteralExpression;
|
||||
allowedAnswers?: string;
|
||||
authorityRequirement?: Array<AuthorityRequirement>; // Knowledge source(s)
|
||||
description?: string;
|
||||
informationRequirement?: Array<InformationRequirement>; // Input data
|
||||
knowledgeRequirement?: Array<KnowledgeRequirement>; // Knowledge model(s)
|
||||
question?: string;
|
||||
variable?: InformationItem;
|
||||
}
|
||||
|
||||
function Is_DMN_Decision(me: ModdleElement): me is Decision {
|
||||
return "$type" in me && me.$type === _DMN_Decision && "decisionLogic" in me;
|
||||
}
|
||||
|
||||
function Name_of_DMN_Decision(decision: Decision): string {
|
||||
return "name" in decision ? decision.name! : decision.id;
|
||||
}
|
||||
|
||||
export { Decision, _DMN_Decision, Is_DMN_Decision, Name_of_DMN_Decision };
|
||||
@@ -0,0 +1,14 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { UnaryTests } from "./UnaryTests";
|
||||
import { LiteralExpression } from "./LiteralExpression";
|
||||
|
||||
const _DMN_DecisionRule: "dmn:DecisionRule" = "dmn:DecisionRule";
|
||||
|
||||
interface DecisionRule extends ModdleElement {
|
||||
$type: typeof _DMN_DecisionRule;
|
||||
description: string;
|
||||
inputEntry: Array<UnaryTests>;
|
||||
outputEntry: Array<LiteralExpression>;
|
||||
}
|
||||
|
||||
export { DecisionRule, _DMN_DecisionRule };
|
||||
@@ -0,0 +1,32 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { Decision } from "./Decision";
|
||||
import { DecisionRule } from "./DecisionRule";
|
||||
import { RuleAnnotationClause } from "./RuleAnnotationClause";
|
||||
import { Hit_policy } from "./enums";
|
||||
import { InputClause } from "./InputClause";
|
||||
import { OutputClause } from "./OutputClause";
|
||||
|
||||
const _DMN_DecisionTable: "dmn:DecisionTable" = "dmn:DecisionTable";
|
||||
|
||||
interface DecisionTable extends ModdleElement {
|
||||
$parent: Decision; // Overriding...
|
||||
$type: typeof _DMN_DecisionTable;
|
||||
annotation?: Array<RuleAnnotationClause>;
|
||||
hitPolicy?: Hit_policy;
|
||||
input?: Array<InputClause>;
|
||||
output?: Array<OutputClause>;
|
||||
outputLabel?: string;
|
||||
rule?: Array<DecisionRule>;
|
||||
}
|
||||
|
||||
function Is_DMN_DecisionTable(me: ModdleElement): me is DecisionTable {
|
||||
return (
|
||||
"$type" in me &&
|
||||
me.$type === _DMN_DecisionTable &&
|
||||
"input" in me &&
|
||||
"output" in me &&
|
||||
"rule" in me
|
||||
);
|
||||
}
|
||||
|
||||
export { DecisionTable, _DMN_DecisionTable, Is_DMN_DecisionTable };
|
||||
@@ -0,0 +1,45 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_BusinessKnowledgeModel } from "./BusinessKnoledgeModel";
|
||||
import { Decision } from "./Decision";
|
||||
import { InputData } from "./InputData";
|
||||
import { DMN_KnowledgeSource } from "./KnowledgSource";
|
||||
import { ItemDefinition } from "./ItemDefinition";
|
||||
import { DMN_type_reference_, Trace } from "./enums";
|
||||
|
||||
const _DMN_Definitions: "dmn:Definitions" = "dmn:Definitions";
|
||||
|
||||
interface Definitions extends ModdleElement {
|
||||
$type: typeof _DMN_Definitions;
|
||||
drgElement: Array<
|
||||
DMN_BusinessKnowledgeModel | Decision | InputData | DMN_KnowledgeSource
|
||||
>;
|
||||
itemDefinition: ItemDefinition[];
|
||||
}
|
||||
|
||||
function _Get_type_reference_from_DMN_Definitions(
|
||||
me: Definitions,
|
||||
type_name?: string
|
||||
): DMN_type_reference_ | undefined {
|
||||
if (Trace)
|
||||
console.assert(
|
||||
Is_DMN_Definitions(me),
|
||||
"'_Get_type_reference_from_DMN_Definitions' >> 'Is_DMN_Definitions(me)', untrue"
|
||||
);
|
||||
|
||||
if (type_name === undefined) return undefined;
|
||||
const index = me.itemDefinition.findIndex(
|
||||
(item: ItemDefinition) => item.name === type_name
|
||||
);
|
||||
return index !== -1 ? me.itemDefinition[index].typeRef : undefined;
|
||||
}
|
||||
|
||||
function Is_DMN_Definitions(me: ModdleElement): me is Definitions {
|
||||
return "$type" in me && me.$type === _DMN_Definitions && "drgElement" in me;
|
||||
}
|
||||
|
||||
export {
|
||||
_DMN_Definitions,
|
||||
Definitions,
|
||||
_Get_type_reference_from_DMN_Definitions,
|
||||
Is_DMN_Definitions,
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_type_reference_ } from "./enums";
|
||||
|
||||
const _DMN_InformationItem: "dmn:InformationItem" = "dmn:InformationItem";
|
||||
|
||||
interface InformationItem extends ModdleElement {
|
||||
$type: typeof _DMN_InformationItem;
|
||||
typeRef: DMN_type_reference_;
|
||||
}
|
||||
|
||||
export { InformationItem, _DMN_InformationItem };
|
||||
@@ -0,0 +1,27 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { ModdleElementReference } from "./ModdleElementReference";
|
||||
|
||||
const _DMN_InformationRequirement: "dmn:InformationRequirement" =
|
||||
"dmn:InformationRequirement";
|
||||
|
||||
interface InformationRequirement extends ModdleElement {
|
||||
$type: typeof _DMN_InformationRequirement;
|
||||
requiredDecision?: ModdleElementReference;
|
||||
requiredInput?: ModdleElementReference;
|
||||
}
|
||||
|
||||
function Is_DMN_InformationRequirement(
|
||||
me: ModdleElement
|
||||
): me is InformationRequirement {
|
||||
return (
|
||||
"$type" in me &&
|
||||
me.$type === _DMN_InformationRequirement &&
|
||||
"requiredInput" in me
|
||||
);
|
||||
}
|
||||
|
||||
export {
|
||||
InformationRequirement,
|
||||
_DMN_InformationRequirement,
|
||||
Is_DMN_InformationRequirement,
|
||||
};
|
||||
+28
-20
@@ -1,33 +1,33 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DmnError } from "../error/DmnError";
|
||||
import { DMN_DecisionTable } from "./DMN_DecisionTable";
|
||||
import { DecisionTable } from "./DecisionTable";
|
||||
import {
|
||||
_Get_type_reference_from_DMN_Definitions,
|
||||
DMN_Definitions,
|
||||
} from "./DMN_Definitions";
|
||||
import { DMN_Decision } from "./DMN_Decision";
|
||||
import { DMN_LiteralExpression } from "./DMN_LiteralExpression";
|
||||
import { DMN_UnaryTests } from "./DMN_UnaryTests";
|
||||
Definitions,
|
||||
} from "./Definitions";
|
||||
import { Decision } from "./Decision";
|
||||
import { LiteralExpression } from "./LiteralExpression";
|
||||
import { UnaryTests } from "./UnaryTests";
|
||||
import {
|
||||
_Extract_enumeration_values,
|
||||
DMN_type_reference_,
|
||||
Is_DMN_type_reference_,
|
||||
} from "./DMN_enums";
|
||||
} from "./enums";
|
||||
|
||||
export const _DMN_InputClause: "dmn:InputClause" = "dmn:InputClause";
|
||||
const _DMN_InputClause: "dmn:InputClause" = "dmn:InputClause";
|
||||
|
||||
export interface DMN_InputClause extends ModdleElement {
|
||||
$parent: DMN_DecisionTable; // Overriding...
|
||||
interface InputClause extends ModdleElement {
|
||||
$parent: DecisionTable; // Overriding...
|
||||
$type: typeof _DMN_InputClause;
|
||||
inputExpression?: DMN_LiteralExpression;
|
||||
inputValues?: DMN_UnaryTests;
|
||||
inputExpression?: LiteralExpression;
|
||||
inputValues?: UnaryTests;
|
||||
label?: string;
|
||||
typeRef?: DMN_type_reference_;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
export function Get_enumeration_from_DMN_InputClause(
|
||||
me: DMN_InputClause
|
||||
function Get_enumeration_from_DMN_InputClause(
|
||||
me: InputClause
|
||||
): Array<any> | never {
|
||||
// if (Trace)
|
||||
// console.assert(_Is_DMN_InputClause_enumeration_(me), "Get_enumeration_from_DMN_InputClause >> '_Is_DMN_InputClause_enumeration_(me)', untrue");
|
||||
@@ -35,7 +35,7 @@ export function Get_enumeration_from_DMN_InputClause(
|
||||
"inputExpression" in me ? me.inputExpression!.typeRef : undefined;
|
||||
if (Is_DMN_type_reference_(type_reference) === false) {
|
||||
type_reference = _Get_type_reference_from_DMN_Definitions(
|
||||
me.$parent.$parent.$parent as DMN_Definitions,
|
||||
me.$parent.$parent.$parent as Definitions,
|
||||
type_reference
|
||||
);
|
||||
if (type_reference === undefined)
|
||||
@@ -70,7 +70,7 @@ export function Get_enumeration_from_DMN_InputClause(
|
||||
}
|
||||
}
|
||||
|
||||
function _Is_DMN_InputClause_enumeration_(me: DMN_InputClause): boolean {
|
||||
function _Is_DMN_InputClause_enumeration_(me: InputClause): boolean {
|
||||
return (
|
||||
"inputExpression" in me &&
|
||||
"typeRef" in me.inputExpression! &&
|
||||
@@ -79,7 +79,7 @@ function _Is_DMN_InputClause_enumeration_(me: DMN_InputClause): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
export function Name_of_DMN_InputClause(me: DMN_InputClause): string {
|
||||
function Name_of_DMN_InputClause(me: InputClause): string {
|
||||
return "label" in me
|
||||
? me.label!
|
||||
: "name" in me
|
||||
@@ -89,9 +89,9 @@ export function Name_of_DMN_InputClause(me: DMN_InputClause): string {
|
||||
: me.id;
|
||||
}
|
||||
|
||||
export function Type_of_DMN_InputClause(
|
||||
me: DMN_InputClause,
|
||||
decision: DMN_Decision
|
||||
function Type_of_DMN_InputClause(
|
||||
me: InputClause,
|
||||
decision: Decision
|
||||
): DMN_type_reference_ | never {
|
||||
if (_Is_DMN_InputClause_enumeration_(me))
|
||||
return DMN_type_reference_.ENUMERATION;
|
||||
@@ -127,3 +127,11 @@ export function Type_of_DMN_InputClause(
|
||||
Name_of_DMN_InputClause(me)
|
||||
);
|
||||
}
|
||||
|
||||
export {
|
||||
InputClause,
|
||||
_DMN_InputClause,
|
||||
Get_enumeration_from_DMN_InputClause,
|
||||
Name_of_DMN_InputClause,
|
||||
Type_of_DMN_InputClause,
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { InformationItem } from "./InformationItem";
|
||||
|
||||
const _DMN_InputData: "dmn:InputData" = "dmn:InputData";
|
||||
|
||||
interface InputData extends ModdleElement {
|
||||
$type: typeof _DMN_InputData;
|
||||
name: string;
|
||||
variable?: InformationItem;
|
||||
}
|
||||
|
||||
function Is_DMN_InputData(me: ModdleElement): me is InputData {
|
||||
return "$type" in me && me.$type === _DMN_InputData;
|
||||
}
|
||||
|
||||
export { InputData, _DMN_InputData, Is_DMN_InputData };
|
||||
@@ -0,0 +1,15 @@
|
||||
import { UnaryTests } from "./UnaryTests";
|
||||
import { DMN_type_reference_ } from "./enums";
|
||||
|
||||
const _DMN_ItemDefinition: "dmn:ItemDefinition" = "dmn:ItemDefinition";
|
||||
|
||||
interface ItemDefinition {
|
||||
$type: typeof _DMN_ItemDefinition;
|
||||
allowedValues?: UnaryTests;
|
||||
itemComponent?: Array<ItemDefinition>;
|
||||
label: string;
|
||||
name: string;
|
||||
typeRef?: DMN_type_reference_;
|
||||
}
|
||||
|
||||
export { ItemDefinition, _DMN_ItemDefinition };
|
||||
@@ -0,0 +1,11 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { AuthorityRequirement } from "./AuthorityRequirement";
|
||||
|
||||
const _DMN_KnowledgeSource: "dmn:KnowledgeSource" = "dmn:KnowledgeSource";
|
||||
|
||||
interface DMN_KnowledgeSource extends ModdleElement {
|
||||
$type: typeof _DMN_KnowledgeSource;
|
||||
authorityRequirement?: Array<AuthorityRequirement>;
|
||||
}
|
||||
|
||||
export { DMN_KnowledgeSource, _DMN_KnowledgeSource };
|
||||
@@ -0,0 +1,12 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { ModdleElementReference } from "./ModdleElementReference";
|
||||
|
||||
const _DMN_KnowledgeRequirement: "dmn:KnowledgeRequirement" =
|
||||
"dmn:KnowledgeRequirement";
|
||||
|
||||
interface KnowledgeRequirement extends ModdleElement {
|
||||
$type: typeof _DMN_KnowledgeRequirement;
|
||||
requiredKnowledge: ModdleElementReference;
|
||||
}
|
||||
|
||||
export { KnowledgeRequirement, _DMN_KnowledgeRequirement };
|
||||
@@ -0,0 +1,21 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
import { DMN_type_reference_ } from "./enums";
|
||||
|
||||
const _DMN_LiteralExpression: "dmn:LiteralExpression" = "dmn:LiteralExpression";
|
||||
|
||||
interface LiteralExpression extends ModdleElement {
|
||||
$type: typeof _DMN_LiteralExpression;
|
||||
text: string;
|
||||
typeRef: DMN_type_reference_;
|
||||
}
|
||||
|
||||
function Is_DMN_LiteralExpression(me: ModdleElement): me is LiteralExpression {
|
||||
return (
|
||||
"$type" in me &&
|
||||
me.$type === _DMN_LiteralExpression &&
|
||||
"text" in me &&
|
||||
"typeRef" in me
|
||||
);
|
||||
}
|
||||
|
||||
export { LiteralExpression, _DMN_LiteralExpression, Is_DMN_LiteralExpression };
|
||||
@@ -1,7 +1,29 @@
|
||||
export interface ModdleElement {
|
||||
// $attrs: Object; // Unused...
|
||||
id: string;
|
||||
// type ModdleElement = {
|
||||
// id: string;
|
||||
// $type: string;
|
||||
// name?: string;
|
||||
// $parent?: ModdleElement;
|
||||
// };
|
||||
|
||||
class ModdleElement {
|
||||
readonly $type: string = "dmn:ModdleElement";
|
||||
|
||||
id: string = "";
|
||||
name?: string;
|
||||
$parent: ModdleElement | undefined;
|
||||
$type: string;
|
||||
$parent?: ModdleElement;
|
||||
|
||||
getName(): string {
|
||||
if (!this.name) return `${this.$type}${this.id}`;
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
export { ModdleElement };
|
||||
|
||||
// export interface ModdleElement {
|
||||
// // $attrs: Object; // Unused...
|
||||
// id: string;
|
||||
// name?: string;
|
||||
// $parent: ModdleElement | undefined;
|
||||
// $type: string;
|
||||
// }
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
|
||||
const _DMN_DMNElementReference: "dmn:DMNElementReference" =
|
||||
"dmn:DMNElementReference";
|
||||
interface ModdleElementReference extends ModdleElement {
|
||||
$type: typeof _DMN_DMNElementReference;
|
||||
href: string; // Example: "#temperature_id"
|
||||
}
|
||||
|
||||
export { ModdleElementReference, _DMN_DMNElementReference };
|
||||
+28
-21
@@ -1,38 +1,38 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
|
||||
import { DMN_DecisionTable } from "./DMN_DecisionTable";
|
||||
import { DMN_Decision } from "./DMN_Decision";
|
||||
import { DecisionTable } from "./DecisionTable";
|
||||
import { Decision } from "./Decision";
|
||||
import { DmnError } from "../error/DmnError";
|
||||
import {
|
||||
_Get_type_reference_from_DMN_Definitions,
|
||||
DMN_Definitions,
|
||||
} from "./DMN_Definitions";
|
||||
import { DMN_UnaryTests } from "./DMN_UnaryTests";
|
||||
Definitions,
|
||||
} from "./Definitions";
|
||||
import { UnaryTests } from "./UnaryTests";
|
||||
import {
|
||||
_Extract_enumeration_values,
|
||||
DMN_type_reference_,
|
||||
Is_DMN_type_reference_,
|
||||
} from "./DMN_enums";
|
||||
} from "./enums";
|
||||
|
||||
const _DMN_OutputClause: "dmn:OutputClause" = "dmn:OutputClause";
|
||||
|
||||
export interface DMN_OutputClause extends ModdleElement {
|
||||
$parent: DMN_DecisionTable; // Overriding...
|
||||
interface OutputClause extends ModdleElement {
|
||||
$parent: DecisionTable; // Overriding...
|
||||
$type: typeof _DMN_OutputClause;
|
||||
label?: string;
|
||||
outputValues?: DMN_UnaryTests;
|
||||
outputValues?: UnaryTests;
|
||||
typeRef?: DMN_type_reference_;
|
||||
}
|
||||
|
||||
export function Get_enumeration_from_DMN_OutputClause(
|
||||
me: DMN_OutputClause
|
||||
): Array<any> | never {
|
||||
function Get_enumeration_from_DMN_OutputClause(
|
||||
me: OutputClause
|
||||
): any[] | never {
|
||||
// if (Trace)
|
||||
// console.assert(_Is_DMN_OutputClause_enumeration_(me), "Get_enumeration_from_DMN_OutputClause >> '_Is_DMN_OutputClause_enumeration_(me)', untrue");
|
||||
let type_reference = me.typeRef;
|
||||
if (Is_DMN_type_reference_(type_reference) === false) {
|
||||
type_reference = _Get_type_reference_from_DMN_Definitions(
|
||||
me.$parent.$parent.$parent as DMN_Definitions,
|
||||
me.$parent.$parent.$parent as Definitions,
|
||||
type_reference
|
||||
);
|
||||
if (type_reference === undefined)
|
||||
@@ -67,14 +67,12 @@ export function Get_enumeration_from_DMN_OutputClause(
|
||||
}
|
||||
}
|
||||
|
||||
export function _Is_DMN_OutputClause_enumeration_(
|
||||
me: DMN_OutputClause
|
||||
): boolean {
|
||||
function _Is_DMN_OutputClause_enumeration_(me: OutputClause): boolean {
|
||||
// 'typeRef' may be missing even though 'outputValues' is present -> "enumeration" anyway...
|
||||
return /*'typeRef' in me &&*/ "outputValues" in me;
|
||||
}
|
||||
|
||||
export function Name_of_DMN_OutputClause(me: DMN_OutputClause): string {
|
||||
function Name_of_DMN_OutputClause(me: OutputClause): string {
|
||||
return "label" in me
|
||||
? me.label!
|
||||
: "name" in me
|
||||
@@ -86,12 +84,12 @@ export function Name_of_DMN_OutputClause(me: DMN_OutputClause): string {
|
||||
: me.id;
|
||||
}
|
||||
|
||||
export function Type_of_DMN_OutputClause(
|
||||
me: DMN_OutputClause,
|
||||
decision: DMN_Decision,
|
||||
function Type_of_DMN_OutputClause(
|
||||
me: OutputClause,
|
||||
decision: Decision,
|
||||
primitive_type = false
|
||||
): DMN_type_reference_ | never {
|
||||
if (primitive_type === false && _Is_DMN_OutputClause_enumeration_(me))
|
||||
if (!primitive_type && _Is_DMN_OutputClause_enumeration_(me))
|
||||
return DMN_type_reference_.ENUMERATION;
|
||||
else if ("typeRef" in me)
|
||||
if (Is_DMN_type_reference_(me.typeRef!)) return me.typeRef;
|
||||
@@ -110,3 +108,12 @@ export function Type_of_DMN_OutputClause(
|
||||
Name_of_DMN_OutputClause(me)
|
||||
);
|
||||
}
|
||||
|
||||
export {
|
||||
OutputClause,
|
||||
_DMN_OutputClause,
|
||||
Get_enumeration_from_DMN_OutputClause,
|
||||
_Is_DMN_OutputClause_enumeration_,
|
||||
Name_of_DMN_OutputClause,
|
||||
Type_of_DMN_OutputClause,
|
||||
};
|
||||
+3
-1
@@ -3,6 +3,8 @@ import { ModdleElement } from "./ModdleElement";
|
||||
const _DMN_RuleAnnotationClause: "dmn:RuleAnnotationClause" =
|
||||
"dmn:RuleAnnotationClause";
|
||||
|
||||
export interface DMN_RuleAnnotationClause extends ModdleElement {
|
||||
interface RuleAnnotationClause extends ModdleElement {
|
||||
$type: typeof _DMN_RuleAnnotationClause;
|
||||
}
|
||||
|
||||
export { RuleAnnotationClause, _DMN_RuleAnnotationClause };
|
||||
+4
-2
@@ -2,11 +2,13 @@ import { ModdleElement } from "./ModdleElement";
|
||||
|
||||
const _DMN_UnaryTests: "dmn:UnaryTests" = "dmn:UnaryTests";
|
||||
|
||||
export interface DMN_UnaryTests extends ModdleElement {
|
||||
interface UnaryTests extends ModdleElement {
|
||||
$type: typeof _DMN_UnaryTests;
|
||||
text: string;
|
||||
}
|
||||
|
||||
export function Is_DMN_UnaryTests(me: ModdleElement): me is DMN_UnaryTests {
|
||||
function Is_DMN_UnaryTests(me: ModdleElement): me is UnaryTests {
|
||||
return "$type" in me && me.$type === _DMN_UnaryTests && "text" in me;
|
||||
}
|
||||
|
||||
export { UnaryTests, _DMN_UnaryTests, Is_DMN_UnaryTests };
|
||||
@@ -1,27 +1,27 @@
|
||||
import { ModdleElement } from "./ModdleElement";
|
||||
|
||||
export const _DMiNer_ = "_DMiNer_";
|
||||
export const FEEL_range = /^[[(\]]\d{1,}\.\.\d{1,}[[)\]]$/;
|
||||
export const Trace = true; // 'false' in production mode...
|
||||
const _DMiNer_ = "_DMiNer_";
|
||||
const FEEL_range = /^[[(\]]\d{1,}\.\.\d{1,}[[)\]]$/;
|
||||
const Trace = true; // 'false' in production mode...
|
||||
|
||||
export enum Drop_mode {
|
||||
enum Drop_mode {
|
||||
FEEL = "FEEL",
|
||||
PREDICT = "PREDICT",
|
||||
TRAIN = "TRAIN",
|
||||
}
|
||||
|
||||
export enum State_mode {
|
||||
enum State_mode {
|
||||
MENU = "MENU",
|
||||
RANDOMIZE = "RANDOMIZE",
|
||||
}
|
||||
|
||||
export enum Status_mode {
|
||||
enum Status_mode {
|
||||
FELT = "FELT",
|
||||
PREDICTED = "PREDICTED",
|
||||
RANDOMIZED = "RANDOMIZED",
|
||||
}
|
||||
|
||||
export enum Hit_policy { // DMN 1.3
|
||||
enum Hit_policy { // DMN 1.3
|
||||
ANY = "ANY",
|
||||
COLLECT = "COLLECT",
|
||||
FIRST = "FIRST",
|
||||
@@ -31,12 +31,12 @@ export enum Hit_policy { // DMN 1.3
|
||||
UNIQUE = "UNIQUE",
|
||||
}
|
||||
|
||||
export function Name_of_ModdleElement(me: ModdleElement): string {
|
||||
function Name_of_ModdleElement(me: ModdleElement): string {
|
||||
return "name" in me ? me.name! : me.$type + me.id;
|
||||
}
|
||||
|
||||
// https://docs.camunda.org/manual/7.18/user-guide/dmn-engine/data-types/#supported-data-types
|
||||
export enum DMN_type_reference_ {
|
||||
enum DMN_type_reference_ {
|
||||
BOOLEAN = "boolean",
|
||||
DATE = "date",
|
||||
DOUBLE = "double",
|
||||
@@ -47,7 +47,7 @@ export enum DMN_type_reference_ {
|
||||
STRING = "string",
|
||||
}
|
||||
|
||||
export function Is_DMN_type_reference_(
|
||||
function Is_DMN_type_reference_(
|
||||
type_reference: string | undefined
|
||||
): type_reference is DMN_type_reference_ {
|
||||
if (type_reference === undefined) return false;
|
||||
@@ -56,41 +56,26 @@ export function Is_DMN_type_reference_(
|
||||
);
|
||||
}
|
||||
|
||||
export type DMN_type_reference = boolean | Date | number | string;
|
||||
type DMN_type_reference = boolean | Date | number | string;
|
||||
|
||||
export type TensorFlow_datum = Array<Array<0 | 1> | DMN_type_reference>;
|
||||
export type TensorFlow_data = Array<TensorFlow_datum>;
|
||||
type TensorFlow_datum = Array<Array<0 | 1> | DMN_type_reference>;
|
||||
type TensorFlow_data = Array<TensorFlow_datum>;
|
||||
|
||||
/**
|
||||
* A decision service exposes one or more
|
||||
* decisions from a decision model as a reusable element, a service, which might be consumed (for example) internally by
|
||||
* another decision in the decision model, or externally by a task in a BPMN process model.
|
||||
*/
|
||||
const _DMN_DecisionService: "dmn:DecisionService" = "dmn:DecisionService";
|
||||
|
||||
const _DMN_Invocation: "dmn:Invocation" = "dmn:Invocation"; // Alternative to decision table and literal expression
|
||||
|
||||
// export interface DMNDI_DMNDI extends ModdleElement {
|
||||
// $type: 'dmndi:DMNDI';
|
||||
// diagrams: Array<DMNDI_DMNDiagram>;
|
||||
// }
|
||||
function _Extract_enumeration_values(enumeration: string): string[] | null;
|
||||
|
||||
// export interface DMNDI_DMNDiagram extends ModdleElement {
|
||||
// $type: 'dmndi:DMNDiagram';
|
||||
// diagramElements: Array<ModdleElement>; // 'dmndi:DMNEdge' | 'dmndi:DMNShape'
|
||||
// }
|
||||
|
||||
export function _Extract_enumeration_values(
|
||||
enumeration: string
|
||||
): Array<string> | null;
|
||||
export function _Extract_enumeration_values(
|
||||
function _Extract_enumeration_values(
|
||||
enumeration: string,
|
||||
type_reference: DMN_type_reference_
|
||||
): Array<number> | null;
|
||||
export function _Extract_enumeration_values(
|
||||
): number[] | null;
|
||||
|
||||
function _Extract_enumeration_values(
|
||||
enumeration: string,
|
||||
type_reference?: DMN_type_reference_
|
||||
): Array<string> | Array<number> | null {
|
||||
): string[] | number[] | null {
|
||||
if (type_reference) {
|
||||
if (FEEL_range.test(enumeration)) {
|
||||
const values = enumeration.match(/\d+/g)!.map((value) => parseInt(value));
|
||||
@@ -120,3 +105,20 @@ export function _Extract_enumeration_values(
|
||||
? values
|
||||
: values.map((value) => value.replace(/^"/g, "").replace(/"$/g, ""));
|
||||
}
|
||||
|
||||
export {
|
||||
_DMiNer_,
|
||||
FEEL_range,
|
||||
Trace,
|
||||
Drop_mode,
|
||||
State_mode,
|
||||
Status_mode,
|
||||
Hit_policy,
|
||||
Name_of_ModdleElement,
|
||||
DMN_type_reference_,
|
||||
Is_DMN_type_reference_,
|
||||
DMN_type_reference,
|
||||
TensorFlow_datum,
|
||||
TensorFlow_data,
|
||||
_Extract_enumeration_values,
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
export * from "./AuthorityRequirement";
|
||||
export * from "./BusinessKnoledgeModel";
|
||||
export * from "./Context";
|
||||
export * from "./ContextEntry";
|
||||
export * from "./Data";
|
||||
export * from "./Decision";
|
||||
export * from "./DecisionRule";
|
||||
export * from "./DecisionTable";
|
||||
export * from "./Definitions";
|
||||
export * from "./enums";
|
||||
export * from "./InformationItem";
|
||||
export * from "./InformationRequirement";
|
||||
export * from "./InputClause";
|
||||
export * from "./InputData";
|
||||
export * from "./ItemDefinition";
|
||||
export * from "./KnowledgeRequirement";
|
||||
export * from "./KnowledgSource";
|
||||
export * from "./LiteralExpression";
|
||||
export * from "./ModdleElement";
|
||||
export * from "./ModdleElementReference";
|
||||
export * from "./OutputClause";
|
||||
export * from "./RuleAnnotationClause";
|
||||
export * from "./UnaryTests";
|
||||
Reference in New Issue
Block a user