ActionDescriptionProcessor.updateResourceAllocationId(actionDescription); ActionDescriptionProcessor.updateResourceAllocationSlot(actionDescription); try {
private ActionDescription updateActionDescriptionForUnit(ActionDescription actionDescription, UnitRemote unitRemote) throws CouldNotPerformException { // create new builder and copy fields ActionDescription.Builder unitActionDescription = ActionDescription.newBuilder(actionDescription); // get a new resource allocation id ActionDescriptionProcessor.updateResourceAllocationId(unitActionDescription); // update the action chain ActionDescriptionProcessor.updateActionChain(unitActionDescription, actionDescription); // resource ids should only contain that unit ResourceAllocation.Builder unitResourceAllocation = unitActionDescription.getResourceAllocationBuilder(); unitResourceAllocation.clearResourceIds(); unitResourceAllocation.addResourceIds(ScopeGenerator.generateStringRep(unitRemote.getScope())); // update the id in the serviceStateDescription to that of the unit ServiceStateDescription.Builder serviceStateDescription = unitActionDescription.getServiceStateDescriptionBuilder(); serviceStateDescription.setUnitId((String) unitRemote.getId()); return unitActionDescription.build(); }
ActionDescriptionProcessor.updateResourceAllocationId(actionDescriptionBuilder);