Check on get Mandatory

This commit is contained in:
Fabio Sinibaldi 2022-05-31 15:50:25 +02:00
parent a0ffa08813
commit 521b5c90a6
1 changed files with 3 additions and 2 deletions

View File

@ -137,8 +137,9 @@ public class SimpleLifeCycleManager extends AbstractLifeCycleManager implements
@Override
protected EventExecutionReport onDeleteDocument(EventExecutionReport report) throws ConfigurationException, InvalidPluginRequestException, MaterializationException, EventException {
// Block non draft only if not force
if(!Boolean.parseBoolean(report.getTheRequest().getWithDefault("force","false")))
blockNonDraft(report);
Boolean force=Boolean.parseBoolean(report.getTheRequest().getWithDefault("force","false"));
log.debug("ON DELETE for {} : force is {}",report.getTheRequest().getDocument().getId(),force);
if(!force) blockNonDraft(report);
// dematerialize all
JSONPathWrapper wrapper = new JSONPathWrapper(report.getTheRequest().getDocument().getTheDocument().toJson());
for (String s : wrapper.getMatchingPaths("$..[?(@." + RegisteredFileSet.PAYLOADS + ")]")){