/** * Emits an event after landing on to a particular node on the specified tree. Event subject is the eventId associated with the action. * * @param node landing node * @param params extra information to be passed */ public void sendActionsAfter(Node node, Map<String, Object> params) { Assert.notNull(node, "Node must not be null"); Assert.notNull(params, "Params must not be null"); sendActions(node.getActionsAfter(), params); }
/** * Emits an event after landing on to a particular node on the specified tree. Event subject is the eventId associated with the action. * * @param node landing node * @param params extra information to be passed */ public void sendActionsAfter(Node node, Map<String, Object> params) { Assert.notNull(node, "Node must not be null"); Assert.notNull(params, "Params must not be null"); sendActions(node.getActionsAfter(), params); }
private boolean hasNoActions(Node node) { return node.getActionsAfter().isEmpty() && node.getActionsBefore().isEmpty(); }
private boolean hasNoActions(Node node) { return node.getActionsAfter().isEmpty() && node.getActionsBefore().isEmpty(); }
private static NodeRecord convertToNodeRecord(final Node node, final Long id) { NodeRecord nodeRecord = new NodeRecord(); nodeRecord.setId(id); nodeRecord.setName(String.format("Message%d", id)); Prompt p = node.getPrompts().get(0); if (p instanceof TextToSpeechPrompt) { nodeRecord.setMessage(((TextToSpeechPrompt) p).getMessage()); } List<Action> actionBefore = node.getActionsBefore(); List<String> actionBeforeRecords = new ArrayList<>(actionBefore.size()); for (Action action : actionBefore) { actionBeforeRecords.add(action.getEventId()); } nodeRecord.setActionsBefore(actionBeforeRecords); List<Action> actionAfter = node.getActionsAfter(); List<String> actionAfterRecords = new ArrayList<>(actionAfter.size()); for (Action action : actionAfter) { actionAfterRecords.add(action.getEventId()); } nodeRecord.setActionsAfter(actionAfterRecords); return nodeRecord; }