DFDeploymentStatus ds = commandRunner.run();
DFDeploymentStatus mainStatus = ds.getMainStatus();
if (!po.checkStatusAndAddStage((TargetImpl)targets[i], localStrings.getLocalString("enterprise.deployment.client.undeploy_remove_ref", "While undeploying, trying to remove reference for application in target {0}", targets[i].getName()), mainStatus)) {
return po;
} else {
TargetModuleIDImpl targetModuleID =
new TargetModuleIDImpl((TargetImpl)targets[i], moduleID);
targetModuleIDList.add(targetModuleID);
}
}
// then undeploy from last target
Target lastTarget = targets[targets.length -1];
undeploymentOptions.put(DFDeploymentProperties.TARGET, lastTarget.getName());
DFCommandRunner commandRunner2 = getDFCommandRunner(
"undeploy",
undeploymentOptions,
new String[]{moduleID});
DFDeploymentStatus ds2 = commandRunner2.run();
DFDeploymentStatus mainStatus2 = ds2.getMainStatus();
if (!po.checkStatusAndAddStage((TargetImpl)lastTarget, localStrings.getLocalString("enterprise.deployment.client.undeploy_from_target", "Trying to undeploy application from target {0}", lastTarget.getName()), mainStatus2)) {
return po;
}
TargetModuleIDImpl targetModuleID =
new TargetModuleIDImpl((TargetImpl)lastTarget, moduleID);
targetModuleIDList.add(targetModuleID);
TargetModuleIDImpl[] targetModuleIDs =
new TargetModuleIDImpl[targetModuleIDList.size()];
targetModuleIDs = (TargetModuleIDImpl[])targetModuleIDList.toArray(targetModuleIDs);