Skip to content

Commit

Permalink
fix: Condition block 'Data exists' not working for loopData (#1466)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kholid060 committed Oct 19, 2023
1 parent ecfec02 commit 8237a77
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/workflowEngine/utils/testConditions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import objectPath from 'object-path';
import { parseJSON } from '@/utils/helper';
import { conditionBuilder } from '@/utils/shared';
import renderString from '../templating/renderString';
import { keyParser } from '../templating/mustacheReplacer';

const isBoolStr = (str) => {
if (str === 'true') return true;
Expand Down Expand Up @@ -59,6 +60,9 @@ export default async function (conditionsArr, workflowData) {
dataPath = dataPath.slice(2, -2).trim();
}

const parsedPath = keyParser(dataPath, workflowData.refData);
dataPath = `${parsedPath.dataKey}.${parsedPath.path}`;

return objectPath.has(workflowData.refData, dataPath);
}

Expand Down

0 comments on commit 8237a77

Please sign in to comment.