if (obligationValue!= null){
if (ObligationScopeType.action.equals(obligationScope)){
if (!PolicyHelper.hasObligationWithId(actionPolicy, obligationValue)){
ObligationWizard owiz = new ObligationWizard(obligationValue);
ObligationsType obligations = ObligationsHelper.build();
obligations.getObligations().add(owiz.getXACML());
actionPolicy.setObligations(obligations);
}
}else{
PolicySetType resourcePolicySet = findResourcePolicySet(papContainer);
if (!PolicySetHelper.hasObligationWithId(resourcePolicySet, obligationValue)){
ObligationWizard owiz = new ObligationWizard(obligationValue);
ObligationsType obligations = ObligationsHelper.build();
obligations.getObligations().add(owiz.getXACML());
resourcePolicySet.setObligations(obligations);
}
}
}