Skip to content

Commit 5851aab

Browse files
feat(core): changes condition script for passed by and coming in clauses
GH-9
1 parent 1b517c4 commit 5851aab

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

projects/workflows-creator/src/lib/services/bpmn/strategies/link/gateway-link.strategy.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,13 @@ export class GatewayLinkStrategy implements LinkStrategy<ModdleElement> {
322322
var taskValuePair = readObj[key];
323323
if(taskValuePair && taskValuePair.value){
324324
var readDateValue = new Date(taskValuePair.value);
325+
var today = new Date();
326+
readDateValue.setHours(0,0,0,0);
327+
today.setHours(0,0,0,0);
328+
readDateValue.setDate(readDateValue.getDate()${condition});
325329
if(${
326330
isElse ? '!' : ''
327-
}(readDateValue > new Date() && readDateValue.setDate(readDateValue.getDate()${condition}) < new Date())){
331+
}(readDateValue.valueOf() === today.valueOf())){
328332
ids.push(taskValuePair.id);
329333
}
330334
}

projects/workflows-creator/src/lib/services/bpmn/strategies/link/or-gateway-link.strategy.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,13 @@ export class OrGatewayLinkStrategy implements LinkStrategy<ModdleElement> {
161161
var taskValuePair = readObj[key];
162162
if(taskValuePair && taskValuePair.value){
163163
var readDateValue = new Date(taskValuePair.value);
164+
var today = new Date();
165+
readDateValue.setHours(0,0,0,0);
166+
today.setHours(0,0,0,0);
167+
readDateValue.setDate(readDateValue.getDate()${condition});
164168
if(${
165169
isElse ? '!' : ''
166-
}(readDateValue > new Date() && readDateValue.setDate(readDateValue.getDate()${condition}) < new Date())){
170+
}(readDateValue.valueOf() === today.valueOf())){
167171
ids.push(taskValuePair.id);
168172
}
169173
}

0 commit comments

Comments
 (0)