private Node generateWhile(final Scope scope, final While while_,
final BPELProcess bpelprocess) throws CoreException {
this.log.finest("start generate while");
Node whileNode = null;
if (while_ != null) {
final BPELBooleanExpression copy = (BPELBooleanExpression) while_
.getCondition().copypaste();
if (!this.log.getName().equals(BPELCompilerImpl.class.getName())) {
copy.setLog(this.log);
}
final List<Node> childNodes = new ArrayList<Node>();
Node activityNode = null;
activityNode = this.generateActivity(scope, while_.getActivity(),
bpelprocess);
if (activityNode != null) {
childNodes.add(activityNode);
} else {
throw new CoreException("Impossible to generate activity: "
+ while_.getActivity());
}
whileNode = CreationPatternFactory.getInstance().createLoopPattern(
while_.getName(), copy, true, childNodes, scope, null);
}
this.log.finest("end generate while");
return whileNode;
}