|
|
@ -57,8 +57,6 @@ import com.liferay.portal.kernel.util.Validator; |
|
|
|
import com.liferay.portal.kernel.util.WebKeys; |
|
|
|
import com.liferay.portal.kernel.util.WebKeys; |
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowConstants; |
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowConstants; |
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowException; |
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowException; |
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowInstance; |
|
|
|
|
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowInstanceManagerUtil; |
|
|
|
|
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowLog; |
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowLog; |
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowLogManagerUtil; |
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowLogManagerUtil; |
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowTask; |
|
|
|
import com.liferay.portal.kernel.workflow.WorkflowTask; |
|
|
@ -101,6 +99,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
add(StatoPraticaConstants.NON_CONFORME); |
|
|
|
add(StatoPraticaConstants.NON_CONFORME); |
|
|
|
add(StatoPraticaConstants.NO_PARERE); |
|
|
|
add(StatoPraticaConstants.NO_PARERE); |
|
|
|
add(StatoPraticaConstants.PREAVVISO_CONTRARIO); |
|
|
|
add(StatoPraticaConstants.PREAVVISO_CONTRARIO); |
|
|
|
|
|
|
|
add(StatoPraticaConstants.VIARCH); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -109,36 +108,26 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { |
|
|
|
ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
String cmd = ParamUtil.getString(actionRequest, Constants.CMD); |
|
|
|
String cmd = ParamUtil.getString(actionRequest, Constants.CMD); |
|
|
|
|
|
|
|
|
|
|
|
if (cmd.equals(Constants.SAVE) || cmd.equals(Constants.RESET)) { |
|
|
|
if (cmd.equals(Constants.SAVE) || cmd.equals(Constants.RESET)) { |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
if (cmd.equals(Constants.SAVE)) { |
|
|
|
if (cmd.equals(Constants.SAVE)) { |
|
|
|
completeTask(actionRequest); |
|
|
|
completeTask(actionRequest); |
|
|
|
} else if (cmd.equals(Constants.RESET)) { |
|
|
|
} else if (cmd.equals(Constants.RESET)) { |
|
|
|
relaseTask(actionRequest); |
|
|
|
relaseTask(actionRequest); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String redirect = ParamUtil.getString(actionRequest, "redirect"); |
|
|
|
String redirect = ParamUtil.getString(actionRequest, "redirect"); |
|
|
|
String closeRedirect = ParamUtil.getString(actionRequest, "closeRedirect"); |
|
|
|
String closeRedirect = ParamUtil.getString(actionRequest, "closeRedirect"); |
|
|
|
|
|
|
|
|
|
|
|
if (Validator.isNotNull(closeRedirect)) { |
|
|
|
if (Validator.isNotNull(closeRedirect)) { |
|
|
|
redirect = HttpUtil.setParameter(redirect, "closeRedirect", closeRedirect); |
|
|
|
redirect = HttpUtil.setParameter(redirect, "closeRedirect", closeRedirect); |
|
|
|
|
|
|
|
|
|
|
|
SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest) |
|
|
|
SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest) |
|
|
|
+ SessionMessages.KEY_SUFFIX_CLOSE_REDIRECT, closeRedirect); |
|
|
|
+ SessionMessages.KEY_SUFFIX_CLOSE_REDIRECT, closeRedirect); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sendRedirect(actionRequest, actionResponse, redirect); |
|
|
|
sendRedirect(actionRequest, actionResponse, redirect); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
if (e instanceof WorkflowTaskDueDateException) { |
|
|
|
if (e instanceof WorkflowTaskDueDateException) { |
|
|
|
SessionErrors.add(actionRequest, e.getClass()); |
|
|
|
SessionErrors.add(actionRequest, e.getClass()); |
|
|
|
} else if (e instanceof PrincipalException || e instanceof WorkflowException) { |
|
|
|
} else if (e instanceof PrincipalException || e instanceof WorkflowException) { |
|
|
|
|
|
|
|
|
|
|
|
SessionErrors.add(actionRequest, e.getClass()); |
|
|
|
SessionErrors.add(actionRequest, e.getClass()); |
|
|
|
|
|
|
|
|
|
|
|
setForward(actionRequest, "portlet.workflow_tasks.error"); |
|
|
|
setForward(actionRequest, "portlet.workflow_tasks.error"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
throw e; |
|
|
|
throw e; |
|
|
@ -147,8 +136,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
} else if (cmd.equals("removeUO")) { |
|
|
|
} else if (cmd.equals("removeUO")) { |
|
|
|
removeUO(actionRequest); |
|
|
|
removeUO(actionRequest); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
originalStrutsPortletAction.processAction(originalStrutsPortletAction, portletConfig, |
|
|
|
originalStrutsPortletAction.processAction(originalStrutsPortletAction, portletConfig, actionRequest, |
|
|
|
actionRequest, actionResponse); |
|
|
|
actionResponse); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -161,50 +150,47 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId"); |
|
|
|
long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId"); |
|
|
|
String comment = ParamUtil.getString(actionRequest, "comment"); |
|
|
|
String comment = ParamUtil.getString(actionRequest, "comment"); |
|
|
|
|
|
|
|
|
|
|
|
WorkflowTaskManagerUtil.assignWorkflowTaskToUser(themeDisplay.getCompanyId(), |
|
|
|
WorkflowTaskManagerUtil.assignWorkflowTaskToUser(themeDisplay.getCompanyId(), themeDisplay.getUserId(), |
|
|
|
themeDisplay.getUserId(), workflowTaskId, assigneeUserId, comment, null, null); |
|
|
|
workflowTaskId, assigneeUserId, comment, null, null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void completeTask(ActionRequest actionRequest) throws Exception { |
|
|
|
protected void completeTask(ActionRequest actionRequest) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); |
|
|
|
|
|
|
|
|
|
|
|
long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId"); |
|
|
|
long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId"); |
|
|
|
|
|
|
|
|
|
|
|
String transitionName = ParamUtil.getString(actionRequest, "transitionName"); |
|
|
|
String transitionName = ParamUtil.getString(actionRequest, "transitionName"); |
|
|
|
String comment = ParamUtil.getString(actionRequest, "comment"); |
|
|
|
String comment = ParamUtil.getString(actionRequest, "comment"); |
|
|
|
boolean aggiorna = true; |
|
|
|
boolean aggiorna = true; |
|
|
|
|
|
|
|
|
|
|
|
// ADT: bug mancata problema assegnazione WF
|
|
|
|
// ADT: bug mancata problema assegnazione WF
|
|
|
|
checkPresenzaIstruttore(transitionName, workflowTaskId); |
|
|
|
checkPresenzaIstruttore(transitionName, workflowTaskId); |
|
|
|
|
|
|
|
|
|
|
|
// ADT: BUG ANOMALIA REGISTRA ESITO
|
|
|
|
// ADT: BUG ANOMALIA REGISTRA ESITO
|
|
|
|
|
|
|
|
_log.info("transitionName = " + transitionName); |
|
|
|
if (transitionName.equalsIgnoreCase("registra-esito")) { |
|
|
|
if (transitionName.equalsIgnoreCase("registra-esito")) { |
|
|
|
HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil |
|
|
|
HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil |
|
|
|
.getHttpServletRequest(actionRequest)); |
|
|
|
.getHttpServletRequest(actionRequest)); |
|
|
|
String esito = httpServletRequest.getParameter("kaleo--esito--") != null ? httpServletRequest |
|
|
|
String esito = httpServletRequest.getParameter("kaleo--esito--") != null ? httpServletRequest.getParameter( |
|
|
|
.getParameter("kaleo--esito--").trim() : ""; |
|
|
|
"kaleo--esito--").trim() : ""; |
|
|
|
String testoDocumento = httpServletRequest.getParameter("kaleo--testo_del_documento--") != null ? httpServletRequest |
|
|
|
String testoDocumento = httpServletRequest.getParameter("kaleo--testo_del_documento--") != null ? httpServletRequest |
|
|
|
.getParameter("kaleo--testo_del_documento--") : ""; |
|
|
|
.getParameter("kaleo--testo_del_documento--") : ""; |
|
|
|
|
|
|
|
if (esito.equals(StatoPraticaConstants.VIARCH)) { |
|
|
|
|
|
|
|
aggiorna = false; |
|
|
|
|
|
|
|
} |
|
|
|
if (!valoriAmmessi.contains(esito) |
|
|
|
if (!valoriAmmessi.contains(esito) |
|
|
|
|| ((esito.equalsIgnoreCase(StatoPraticaConstants.INTEGRAZIONE) || esito |
|
|
|
|| ((esito.equalsIgnoreCase(StatoPraticaConstants.INTEGRAZIONE) || esito |
|
|
|
.equalsIgnoreCase(StatoPraticaConstants.PREAVVISO_CONTRARIO)) && testoDocumento |
|
|
|
.equalsIgnoreCase(StatoPraticaConstants.PREAVVISO_CONTRARIO)) && testoDocumento.isEmpty())) { |
|
|
|
.isEmpty())) { |
|
|
|
|
|
|
|
_log.error("controllo validazione completamento task registra-esito = " + workflowTaskId |
|
|
|
_log.error("controllo validazione completamento task registra-esito = " + workflowTaskId |
|
|
|
+ " non riuscito - esito non valorizzato o esito " |
|
|
|
+ " non riuscito - esito non valorizzato o esito " + StatoPraticaConstants.INTEGRAZIONE |
|
|
|
+ StatoPraticaConstants.INTEGRAZIONE + StringPool.SLASH |
|
|
|
+ StringPool.SLASH + StatoPraticaConstants.PREAVVISO_CONTRARIO |
|
|
|
+ StatoPraticaConstants.PREAVVISO_CONTRARIO + " con testo del documento vuoto"); |
|
|
|
+ " con testo del documento vuoto"); |
|
|
|
throw new PortalException( |
|
|
|
throw new PortalException("controllo validazione completamento task registra-esito non riuscito"); |
|
|
|
"controllo validazione completamento task registra-esito non riuscito"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else if (transitionName.equalsIgnoreCase("Riassegna") || transitionName.equalsIgnoreCase("assegna")) { |
|
|
|
} else if (transitionName.equalsIgnoreCase("Riassegna") || transitionName.equalsIgnoreCase("assegna")) { |
|
|
|
HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil |
|
|
|
HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil |
|
|
|
.getHttpServletRequest(actionRequest)); |
|
|
|
.getHttpServletRequest(actionRequest)); |
|
|
|
String istruttore = httpServletRequest.getParameter("kaleo--istruttore--"); |
|
|
|
String istruttore = httpServletRequest.getParameter("kaleo--istruttore--"); |
|
|
|
if (Validator.isNull(istruttore)) { |
|
|
|
if (Validator.isNull(istruttore)) { |
|
|
|
_log.error("controllo validazione completamento task = " + transitionName + " -" |
|
|
|
_log.error("controllo validazione completamento task = " + transitionName + " -" + workflowTaskId |
|
|
|
+ workflowTaskId + " non riuscito - istruttore non presente nel workflow"); |
|
|
|
+ " non riuscito - istruttore non presente nel workflow"); |
|
|
|
throw new PortalException("controllo validazione completamento task riassegna non riuscito"); |
|
|
|
throw new PortalException("controllo validazione completamento task riassegna non riuscito"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (istruttore.startsWith("--UO--")) { |
|
|
|
if (istruttore.startsWith("--UO--")) { |
|
|
@ -215,21 +201,19 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
long roleId = RoleLocalServiceUtil.getRole(companyId, "portos_assegnatore").getRoleId(); |
|
|
|
long roleId = RoleLocalServiceUtil.getRole(companyId, "portos_assegnatore").getRoleId(); |
|
|
|
int uo = Integer.parseInt(istruttore.substring(6)); |
|
|
|
int uo = Integer.parseInt(istruttore.substring(6)); |
|
|
|
|
|
|
|
|
|
|
|
WorkflowTaskManagerUtil.assignWorkflowTaskToRole(companyId, themeDisplay.getUserId(), |
|
|
|
WorkflowTaskManagerUtil.assignWorkflowTaskToRole(companyId, themeDisplay.getUserId(), workflowTaskId, |
|
|
|
workflowTaskId, roleId, "Trasferito all'UO " + uo |
|
|
|
roleId, "Trasferito all'UO " + uo + " per assegnazione all'istruttore.\n" + comment, null, |
|
|
|
+ " per assegnazione all'istruttore.\n" + comment, null, |
|
|
|
|
|
|
|
WorkflowUtil.getWorkflowContext(controllo)); |
|
|
|
WorkflowUtil.getWorkflowContext(controllo)); |
|
|
|
pratica.setUnitaOperativa(uo); |
|
|
|
pratica.setUnitaOperativa(uo); |
|
|
|
IntPraticaLocalServiceUtil.updateIntPratica(pratica); |
|
|
|
IntPraticaLocalServiceUtil.updateIntPratica(pratica); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (aggiorna) { |
|
|
|
if (aggiorna) { |
|
|
|
Map<String, Serializable> workflowContext = new HashMap<String, Serializable>(); |
|
|
|
Map<String, Serializable> workflowContext = new HashMap<String, Serializable>(); |
|
|
|
workflowContext.put(WorkflowConstants.CONTEXT_TRANSITION_NAME, transitionName); |
|
|
|
workflowContext.put(WorkflowConstants.CONTEXT_TRANSITION_NAME, transitionName); |
|
|
|
WorkflowUtil.updateWorkflowContextWithTaskFormParameters(actionRequest, workflowContext); |
|
|
|
WorkflowUtil.updateWorkflowContextWithTaskFormParameters(actionRequest, workflowContext); |
|
|
|
WorkflowTaskManagerUtil.completeWorkflowTask(themeDisplay.getCompanyId(), |
|
|
|
WorkflowTaskManagerUtil.completeWorkflowTask(themeDisplay.getCompanyId(), themeDisplay.getUserId(), |
|
|
|
themeDisplay.getUserId(), workflowTaskId, transitionName, comment, workflowContext); |
|
|
|
workflowTaskId, transitionName, comment, workflowContext); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -245,11 +229,11 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
Map<String, Serializable> workflowContext = WorkflowUtil.getWorkflowContext(controllo); |
|
|
|
Map<String, Serializable> workflowContext = WorkflowUtil.getWorkflowContext(controllo); |
|
|
|
long roleId = RoleLocalServiceUtil.getRole(companyId, "portos_assegnatore").getRoleId(); |
|
|
|
long roleId = RoleLocalServiceUtil.getRole(companyId, "portos_assegnatore").getRoleId(); |
|
|
|
|
|
|
|
|
|
|
|
WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, userId, workflowTaskId, userId, |
|
|
|
WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, userId, workflowTaskId, userId, StringPool.BLANK, |
|
|
|
StringPool.BLANK, null, workflowContext); |
|
|
|
null, workflowContext); |
|
|
|
WorkflowTaskManagerUtil.assignWorkflowTaskToRole(companyId, userId, workflowTaskId, roleId, |
|
|
|
WorkflowTaskManagerUtil |
|
|
|
"Rimosso dalla unità operativa " + pratica.getUnitaOperativa() + ".\n" + comment, null, |
|
|
|
.assignWorkflowTaskToRole(companyId, userId, workflowTaskId, roleId, "Rimosso dalla unità operativa " |
|
|
|
workflowContext); |
|
|
|
+ pratica.getUnitaOperativa() + ".\n" + comment, null, workflowContext); |
|
|
|
pratica.setUnitaOperativa(0); |
|
|
|
pratica.setUnitaOperativa(0); |
|
|
|
IntPraticaLocalServiceUtil.updateIntPratica(pratica); |
|
|
|
IntPraticaLocalServiceUtil.updateIntPratica(pratica); |
|
|
|
} |
|
|
|
} |
|
|
@ -263,8 +247,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId"); |
|
|
|
long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId"); |
|
|
|
String comment = ParamUtil.getString(actionRequest, "comment"); |
|
|
|
String comment = ParamUtil.getString(actionRequest, "comment"); |
|
|
|
|
|
|
|
|
|
|
|
WorkflowTaskManagerUtil.assignWorkflowTaskToRole(themeDisplay.getCompanyId(), assigneeUserId, |
|
|
|
WorkflowTaskManagerUtil.assignWorkflowTaskToRole(themeDisplay.getCompanyId(), assigneeUserId, workflowTaskId, |
|
|
|
workflowTaskId, 0L, comment, null, null); |
|
|
|
0L, comment, null, null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected boolean isCheckMethodOnProcessAction() { |
|
|
|
protected boolean isCheckMethodOnProcessAction() { |
|
|
@ -294,8 +278,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
Date dueDate = PortalUtil.getDate(dueDateMonth, dueDateDay, dueDateYear, dueDateHour, dueDateMinute, |
|
|
|
Date dueDate = PortalUtil.getDate(dueDateMonth, dueDateDay, dueDateYear, dueDateHour, dueDateMinute, |
|
|
|
WorkflowTaskDueDateException.class); |
|
|
|
WorkflowTaskDueDateException.class); |
|
|
|
|
|
|
|
|
|
|
|
WorkflowTaskManagerUtil.updateDueDate(themeDisplay.getCompanyId(), themeDisplay.getUserId(), |
|
|
|
WorkflowTaskManagerUtil.updateDueDate(themeDisplay.getCompanyId(), themeDisplay.getUserId(), workflowTaskId, |
|
|
|
workflowTaskId, comment, dueDate); |
|
|
|
comment, dueDate); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final boolean _CHECK_METHOD_ON_PROCESS_ACTION = false; |
|
|
|
private static final boolean _CHECK_METHOD_ON_PROCESS_ACTION = false; |
|
|
@ -307,8 +291,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void sendRedirect(PortletConfig portletConfig, ActionRequest actionRequest, |
|
|
|
protected void sendRedirect(PortletConfig portletConfig, ActionRequest actionRequest, |
|
|
|
ActionResponse actionResponse, String redirect, String closeRedirect) throws IOException, |
|
|
|
ActionResponse actionResponse, String redirect, String closeRedirect) throws IOException, SystemException { |
|
|
|
SystemException { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isDisplaySuccessMessage(actionRequest)) { |
|
|
|
if (isDisplaySuccessMessage(actionRequest)) { |
|
|
|
addSuccessMessage(actionRequest, actionResponse); |
|
|
|
addSuccessMessage(actionRequest, actionResponse); |
|
|
@ -396,8 +379,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
|
|
|
|
|
|
|
|
protected void addSuccessMessage(ActionRequest actionRequest, ActionResponse actionResponse) { |
|
|
|
protected void addSuccessMessage(ActionRequest actionRequest, ActionResponse actionResponse) { |
|
|
|
|
|
|
|
|
|
|
|
PortletConfig portletConfig = (PortletConfig) actionRequest |
|
|
|
PortletConfig portletConfig = (PortletConfig) actionRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); |
|
|
|
.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean addProcessActionSuccessMessage = GetterUtil.getBoolean( |
|
|
|
boolean addProcessActionSuccessMessage = GetterUtil.getBoolean( |
|
|
|
portletConfig.getInitParameter("add-process-action-success-action"), true); |
|
|
|
portletConfig.getInitParameter("add-process-action-success-action"), true); |
|
|
@ -436,12 +418,10 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
long workflowTaskId = ParamUtil.getLong(renderRequest, "workflowTaskId"); |
|
|
|
long workflowTaskId = ParamUtil.getLong(renderRequest, "workflowTaskId"); |
|
|
|
WorkflowTask workflowTask = null; |
|
|
|
WorkflowTask workflowTask = null; |
|
|
|
if (workflowTaskId > 0) { |
|
|
|
if (workflowTaskId > 0) { |
|
|
|
workflowTask = WorkflowTaskManagerUtil.getWorkflowTask(themeDisplay.getCompanyId(), |
|
|
|
workflowTask = WorkflowTaskManagerUtil.getWorkflowTask(themeDisplay.getCompanyId(), workflowTaskId); |
|
|
|
workflowTaskId); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String valoreTransizioneEsito = getTransitionValue(workflowTask.getWorkflowInstanceId(), |
|
|
|
String valoreTransizioneEsito = getTransitionValue(workflowTask.getWorkflowInstanceId(), "registra-esito"); |
|
|
|
"registra-esito"); |
|
|
|
|
|
|
|
String valoreTransizioneAssegna = getTransitionValue(workflowTask.getWorkflowInstanceId(), "assegna"); |
|
|
|
String valoreTransizioneAssegna = getTransitionValue(workflowTask.getWorkflowInstanceId(), "assegna"); |
|
|
|
|
|
|
|
|
|
|
|
renderRequest.setAttribute("registra-esito-value", valoreTransizioneEsito); |
|
|
|
renderRequest.setAttribute("registra-esito-value", valoreTransizioneEsito); |
|
|
@ -451,10 +431,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
ControlloPratica controllo = getControlloPratica(workflowTask.getWorkflowInstanceId()); |
|
|
|
ControlloPratica controllo = getControlloPratica(workflowTask.getWorkflowInstanceId()); |
|
|
|
|
|
|
|
|
|
|
|
// ADT BUG BO ID=33
|
|
|
|
// ADT BUG BO ID=33
|
|
|
|
renderRequest.setAttribute( |
|
|
|
renderRequest.setAttribute("historyWorkflowEsitiLogs", |
|
|
|
"historyWorkflowEsitiLogs", |
|
|
|
getHistoryWorkfloLogs(themeDisplay, workflowTask.getWorkflowInstanceId(), renderRequest, controllo)); |
|
|
|
getHistoryWorkfloLogs(themeDisplay, workflowTask.getWorkflowInstanceId(), renderRequest, |
|
|
|
|
|
|
|
controllo)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Group group = GroupLocalServiceUtil.getGroup(controllo.getGroupId()); |
|
|
|
Group group = GroupLocalServiceUtil.getGroup(controllo.getGroupId()); |
|
|
|
User user = themeDisplay.getUser(); |
|
|
|
User user = themeDisplay.getUser(); |
|
|
@ -466,8 +444,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
org.getGroupId(), "portos_assegnatore") |
|
|
|
org.getGroupId(), "portos_assegnatore") |
|
|
|
&& (unitaOperativeUtente.contains(unitaOperativa) || unitaOperativeUtente.contains(0)); |
|
|
|
&& (unitaOperativeUtente.contains(unitaOperativa) || unitaOperativeUtente.contains(0)); |
|
|
|
|
|
|
|
|
|
|
|
KaleoInstance instance = KaleoInstanceLocalServiceUtil.getKaleoInstance(workflowTask |
|
|
|
KaleoInstance instance = KaleoInstanceLocalServiceUtil.getKaleoInstance(workflowTask.getWorkflowInstanceId()); |
|
|
|
.getWorkflowInstanceId()); |
|
|
|
|
|
|
|
KaleoInstanceToken rootToken = KaleoInstanceTokenLocalServiceUtil.getKaleoInstanceToken(instance |
|
|
|
KaleoInstanceToken rootToken = KaleoInstanceTokenLocalServiceUtil.getKaleoInstanceToken(instance |
|
|
|
.getRootKaleoInstanceTokenId()); |
|
|
|
.getRootKaleoInstanceTokenId()); |
|
|
|
|
|
|
|
|
|
|
@ -485,8 +462,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
SystemException { |
|
|
|
SystemException { |
|
|
|
|
|
|
|
|
|
|
|
ClassLoader classLoaderKaleoLog = (ClassLoader) PortletBeanLocatorUtil.locate( |
|
|
|
ClassLoader classLoaderKaleoLog = (ClassLoader) PortletBeanLocatorUtil.locate( |
|
|
|
it.tref.liferay.portos.kaleo.service.ClpSerializer.getServletContextName(), |
|
|
|
it.tref.liferay.portos.kaleo.service.ClpSerializer.getServletContextName(), "portletClassLoader"); |
|
|
|
"portletClassLoader"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DynamicQuery dqKaleoLog = DynamicQueryFactoryUtil.forClass(FormLog.class, classLoaderKaleoLog); |
|
|
|
DynamicQuery dqKaleoLog = DynamicQueryFactoryUtil.forClass(FormLog.class, classLoaderKaleoLog); |
|
|
|
dqKaleoLog.add(RestrictionsFactoryUtil.eq("workflowInstanceId", taskInstanceId)); |
|
|
|
dqKaleoLog.add(RestrictionsFactoryUtil.eq("workflowInstanceId", taskInstanceId)); |
|
|
@ -498,8 +474,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters()); |
|
|
|
JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters()); |
|
|
|
|
|
|
|
|
|
|
|
KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(taskInstanceId); |
|
|
|
KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(taskInstanceId); |
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil |
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(kaleoInstance |
|
|
|
.getControlloPratica(kaleoInstance.getClassPK()); |
|
|
|
.getClassPK()); |
|
|
|
|
|
|
|
|
|
|
|
if (json.has("esito")) { |
|
|
|
if (json.has("esito")) { |
|
|
|
String tipoEsito = StringPool.BLANK; |
|
|
|
String tipoEsito = StringPool.BLANK; |
|
|
@ -524,8 +500,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader"); |
|
|
|
PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader"); |
|
|
|
|
|
|
|
|
|
|
|
KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(taskInstanceId); |
|
|
|
KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(taskInstanceId); |
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil |
|
|
|
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(kaleoInstance |
|
|
|
.getControlloPratica(kaleoInstance.getClassPK()); |
|
|
|
.getClassPK()); |
|
|
|
|
|
|
|
|
|
|
|
return controlloPratica; |
|
|
|
return controlloPratica; |
|
|
|
} |
|
|
|
} |
|
|
@ -541,8 +517,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
logTypes.add(WorkflowLog.TASK_UPDATE); |
|
|
|
logTypes.add(WorkflowLog.TASK_UPDATE); |
|
|
|
logTypes.add(WorkflowLog.TRANSITION); |
|
|
|
logTypes.add(WorkflowLog.TRANSITION); |
|
|
|
List<WorkflowLog> workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance( |
|
|
|
List<WorkflowLog> workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance( |
|
|
|
themeDisplay.getCompanyId(), workflowInstanceId, logTypes, QueryUtil.ALL_POS, |
|
|
|
themeDisplay.getCompanyId(), workflowInstanceId, logTypes, QueryUtil.ALL_POS, QueryUtil.ALL_POS, |
|
|
|
QueryUtil.ALL_POS, WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true)); |
|
|
|
WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true)); |
|
|
|
for (WorkflowLog workflowLog : workflowLogs) { |
|
|
|
for (WorkflowLog workflowLog : workflowLogs) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
WorkflowTask wfTask = null; |
|
|
|
WorkflowTask wfTask = null; |
|
|
@ -558,12 +534,9 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
if (json.has("esito")) { |
|
|
|
if (json.has("esito")) { |
|
|
|
String tipoEsito = StringPool.BLANK; |
|
|
|
String tipoEsito = StringPool.BLANK; |
|
|
|
if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) { |
|
|
|
if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) { |
|
|
|
tipoEsito = StatoPraticaConstants.getEsitoDeposito(json |
|
|
|
tipoEsito = StatoPraticaConstants.getEsitoDeposito(json.getString("esito")); |
|
|
|
.getString("esito")); |
|
|
|
} else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica.getIntPraticaId())) { |
|
|
|
} else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica |
|
|
|
tipoEsito = StatoPraticaConstants.getEsitoAutorizzazione(json.getString("esito")); |
|
|
|
.getIntPraticaId())) { |
|
|
|
|
|
|
|
tipoEsito = StatoPraticaConstants.getEsitoAutorizzazione(json |
|
|
|
|
|
|
|
.getString("esito")); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
esitiMapByWorkflowLogID.put(workflowLog.getWorkflowLogId(), tipoEsito); |
|
|
|
esitiMapByWorkflowLogID.put(workflowLog.getWorkflowLogId(), tipoEsito); |
|
|
|
} |
|
|
|
} |
|
|
@ -592,8 +565,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
try { |
|
|
|
try { |
|
|
|
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil |
|
|
|
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil |
|
|
|
.getKaleoTaskInstanceToken(workflowTaskId); |
|
|
|
.getKaleoTaskInstanceToken(workflowTaskId); |
|
|
|
ControlloPratica controlloPratica = getControlloPratica(kaleoTaskInstanceToken |
|
|
|
ControlloPratica controlloPratica = getControlloPratica(kaleoTaskInstanceToken.getKaleoInstanceId()); |
|
|
|
.getKaleoInstanceId()); |
|
|
|
|
|
|
|
Map<String, Serializable> wfParameters = it.tref.liferay.portos.bo.util.WorkflowUtil |
|
|
|
Map<String, Serializable> wfParameters = it.tref.liferay.portos.bo.util.WorkflowUtil |
|
|
|
.getFormParameters(controlloPratica); |
|
|
|
.getFormParameters(controlloPratica); |
|
|
|
String istruttore = (String) wfParameters.get("istruttore"); |
|
|
|
String istruttore = (String) wfParameters.get("istruttore"); |
|
|
@ -602,8 +574,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
if (istruttore == null) { |
|
|
|
if (istruttore == null) { |
|
|
|
_log.info("checkPresenzaIstruttore - rilevata incongrueza WF - istruttore non presente per controlloPratica = " |
|
|
|
_log.info("checkPresenzaIstruttore - rilevata incongrueza WF - istruttore non presente per controlloPratica = " |
|
|
|
+ controlloPratica.getControlloPraticaId()); |
|
|
|
+ controlloPratica.getControlloPraticaId()); |
|
|
|
long istruttoreId = IntPraticaLocalServiceUtil.getIntPratica( |
|
|
|
long istruttoreId = IntPraticaLocalServiceUtil.getIntPratica(controlloPratica.getIntPraticaId()) |
|
|
|
controlloPratica.getIntPraticaId()).getStatusByUserId(); |
|
|
|
.getStatusByUserId(); |
|
|
|
if (istruttoreId > 0) { |
|
|
|
if (istruttoreId > 0) { |
|
|
|
String jsonFormParameters = null; |
|
|
|
String jsonFormParameters = null; |
|
|
|
Map<String, Serializable> parametri = new HashMap<String, Serializable>(); |
|
|
|
Map<String, Serializable> parametri = new HashMap<String, Serializable>(); |
|
|
@ -625,8 +597,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
_log.error("checkPresenzaIstruttore KO per workflowTaskId = " + workflowTaskId + " [" |
|
|
|
_log.error("checkPresenzaIstruttore KO per workflowTaskId = " + workflowTaskId + " [" + e.getMessage() |
|
|
|
+ e.getMessage() + " , " + e.getCause() + "]"); |
|
|
|
+ " , " + e.getCause() + "]"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|