Incremental pull remediation improvements (#283)
* do not stop on first error while pulling in incremental mode
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPullResultHandler.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPullResultHandler.java
index 94cb8af..67d245d 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPullResultHandler.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPullResultHandler.java
@@ -250,9 +250,10 @@
result.setMessage(ExceptionUtils.getRootCauseMessage(e));
LOG.error("Could not create {} {} ", provision.getAnyType().getKey(), delta.getUid().getUidValue(), e);
output = e;
- resultStatus = Result.FAILURE;
if (profile.getTask().isRemediation()) {
+ // set to SUCCESS to let the incremental flow go on in case of errors
+ resultStatus = Result.SUCCESS;
Remediation entity = entityFactory.newEntity(Remediation.class);
entity.setAnyType(provision.getAnyType());
entity.setOperation(ResourceOperation.CREATE);
@@ -265,6 +266,8 @@
}
remediationDAO.save(entity);
+ } else {
+ resultStatus = Result.FAILURE;
}
}
@@ -375,9 +378,11 @@
LOG.error("Could not update {} {}",
provision.getAnyType().getKey(), delta.getUid().getUidValue(), e);
output = e;
- resultStatus = Result.FAILURE;
if (profile.getTask().isRemediation()) {
+ // set to SUCCESS to let the incremental flow go on in case of errors
+ resultStatus = Result.SUCCESS;
+
Remediation entity = entityFactory.newEntity(Remediation.class);
entity.setAnyType(provision.getAnyType());
entity.setOperation(ResourceOperation.UPDATE);
@@ -388,6 +393,8 @@
entity.setPullTask(profile.getTask());
remediationDAO.save(entity);
+ } else {
+ resultStatus = Result.FAILURE;
}
}
}
@@ -680,6 +687,8 @@
output = e;
if (profile.getTask().isRemediation()) {
+ // set to SUCCESS to let the incremental flow go on in case of errors
+ resultStatus = Result.SUCCESS;
Remediation entity = entityFactory.newEntity(Remediation.class);
entity.setAnyType(provision.getAnyType());
entity.setOperation(ResourceOperation.DELETE);