Skip to content

Commit

Permalink
Simplified getBusinessContext method.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Mar 3, 2017
1 parent 7ba0767 commit 2f53ee1
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -269,9 +269,11 @@ public static OperationBusinessContextType getBusinessContext(WfContextType wfc)
if (wfc == null) {
return null;
}
return wfc.getEvent().stream()
.filter(e -> e instanceof WfProcessCreationEventType && ((WfProcessCreationEventType) e).getBusinessContext() != null)
.map(e -> ((WfProcessCreationEventType) e).getBusinessContext())
.findFirst().orElse(null);
for (WfProcessEventType event : wfc.getEvent()) {
if (event instanceof WfProcessCreationEventType) {
return ((WfProcessCreationEventType) event).getBusinessContext();
}
}
return null;
}
}

0 comments on commit 2f53ee1

Please sign in to comment.