@fincity/kirun-js 1.1.1 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/__tests__/engine/function/system/array/AddFirstTest.ts +29 -7
  2. package/__tests__/engine/function/system/array/AddTest.ts +21 -5
  3. package/__tests__/engine/function/system/array/BinarySearchTest.ts +26 -7
  4. package/__tests__/engine/function/system/array/CompareTest.ts +5 -1
  5. package/__tests__/engine/function/system/array/CopyTest.ts +22 -7
  6. package/__tests__/engine/function/system/array/DeleteFirstTest.ts +21 -5
  7. package/__tests__/engine/function/system/array/DeleteFromTest.ts +17 -4
  8. package/__tests__/engine/function/system/array/DeleteLastTest.ts +21 -5
  9. package/__tests__/engine/function/system/array/DeleteTest.ts +29 -9
  10. package/__tests__/engine/function/system/array/DisjointTest.ts +13 -3
  11. package/__tests__/engine/function/system/array/Equals.ts +13 -3
  12. package/__tests__/engine/function/system/array/FillTest.ts +5 -1
  13. package/__tests__/engine/function/system/array/FrequencyTest.ts +13 -3
  14. package/__tests__/engine/function/system/array/IndexOfArrayTest.ts +29 -7
  15. package/__tests__/engine/function/system/array/IndexOfTest.ts +21 -5
  16. package/__tests__/engine/function/system/array/InsertTest.ts +25 -6
  17. package/__tests__/engine/function/system/array/LastIndexOfArrayTest.ts +21 -5
  18. package/__tests__/engine/function/system/array/LastIndexOfTest.ts +25 -6
  19. package/__tests__/engine/function/system/array/MaxTest.ts +33 -24
  20. package/__tests__/engine/function/system/array/MinTest.ts +33 -24
  21. package/__tests__/engine/function/system/array/MisMatchTest.ts +17 -4
  22. package/__tests__/engine/function/system/array/ReverseTest.ts +21 -5
  23. package/__tests__/engine/function/system/array/RotateTest.ts +13 -3
  24. package/__tests__/engine/function/system/array/ShuffleTest.ts +9 -2
  25. package/__tests__/engine/function/system/array/SortTest.ts +21 -5
  26. package/__tests__/engine/function/system/array/SubArrayTest.ts +21 -5
  27. package/__tests__/engine/function/system/context/SetFunctionTest.ts +13 -3
  28. package/__tests__/engine/function/system/math/AddTest.ts +5 -3
  29. package/__tests__/engine/function/system/math/MathFunctionRepositoryTest.ts +108 -0
  30. package/__tests__/engine/function/system/math/MaximumTest.ts +38 -0
  31. package/__tests__/engine/function/system/math/MinimumTest.ts +38 -0
  32. package/__tests__/engine/function/system/math/RandomFloatTest.ts +83 -0
  33. package/__tests__/engine/function/system/math/RandomIntTest.ts +19 -11
  34. package/__tests__/engine/function/system/string/ConcatenateTest.ts +9 -2
  35. package/__tests__/engine/function/system/string/DeleteForGivenLengthTest.ts +9 -2
  36. package/__tests__/engine/function/system/string/InsertAtGivenPositionTest.ts +13 -3
  37. package/__tests__/engine/function/system/string/PostPadTest.ts +13 -3
  38. package/__tests__/engine/function/system/string/PrePadTest.ts +13 -3
  39. package/__tests__/engine/function/system/string/RegionMatchesTest.ts +13 -3
  40. package/__tests__/engine/function/system/string/ReverseTest.ts +10 -3
  41. package/__tests__/engine/function/system/string/SplitTest.ts +9 -2
  42. package/__tests__/engine/function/system/string/StringFunctionRepoTest2.ts +13 -3
  43. package/__tests__/engine/function/system/string/StringFunctionRepoTest3.ts +9 -2
  44. package/__tests__/engine/function/system/string/StringFunctionRepositoryTest.ts +33 -8
  45. package/__tests__/engine/function/system/string/ToStringTest.ts +10 -3
  46. package/__tests__/engine/function/system/string/TrimToTest.ts +9 -2
  47. package/__tests__/engine/json/schema/SchemaUtil.ts +3 -0
  48. package/__tests__/engine/json/schema/type/TypeUtilTest.ts +10 -0
  49. package/__tests__/engine/json/schema/validator/AnyOfAllOfOneOfValidatorTest.ts +38 -0
  50. package/__tests__/engine/json/schema/validator/SchemaValidatorTest.ts +67 -0
  51. package/__tests__/engine/runtime/KIRuntimeTest.ts +23 -12
  52. package/__tests__/engine/runtime/KIRuntimeWithDefinitionTest.ts +88 -0
  53. package/__tests__/engine/runtime/expression/ExpressionEvaluationTest.ts +5 -1
  54. package/dist/index.js +1 -1
  55. package/dist/index.js.map +1 -1
  56. package/dist/module.js +1 -1
  57. package/dist/module.js.map +1 -1
  58. package/dist/types.d.ts +23 -7
  59. package/dist/types.d.ts.map +1 -1
  60. package/package.json +1 -1
  61. package/src/engine/function/AbstractFunction.ts +14 -5
  62. package/src/engine/function/system/math/Maximum.ts +1 -1
  63. package/src/engine/function/system/math/Minimum.ts +1 -1
  64. package/src/engine/function/system/math/RandomFloat.ts +2 -2
  65. package/src/engine/function/system/math/RandomInt.ts +1 -1
  66. package/src/engine/json/schema/Schema.ts +4 -3
  67. package/src/engine/json/schema/SchemaUtil.ts +4 -4
  68. package/src/engine/json/schema/type/TypeUtil.ts +3 -5
  69. package/src/engine/json/schema/validator/SchemaValidator.ts +4 -1
  70. package/src/engine/model/AbstractStatement.ts +10 -0
  71. package/src/engine/model/Event.ts +15 -0
  72. package/src/engine/model/FunctionDefinition.ts +76 -29
  73. package/src/engine/model/Parameter.ts +11 -0
  74. package/src/engine/model/ParameterReference.ts +8 -1
  75. package/src/engine/model/Position.ts +5 -0
  76. package/src/engine/model/Statement.ts +16 -0
  77. package/src/engine/model/StatementGroup.ts +7 -0
  78. package/src/engine/runtime/FunctionExecutionParameters.ts +30 -0
  79. package/src/engine/runtime/KIRuntime.ts +37 -24
@@ -7,39 +7,38 @@ import { Parameter } from './Parameter';
7
7
  import { Statement } from './Statement';
8
8
  import { StatementGroup } from './StatementGroup';
9
9
 
10
+ const SCHEMA_NAME1: string = 'FunctionDefinition';
11
+ const IN_SCHEMA = new Schema()
12
+ .setNamespace(Namespaces.SYSTEM)
13
+ .setName(SCHEMA_NAME1)
14
+ .setProperties(
15
+ new Map([
16
+ ['name', Schema.ofString('name')],
17
+ ['namespace', Schema.ofString('namespace')],
18
+ ['parameters', Schema.ofArray('parameters', Parameter.SCHEMA)],
19
+ [
20
+ 'events',
21
+ Schema.ofObject('events').setAdditionalProperties(
22
+ new AdditionalPropertiesType().setSchemaValue(Event.SCHEMA),
23
+ ),
24
+ ],
25
+ [
26
+ 'steps',
27
+ Schema.ofObject('steps').setAdditionalProperties(
28
+ new AdditionalPropertiesType().setSchemaValue(Statement.SCHEMA),
29
+ ),
30
+ ],
31
+ ]),
32
+ );
33
+
34
+ IN_SCHEMA.getProperties()?.set('parts', Schema.ofArray('parts', IN_SCHEMA));
35
+
10
36
  export class FunctionDefinition extends FunctionSignature {
11
- private static readonly SCHEMA_NAME1: string = 'FunctionDefinition';
12
- public static readonly SCHEMA: Schema = new Schema()
13
- .setNamespace(Namespaces.SYSTEM)
14
- .setName(FunctionDefinition.SCHEMA_NAME1)
15
- .setProperties(
16
- new Map([
17
- ['name', Schema.ofString('name')],
18
- ['namespace', Schema.ofString('namespace')],
19
- ['parameters', Schema.ofArray('parameters', Parameter.SCHEMA)],
20
- [
21
- 'events',
22
- Schema.ofObject('events').setAdditionalProperties(
23
- new AdditionalPropertiesType().setSchemaValue(Event.SCHEMA),
24
- ),
25
- ],
26
- [
27
- 'parts',
28
- Schema.ofObject('parts').setAdditionalProperties(
29
- new AdditionalPropertiesType().setSchemaValue(FunctionSignature.SCHEMA),
30
- ),
31
- ],
32
- [
33
- 'steps',
34
- Schema.ofObject('steps').setAdditionalProperties(
35
- new AdditionalPropertiesType().setSchemaValue(Statement.SCHEMA),
36
- ),
37
- ],
38
- ]),
39
- );
37
+ public static readonly SCHEMA: Schema = IN_SCHEMA;
40
38
  private version: number = 1;
41
39
  private steps?: Map<string, Statement>;
42
40
  private stepGroups?: Map<string, StatementGroup>;
41
+ private parts?: FunctionDefinition[];
43
42
 
44
43
  constructor(name: string) {
45
44
  super(name);
@@ -66,4 +65,52 @@ export class FunctionDefinition extends FunctionSignature {
66
65
  this.stepGroups = stepGroups;
67
66
  return this;
68
67
  }
68
+
69
+ public getParts(): FunctionDefinition[] | undefined {
70
+ return this.parts;
71
+ }
72
+
73
+ public setParts(parts: FunctionDefinition[]): FunctionDefinition {
74
+ this.parts = parts;
75
+ return this;
76
+ }
77
+
78
+ public static from(json: any): FunctionDefinition {
79
+ if (!json) return new FunctionDefinition('unknown');
80
+ return new FunctionDefinition(json.name)
81
+ .setSteps(
82
+ new Map(
83
+ Object.values(json.steps ?? {})
84
+ .filter((e) => !!e)
85
+ .map((e: any) => [e.statementName, Statement.from(e)]),
86
+ ),
87
+ )
88
+ .setStepGroups(
89
+ new Map(
90
+ Object.values(json.stepGroups ?? {})
91
+ .filter((e) => !!e)
92
+ .map((e: any) => [e.statementGroupName, StatementGroup.from(e)]),
93
+ ),
94
+ )
95
+ .setParts(
96
+ Array.from(json.parts ?? [])
97
+ .filter((e) => !!e)
98
+ .map((e: any) => FunctionDefinition.from(e)),
99
+ )
100
+ .setVersion(json.version ?? 1)
101
+ .setEvents(
102
+ new Map(
103
+ Object.values(json.events ?? {})
104
+ .filter((e) => !!e)
105
+ .map((e: any) => [e.name, Event.from(e)]),
106
+ ),
107
+ )
108
+ .setParameters(
109
+ new Map(
110
+ Object.values(json.parameters ?? {})
111
+ .filter((e) => !!e)
112
+ .map((e: any) => [e.parameterName, Parameter.from(e)]),
113
+ ),
114
+ ) as FunctionDefinition;
115
+ }
69
116
  }
@@ -1,6 +1,7 @@
1
1
  import { Schema } from '../json/schema/Schema';
2
2
  import { SchemaType } from '../json/schema/type/SchemaType';
3
3
  import { TypeUtil } from '../json/schema/type/TypeUtil';
4
+ import { SchemaReferenceException } from '../json/schema/validator/exception/SchemaReferenceException';
4
5
  import { Namespaces } from '../namespaces/Namespaces';
5
6
  import { ParameterType } from './ParameterType';
6
7
 
@@ -20,9 +21,11 @@ export class Parameter {
20
21
  'variableArgument',
21
22
  Schema.of('variableArgument', SchemaType.BOOLEAN).setDefaultValue(false),
22
23
  ],
24
+ ['type', Schema.ofString('type').setEnums(['EXPRESSION', 'CONSTANT'])],
23
25
  ]),
24
26
  );
25
27
 
28
+ // Place holder for the expression parameter when required to represent an expression in the value.
26
29
  public static readonly EXPRESSION: Schema = new Schema()
27
30
  .setNamespace(Namespaces.SYSTEM)
28
31
  .setName('ParameterExpression')
@@ -94,4 +97,12 @@ export class Parameter {
94
97
  ): Parameter {
95
98
  return new Parameter(name, schema).setType(type).setVariableArgument(variableArgument);
96
99
  }
100
+
101
+ public static from(json: any): Parameter {
102
+ const paramSchema = Schema.from(json.schema);
103
+ if (!paramSchema) throw new SchemaReferenceException('', 'Parameter requires Schema');
104
+ return new Parameter(json.parameterName, paramSchema)
105
+ .setVariableArgument(!!json.variableArguments)
106
+ .setType(json.type ?? ParameterType.EXPRESSION);
107
+ }
97
108
  }
@@ -12,9 +12,9 @@ export class ParameterReference {
12
12
  .setType(TypeUtil.of(SchemaType.OBJECT))
13
13
  .setProperties(
14
14
  new Map([
15
- ['references', Schema.ofString('references')],
16
15
  ['value', Schema.ofAny('value')],
17
16
  ['expression', Schema.ofString('expression')],
17
+ ['type', Schema.ofString('type').setEnums(['EXPRESSION', 'VALUE'])],
18
18
  ]),
19
19
  );
20
20
  private type: ParameterReferenceType;
@@ -54,4 +54,11 @@ export class ParameterReference {
54
54
  public static ofValue(value: any): ParameterReference {
55
55
  return new ParameterReference(ParameterReferenceType.VALUE).setValue(value);
56
56
  }
57
+
58
+ public static from(json: any): ParameterReference[] {
59
+ if (!json) return [];
60
+ return Array.from(json).map((e: any) =>
61
+ new ParameterReference(e.type).setValue(e.value).setExpression(e.expression),
62
+ );
63
+ }
57
64
  }
@@ -37,4 +37,9 @@ export class Position {
37
37
  this.top = top;
38
38
  return this;
39
39
  }
40
+
41
+ public static from(json: any): Position {
42
+ if (!json) return new Position(-1, -1);
43
+ return new Position(json.left, json.top);
44
+ }
40
45
  }
@@ -98,4 +98,20 @@ export class Statement extends AbstractStatement {
98
98
  public static ofEntry(statement: Statement): [string, Statement] {
99
99
  return [statement.statementName, statement];
100
100
  }
101
+
102
+ public static from(json: any): Statement {
103
+ return new Statement(json.statementName, json.namespace, json.name)
104
+ .setParameterMap(
105
+ new Map<string, ParameterReference[]>(
106
+ Object.entries(json.parameterMap ?? {}).map(([k, v]) => [
107
+ k,
108
+ ParameterReference.from(v),
109
+ ]),
110
+ ),
111
+ )
112
+ .setDependentStatements(json.dependentStatements)
113
+ .setPosition(Position.from(json.position))
114
+ .setComment(json.comment)
115
+ .setDescription(json.description) as Statement;
116
+ }
101
117
  }
@@ -34,4 +34,11 @@ export class StatementGroup extends AbstractStatement {
34
34
  this.statementGroupName = statementGroupName;
35
35
  return this;
36
36
  }
37
+
38
+ public static from(json: any): StatementGroup {
39
+ return new StatementGroup(json.statementGroupName)
40
+ .setPosition(Position.from(json.position))
41
+ .setComment(json.comment)
42
+ .setDescription(json.description) as StatementGroup;
43
+ }
37
44
  }
@@ -1,3 +1,6 @@
1
+ import { Function } from '../function/Function';
2
+ import { Schema } from '../json/schema/Schema';
3
+ import { Repository } from '../Repository';
1
4
  import { ContextElement } from './ContextElement';
2
5
  import { TokenValueExtractor } from './expression/tokenextractor/TokenValueExtractor';
3
6
  import { StatementExecution } from './StatementExecution';
@@ -12,9 +15,19 @@ export class FunctionExecutionParameters {
12
15
  private statementExecution?: StatementExecution;
13
16
  private steps?: Map<string, Map<string, Map<string, any>>>;
14
17
  private count: number = 0;
18
+ private functionRepository: Repository<Function>;
19
+ private schemaRepository: Repository<Schema>;
15
20
 
16
21
  private valueExtractors: Map<string, TokenValueExtractor> = new Map();
17
22
 
23
+ public constructor(
24
+ functionRepository: Repository<Function>,
25
+ schemaRepository: Repository<Schema>,
26
+ ) {
27
+ this.functionRepository = functionRepository;
28
+ this.schemaRepository = schemaRepository;
29
+ }
30
+
18
31
  public getContext(): Map<string, ContextElement> | undefined {
19
32
  return this.context;
20
33
  }
@@ -71,4 +84,21 @@ export class FunctionExecutionParameters {
71
84
  public getValuesMap(): Map<string, TokenValueExtractor> {
72
85
  return this.valueExtractors;
73
86
  }
87
+
88
+ public getFunctionRepository(): Repository<Function> {
89
+ return this.functionRepository;
90
+ }
91
+ public setFunctionRepository(
92
+ functionRepository: Repository<Function>,
93
+ ): FunctionExecutionParameters {
94
+ this.functionRepository = functionRepository;
95
+ return this;
96
+ }
97
+ public getSchemaRepository(): Repository<Schema> {
98
+ return this.schemaRepository;
99
+ }
100
+ public setSchemaRepository(schemaRepository: Repository<Schema>): FunctionExecutionParameters {
101
+ this.schemaRepository = schemaRepository;
102
+ return this;
103
+ }
74
104
  }
@@ -43,15 +43,7 @@ export class KIRuntime extends AbstractFunction {
43
43
 
44
44
  private fd: FunctionDefinition;
45
45
 
46
- private fRepo: Repository<Function>;
47
-
48
- private sRepo: Repository<Schema>;
49
-
50
- public constructor(
51
- fd: FunctionDefinition,
52
- functionRepository: Repository<Function>,
53
- schemaRepository: Repository<Schema>,
54
- ) {
46
+ public constructor(fd: FunctionDefinition) {
55
47
  super();
56
48
  this.fd = fd;
57
49
  if (this.fd.getVersion() > KIRuntime.VERSION) {
@@ -63,9 +55,6 @@ export class KIRuntime extends AbstractFunction {
63
55
  '.',
64
56
  );
65
57
  }
66
-
67
- this.fRepo = functionRepository;
68
- this.sRepo = schemaRepository;
69
58
  }
70
59
 
71
60
  public getSignature(): FunctionSignature {
@@ -74,10 +63,18 @@ export class KIRuntime extends AbstractFunction {
74
63
 
75
64
  private async getExecutionPlan(
76
65
  context: Map<string, ContextElement>,
66
+ fep: FunctionExecutionParameters,
77
67
  ): Promise<ExecutionGraph<string, StatementExecution>> {
78
68
  let g: ExecutionGraph<string, StatementExecution> = new ExecutionGraph();
79
69
  for (let s of Array.from(this.fd.getSteps().values()))
80
- g.addVertex(this.prepareStatementExecution(context, s));
70
+ g.addVertex(
71
+ this.prepareStatementExecution(
72
+ context,
73
+ s,
74
+ fep.getFunctionRepository(),
75
+ fep.getSchemaRepository(),
76
+ ),
77
+ );
81
78
 
82
79
  let unresolvedList: Tuple2<string, string>[] = this.makeEdges(g);
83
80
 
@@ -106,6 +103,7 @@ export class KIRuntime extends AbstractFunction {
106
103
 
107
104
  let eGraph: ExecutionGraph<string, StatementExecution> = await this.getExecutionPlan(
108
105
  inContext.getContext()!,
106
+ inContext,
109
107
  );
110
108
 
111
109
  // if (logger.isDebugEnabled()) {
@@ -185,7 +183,14 @@ export class KIRuntime extends AbstractFunction {
185
183
 
186
184
  if (!(await this.allDependenciesResolvedVertex(vertex, inContext.getSteps()!)))
187
185
  executionQue.add(vertex);
188
- else await this.executeVertex(vertex, inContext, branchQue, executionQue);
186
+ else
187
+ await this.executeVertex(
188
+ vertex,
189
+ inContext,
190
+ branchQue,
191
+ executionQue,
192
+ inContext.getFunctionRepository(),
193
+ );
189
194
  }
190
195
  }
191
196
 
@@ -265,10 +270,11 @@ export class KIRuntime extends AbstractFunction {
265
270
  >
266
271
  >,
267
272
  executionQue: LinkedList<GraphVertex<string, StatementExecution>>,
273
+ fRepo: Repository<Function>,
268
274
  ) {
269
275
  let s: Statement = vertex.getData().getStatement();
270
276
 
271
- let fun: Function | undefined = this.fRepo.find(s.getNamespace(), s.getName());
277
+ let fun: Function | undefined = fRepo.find(s.getNamespace(), s.getName());
272
278
 
273
279
  if (!fun) {
274
280
  throw new KIRuntimeException(
@@ -287,7 +293,10 @@ export class KIRuntime extends AbstractFunction {
287
293
  let context: Map<string, ContextElement> = inContext.getContext()!;
288
294
 
289
295
  let result: FunctionOutput = await fun.execute(
290
- new FunctionExecutionParameters()
296
+ new FunctionExecutionParameters(
297
+ inContext.getFunctionRepository(),
298
+ inContext.getSchemaRepository(),
299
+ )
291
300
  .setContext(context)
292
301
  .setArguments(args)
293
302
  .setEvents(inContext.getEvents()!)
@@ -455,10 +464,12 @@ export class KIRuntime extends AbstractFunction {
455
464
  private prepareStatementExecution(
456
465
  context: Map<string, ContextElement>,
457
466
  s: Statement,
467
+ fRepo: Repository<Function>,
468
+ sRepo: Repository<Schema>,
458
469
  ): StatementExecution {
459
470
  let se: StatementExecution = new StatementExecution(s);
460
471
 
461
- let fun: Function | undefined = this.fRepo.find(s.getNamespace(), s.getName());
472
+ let fun: Function | undefined = fRepo.find(s.getNamespace(), s.getName());
462
473
 
463
474
  if (!fun) {
464
475
  throw new KIRuntimeException(
@@ -475,7 +486,7 @@ export class KIRuntime extends AbstractFunction {
475
486
  let refList: ParameterReference[] = param[1];
476
487
 
477
488
  if (!refList.length) {
478
- if (isNullValue(SchemaUtil.getDefaultValue(p.getSchema(), this.sRepo)))
489
+ if (isNullValue(SchemaUtil.getDefaultValue(p.getSchema(), sRepo)))
479
490
  se.addMessage(
480
491
  StatementMessageType.ERROR,
481
492
  StringFormatter.format(
@@ -487,10 +498,11 @@ export class KIRuntime extends AbstractFunction {
487
498
  }
488
499
 
489
500
  if (p.isVariableArgument()) {
490
- for (let ref of refList) this.parameterReferenceValidation(context, se, p, ref);
501
+ for (let ref of refList)
502
+ this.parameterReferenceValidation(context, se, p, ref, sRepo);
491
503
  } else {
492
504
  let ref: ParameterReference = refList[0];
493
- this.parameterReferenceValidation(context, se, p, ref);
505
+ this.parameterReferenceValidation(context, se, p, ref, sRepo);
494
506
  }
495
507
 
496
508
  paramSet.delete(p.getParameterName());
@@ -503,7 +515,7 @@ export class KIRuntime extends AbstractFunction {
503
515
 
504
516
  if (paramSet.size) {
505
517
  for (let param of Array.from(paramSet.values())) {
506
- if (isNullValue(SchemaUtil.getDefaultValue(param.getSchema(), this.sRepo)))
518
+ if (isNullValue(SchemaUtil.getDefaultValue(param.getSchema(), sRepo)))
507
519
  se.addMessage(
508
520
  StatementMessageType.ERROR,
509
521
  StringFormatter.format(
@@ -522,11 +534,12 @@ export class KIRuntime extends AbstractFunction {
522
534
  se: StatementExecution,
523
535
  p: Parameter,
524
536
  ref: ParameterReference,
537
+ sRepo: Repository<Schema>,
525
538
  ): void {
526
539
  // Breaking this execution doesn't make sense.
527
540
 
528
541
  if (!ref) {
529
- if (isNullValue(SchemaUtil.getDefaultValue(p.getSchema(), this.sRepo)))
542
+ if (isNullValue(SchemaUtil.getDefaultValue(p.getSchema(), sRepo)))
530
543
  se.addMessage(
531
544
  StatementMessageType.ERROR,
532
545
  StringFormatter.format(KIRuntime.PARAMETER_NEEDS_A_VALUE, p.getParameterName()),
@@ -534,7 +547,7 @@ export class KIRuntime extends AbstractFunction {
534
547
  } else if (ref.getType() == ParameterReferenceType.VALUE) {
535
548
  if (
536
549
  isNullValue(ref.getValue()) &&
537
- isNullValue(SchemaUtil.getDefaultValue(p.getSchema(), this.sRepo))
550
+ isNullValue(SchemaUtil.getDefaultValue(p.getSchema(), sRepo))
538
551
  )
539
552
  se.addMessage(
540
553
  StatementMessageType.ERROR,
@@ -598,7 +611,7 @@ export class KIRuntime extends AbstractFunction {
598
611
  }
599
612
  } else if (ref.getType() == ParameterReferenceType.EXPRESSION) {
600
613
  if (StringUtil.isNullOrBlank(ref.getExpression())) {
601
- if (isNullValue(SchemaUtil.getDefaultValue(p.getSchema(), this.sRepo)))
614
+ if (isNullValue(SchemaUtil.getDefaultValue(p.getSchema(), sRepo)))
602
615
  se.addMessage(
603
616
  StatementMessageType.ERROR,
604
617
  StringFormatter.format(