}
try (BufferedWriter bw = new BufferedWriter(new FileWriter(temp))) {
bw.write(entity.getPolicyData());
- object = HumanPolicyComponent.DescribePolicy(temp);
} catch (IOException e) {
LOGGER.error("Exception Occured while Describing the Policy"+e);
- }finally{
- if(temp != null){
- try {
- Files.delete(temp.toPath());
- } catch (IOException e) {
- LOGGER.warn("Failed to delete " + temp.getName() + e);
- }
+ }
+ object = HumanPolicyComponent.DescribePolicy(temp);
+ if(temp != null){
+ try {
+ Files.delete(temp.toPath());
+ } catch (IOException e) {
+ LOGGER.warn("Failed to delete " + temp.getName() + e);
}
}
return object;
SimpleBindings peParams = new SimpleBindings();
peParams.put("oldPolicySplit_1", oldPolicySplit[1]);
peParams.put("oldPolicySplit_0", oldPolicySplit[0]);
- queryData = controller.getDataByQuery(policyEntityquery, peParams);
+ if(PolicyController.isjUnit()){
+ queryData = controller.getDataByQuery(policyEntityquery, null);
+ }else{
+ queryData = controller.getDataByQuery(policyEntityquery, peParams);
+ }
if(!queryData.isEmpty()){
entity = (PolicyEntity) queryData.get(0);
}