|
|
|
@ -1268,53 +1268,56 @@ public class SismicaUtil {
|
|
|
|
|
|
|
|
|
|
public static List<String> resetFirme(long companyId, String numeroProgetto) throws SystemException, |
|
|
|
|
PortalException { |
|
|
|
|
|
|
|
|
|
List<String> esito = new ArrayList<>(); |
|
|
|
|
if (Validator.isNull(numeroProgetto)) { |
|
|
|
|
esito.addAll(firmeBloccate(companyId)); |
|
|
|
|
} else { |
|
|
|
|
IntPratica pratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); |
|
|
|
|
ControlloPratica controllo = getLastControlloPratica(pratica.getIntPraticaId()); |
|
|
|
|
KaleoInstanceToken instanceToken = findInstanceToken(controllo.getControlloPraticaId()); |
|
|
|
|
if (Validator.isNotNull(instanceToken)) { |
|
|
|
|
esitoLog(esito, "Trovato KaleoInstanceToken " + instanceToken.getKaleoInstanceTokenId() |
|
|
|
|
+ ", currentKaleoNodeName = \"" + instanceToken.getCurrentKaleoNodeName() + StringPool.QUOTE); |
|
|
|
|
if (instanceToken.getCurrentKaleoNodeName().equalsIgnoreCase("signal_ff")) { |
|
|
|
|
List<KaleoTaskInstanceToken> taskInstanceTokens = findTaskInstanceTokens(instanceToken |
|
|
|
|
.getKaleoInstanceTokenId()); |
|
|
|
|
esitoLog(esito, "Trovati " + taskInstanceTokens.size() + " KaleoTaskInstanceToken"); |
|
|
|
|
List<KaleoTaskAssignmentInstance> taskAssignmentInstances = findTaskAssignmentInstances(instanceToken |
|
|
|
|
.getKaleoInstanceId()); |
|
|
|
|
esitoLog(esito, "Trovati " + taskAssignmentInstances.size() + " KaleoTaskAssignmentInstance"); |
|
|
|
|
|
|
|
|
|
KaleoTaskInstanceToken taskInstanceToken = taskInstanceTokens.get(taskInstanceTokens.size() - 1); |
|
|
|
|
KaleoTaskAssignmentInstance taskAssignmentInstance = taskAssignmentInstances |
|
|
|
|
.get(taskAssignmentInstances.size() - 1); |
|
|
|
|
|
|
|
|
|
esitoLog(esito, |
|
|
|
|
"Cancello KaleoTaskInstanceToken " + taskInstanceToken.getKaleoTaskInstanceTokenId()); |
|
|
|
|
KaleoTaskInstanceTokenLocalServiceUtil.deleteKaleoTaskInstanceToken(taskInstanceToken); |
|
|
|
|
esitoLog( |
|
|
|
|
esito, |
|
|
|
|
"Cancello KaleoTaskAssignmentInstance " |
|
|
|
|
+ taskAssignmentInstance.getKaleoTaskAssignmentInstanceId()); |
|
|
|
|
KaleoTaskAssignmentInstanceLocalServiceUtil |
|
|
|
|
.deleteKaleoTaskAssignmentInstance(taskAssignmentInstance); |
|
|
|
|
|
|
|
|
|
taskInstanceToken = taskInstanceTokens.get(taskInstanceTokens.size() - 2); |
|
|
|
|
esitoLog(esito, |
|
|
|
|
"Aggiorno KaleoTaskInstanceToken " + taskInstanceToken.getKaleoTaskInstanceTokenId()); |
|
|
|
|
taskInstanceToken.setCompleted(false); |
|
|
|
|
taskInstanceToken.setCompletionUserId(0); |
|
|
|
|
taskInstanceToken.setCompletionDate(null); |
|
|
|
|
KaleoTaskInstanceTokenLocalServiceUtil.updateKaleoTaskInstanceToken(taskInstanceToken); |
|
|
|
|
|
|
|
|
|
esitoLog(esito, "Aggiorno KaleoInstanceToken " + instanceToken.getKaleoInstanceTokenId()); |
|
|
|
|
instanceToken.setCurrentKaleoNodeId(21639); |
|
|
|
|
instanceToken.setCurrentKaleoNodeName("Esito"); |
|
|
|
|
KaleoInstanceTokenLocalServiceUtil.updateKaleoInstanceToken(instanceToken); |
|
|
|
|
try{ |
|
|
|
|
List<String> esito = new ArrayList<>(); |
|
|
|
|
if (Validator.isNull(numeroProgetto)) { |
|
|
|
|
esito.addAll(firmeBloccate(companyId)); |
|
|
|
|
} else { |
|
|
|
|
IntPratica pratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); |
|
|
|
|
ControlloPratica controllo = getLastControlloPratica(pratica.getIntPraticaId()); |
|
|
|
|
KaleoInstanceToken instanceToken = findInstanceToken(controllo.getControlloPraticaId()); |
|
|
|
|
if (Validator.isNotNull(instanceToken)) { |
|
|
|
|
esitoLog(esito, "Trovato KaleoInstanceToken " + instanceToken.getKaleoInstanceTokenId() |
|
|
|
|
+ ", currentKaleoNodeName = \"" + instanceToken.getCurrentKaleoNodeName() + StringPool.QUOTE); |
|
|
|
|
if (instanceToken.getCurrentKaleoNodeName().equalsIgnoreCase("signal_ff")) { |
|
|
|
|
List<KaleoTaskInstanceToken> taskInstanceTokens = findTaskInstanceTokens(instanceToken |
|
|
|
|
.getKaleoInstanceTokenId()); |
|
|
|
|
esitoLog(esito, "Trovati " + taskInstanceTokens.size() + " KaleoTaskInstanceToken"); |
|
|
|
|
List<KaleoTaskAssignmentInstance> taskAssignmentInstances = findTaskAssignmentInstances(instanceToken |
|
|
|
|
.getKaleoInstanceId()); |
|
|
|
|
esitoLog(esito, "Trovati " + taskAssignmentInstances.size() + " KaleoTaskAssignmentInstance"); |
|
|
|
|
|
|
|
|
|
KaleoTaskInstanceToken taskInstanceToken = taskInstanceTokens.get(taskInstanceTokens.size() - 1); |
|
|
|
|
KaleoTaskAssignmentInstance taskAssignmentInstance = taskAssignmentInstances |
|
|
|
|
.get(taskAssignmentInstances.size() - 1); |
|
|
|
|
|
|
|
|
|
esitoLog(esito, |
|
|
|
|
"Cancello KaleoTaskInstanceToken " + taskInstanceToken.getKaleoTaskInstanceTokenId()); |
|
|
|
|
KaleoTaskInstanceTokenLocalServiceUtil.deleteKaleoTaskInstanceToken(taskInstanceToken); |
|
|
|
|
esitoLog( |
|
|
|
|
esito, |
|
|
|
|
"Cancello KaleoTaskAssignmentInstance " |
|
|
|
|
+ taskAssignmentInstance.getKaleoTaskAssignmentInstanceId()); |
|
|
|
|
KaleoTaskAssignmentInstanceLocalServiceUtil |
|
|
|
|
.deleteKaleoTaskAssignmentInstance(taskAssignmentInstance); |
|
|
|
|
|
|
|
|
|
taskInstanceToken = taskInstanceTokens.get(taskInstanceTokens.size() - 2); |
|
|
|
|
esitoLog(esito, |
|
|
|
|
"Aggiorno KaleoTaskInstanceToken " + taskInstanceToken.getKaleoTaskInstanceTokenId()); |
|
|
|
|
taskInstanceToken.setCompleted(false); |
|
|
|
|
taskInstanceToken.setCompletionUserId(0); |
|
|
|
|
taskInstanceToken.setCompletionDate(null); |
|
|
|
|
KaleoTaskInstanceTokenLocalServiceUtil.updateKaleoTaskInstanceToken(taskInstanceToken); |
|
|
|
|
|
|
|
|
|
esitoLog(esito, "Aggiorno KaleoInstanceToken " + instanceToken.getKaleoInstanceTokenId()); |
|
|
|
|
instanceToken.setCurrentKaleoNodeId(21639); |
|
|
|
|
instanceToken.setCurrentKaleoNodeName("Esito"); |
|
|
|
|
KaleoInstanceTokenLocalServiceUtil.updateKaleoInstanceToken(instanceToken); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}catch(Exception e){ |
|
|
|
|
_log.error(e, e); |
|
|
|
|
} |
|
|
|
|
return esito; |
|
|
|
|
} |
|
|
|
|