public List<Node> getEnterableNodes(String nodeId) {
List<Node> enterableNodesList = new ArrayList<Node>();
Node node = (Node) this.findWFElementById(nodeId);
if (node instanceof Activity) {
Activity activity = (Activity) node;
Transition enteringTransition = activity.getEnteringTransition();
if (enteringTransition != null) {
Node fromNode = enteringTransition.getFromNode();
if (fromNode != null) {
enterableNodesList.add(fromNode);
enterableNodesList.addAll(getEnterableNodes(fromNode.getId()));
}
}
} else if (node instanceof Synchronizer) {
Synchronizer synchronizer = (Synchronizer) node;
List<Transition> enteringTransitions = synchronizer.getEnteringTransitions();
for (int i = 0; enteringTransitions != null
&& i < enteringTransitions.size(); i++) {
Transition enteringTransition = enteringTransitions.get(i);
if (enteringTransition != null) {
Node fromNode = enteringTransition.getFromNode();
if (fromNode != null) {
enterableNodesList.add(fromNode);
enterableNodesList.addAll(getEnterableNodes(fromNode.getId()));
}