diff --git a/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java index a380e81f..01bc9989 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-advanced-operation-portlet/docroot/WEB-INF/src/it/nextmind/liferay/portos/advanced/operation/portlet/AdvancedOperationPortlet.java @@ -184,7 +184,7 @@ public class AdvancedOperationPortlet extends MVCPortlet { long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", -1L); IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(intPraticaId); - if(WorkflowConstants.STATUS_INCOMPLETE == intPratica.getStatus()){ + if(WorkflowConstants.STATUS_INACTIVE == intPratica.getStatus()){ _log.info("AdvancedOperationPortlet --- Recovering Pratica Vidimata (INCOMPLETE ==> DRAFT) " + "with IntPraticaId " + intPraticaId); _ripristinaPratica(intPratica, WorkflowConstants.STATUS_DRAFT); @@ -241,7 +241,7 @@ public class AdvancedOperationPortlet extends MVCPortlet { long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId", -1L); IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(intPraticaId); - if(WorkflowConstants.STATUS_INCOMPLETE == intPratica.getStatus()){ + if(WorkflowConstants.STATUS_INACTIVE == intPratica.getStatus()){ _log.info("AdvancedOperationPortlet --- Recovering Pratica Vidimata (INCOMPLETE ==> APPROVED) " + "with IntPraticaId " + intPraticaId); _ripristinaPratica(intPratica, WorkflowConstants.STATUS_APPROVED); @@ -300,7 +300,9 @@ public class AdvancedOperationPortlet extends MVCPortlet { private void _ripristinaPratica(IntPratica intPratica, int status) throws PortalException, SystemException{ long docPraticaAnnullamentoId = intPratica.getDocPraticaAnnullamentoId(); - IntPraticaLocalServiceUtil.deleteFileAnnullamento(docPraticaAnnullamentoId); + if(Validator.isNotNull(docPraticaAnnullamentoId)){ + IntPraticaLocalServiceUtil.deleteFileAnnullamento(docPraticaAnnullamentoId); + } IntPraticaLocalServiceUtil.updateStatus(intPratica.getIntPraticaId(), status); }