Doesn't seem right to me to test that the string equals undefined. Using something like the following would be a better approach:
```java
String outcome = actionResultNode.hasDefined("output") ? actionResultNode.get("outcome").asString() : "";
if ("cancelled".equals(outcome) || outcome.isEmpty()) {
```

It might not matter, but also by using ```ModelNode.get()``` it will add an ```"outcome"``` node to the parameter.