private static boolean eval(ExecutionContext ctx, SequenceFlow f) throws ExecutionException { String expr = f.getExpression(); Boolean b = ctx.eval(expr, Boolean.class); if (b == null) { throw new ExecutionException("'{}' expected a boolean value, got null. Possibly undefined variable.", expr); } log.debug("eval ['{}', '{}'] -> {}", f.getId(), f.getExpression(), b); return b; }
private static List<SequenceFlow> filterInactive(ExecutionContext ctx, List<SequenceFlow> flows) throws ExecutionException { List<SequenceFlow> result = new ArrayList<>(flows); for (Iterator<SequenceFlow> i = result.iterator(); i.hasNext(); ) { SequenceFlow f = i.next(); if (f.getExpression() != null) { String expr = f.getExpression(); Boolean b = ctx.eval(expr, Boolean.class); if (b == null) { throw new ExecutionException("'{}' expected a boolean value, got null. Possibly undefined variable.", expr); } if (!b) { i.remove(); } } } return result; } }
SequenceFlow f = (SequenceFlow) e; b.append(" ").append(f.getFrom()).append(" -> ").append(f.getTo()); if (f.getExpression() != null) { b.append(" ").append(f.getExpression());
private static void print(AbstractElement e, int level) { if (e instanceof SequenceFlow) { SequenceFlow f = (SequenceFlow) e; System.out.println(ident(level) + e.getClass() + ": id=" + e.getId() + " // " + f.getFrom() + " -> " + f.getTo() + " // " + f.getExpression()); } else { System.out.println(ident(level) + e.getClass() + ": id=" + e.getId()); } if (e instanceof ProcessDefinition) { ProcessDefinition pd = (ProcessDefinition) e; for (AbstractElement c : pd.getChildren()) { print(c, level + 1); } } }
for (Iterator<SequenceFlow> i = flows.iterator(); i.hasNext(); ) { SequenceFlow f = i.next(); if (f.getExpression() == null) { continue;
if (f.getExpression() != null) { log.warn("reduce ['{}', '{}', '{}'] -> flow expressions are not supported for event gateways", state.getBusinessKey(), a);