parent
ee898ac624
commit
6d0fc33dae
|
|
@ -18,7 +18,7 @@ export class ForkPlugin implements ElsaPlugin {
|
|||
const props = activityModel.properties || [];
|
||||
const syntax = SyntaxNames.Json;
|
||||
const branches = props.find(x => x.name == 'Branches') || {expressions: {'Json': '[]'}, syntax: syntax};
|
||||
const expression = branches.expressions[syntax];
|
||||
const expression = branches.expressions[syntax] || '[]';
|
||||
context.outcomes = !!expression['$values'] ? expression['$values'] : parseJson(expression) || [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export class RunJavascriptPlugin implements ElsaPlugin {
|
|||
|
||||
const props = activityModel.properties || [];
|
||||
const outcomes = props.find(x => x.name == 'PossibleOutcomes') || { expressions: {'Json': ''}, syntax: SyntaxNames.Json };
|
||||
const expression = outcomes.expressions[SyntaxNames.Json];
|
||||
const expression = outcomes.expressions[SyntaxNames.Json] || '[]';
|
||||
context.outcomes = parseJson(expression) || ['Done'];
|
||||
|
||||
if(context.outcomes.length == 0)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export class StatePlugin implements ElsaPlugin {
|
|||
|
||||
const transitionsSyntax = SyntaxNames.Json;
|
||||
const transitions = props.find(x => x.name == 'Transitions') || {expressions: {'Json': '[]'}, syntax: transitionsSyntax};
|
||||
const transitionsExpression = transitions.expressions[transitionsSyntax];
|
||||
const transitionsExpression = transitions.expressions[transitionsSyntax] || '[]';
|
||||
context.outcomes = !!transitionsExpression['$values'] ? transitionsExpression['$values'] : parseJson(transitionsExpression) || [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export class SwitchPlugin implements ElsaPlugin {
|
|||
const props = activityModel.properties || [];
|
||||
const syntax = 'Switch';
|
||||
const casesProp = props.find(x => x.name == 'Cases') || { expressions: {'Switch': ''}, syntax: syntax };
|
||||
const expression = casesProp.expressions[syntax];
|
||||
const expression = casesProp.expressions[syntax] || '[]';
|
||||
const cases: Array<SwitchCase> = !!expression['$values'] ? expression['$values'] : parseJson(expression) || [];
|
||||
context.outcomes = [...cases.map(x => x.name), 'Default'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export class UserTaskPlugin implements ElsaPlugin {
|
|||
const props = activityModel.properties || [];
|
||||
const syntax = SyntaxNames.Json;
|
||||
const branches = props.find(x => x.name == 'Actions') || {expressions: {'Json': '[]'}, syntax: syntax};
|
||||
const expression = branches.expressions[syntax];
|
||||
const expression = branches.expressions[syntax] || '[]';
|
||||
context.outcomes = !!expression['$values'] ? expression['$values'] : parseJson(expression) || [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue