@ -126,8 +126,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
}
}
}
}
} else {
} else {
originalStrutsPortletAction . processAction ( originalStrutsPortletAction , portletConfig , actionRequest ,
originalStrutsPortletAction . processAction ( originalStrutsPortletAction , portletConfig ,
actionResponse ) ;
actionRequest , actionResponse ) ;
}
}
}
}
@ -140,14 +140,10 @@ 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 ( ) , themeDisplay . getUser Id ( ) ,
WorkflowTaskManagerUtil . assignWorkflowTaskToUser ( themeDisplay . getCompanyId ( ) ,
workflowTaskId , assigneeUserId , comment , null , null ) ;
themeDisplay . getUserId ( ) , 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 ) ;
@ -162,23 +158,32 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
// ADT: BUG ANOMALIA REGISTRA ESITO
// ADT: BUG ANOMALIA REGISTRA ESITO
if ( transitionName . equalsIgnoreCase ( "registra-esito" ) ) {
if ( transitionName . equalsIgnoreCase ( "registra-esito" ) ) {
HttpServletRequest httpServletRequest = PortalUtil . getOriginalServletRequest ( PortalUtil . getHttpServletRequest ( actionRequest ) ) ;
HttpServletRequest httpServletRequest = PortalUtil . getOriginalServletRequest ( PortalUtil
String esito = httpServletRequest . getParameter ( "kaleo--esito--" ) ! = null ? httpServletRequest . getParameter ( "kaleo--esito--" ) . trim ( ) : "" ;
. getHttpServletRequest ( actionRequest ) ) ;
String testoDocumento = httpServletRequest . getParameter ( "kaleo--testo_del_documento--" ) ! = null ? httpServletRequest . getParameter ( "kaleo--testo_del_documento--" ) : "" ;
String esito = httpServletRequest . getParameter ( "kaleo--esito--" ) ! = null ? httpServletRequest
. getParameter ( "kaleo--esito--" ) . trim ( ) : "" ;
String testoDocumento = httpServletRequest . getParameter ( "kaleo--testo_del_documento--" ) ! = null ? httpServletRequest
. getParameter ( "kaleo--testo_del_documento--" ) : "" ;
List < String > valoriAmmessi = Arrays . asList ( "AL" , "NC" , "CO" , "IN" ) ;
List < String > valoriAmmessi = Arrays . asList ( "AL" , "NC" , "CO" , "IN" ) ;
if ( ! valoriAmmessi . contains ( esito ) | | ( esito . equalsIgnoreCase ( "IN" ) & & testoDocumento . isEmpty ( ) ) ) {
if ( ! valoriAmmessi . contains ( esito ) | | ( esito . equalsIgnoreCase ( "IN" ) & & testoDocumento . isEmpty ( ) ) ) {
_log . error ( "controllo validazione completamento task registra-esito = " + workflowTaskId + " non riuscito - esito non valorizzato o esito IN con testo del documento vuoto" ) ;
_log . error ( "controllo validazione completamento task registra-esito = " + workflowTaskId
throw new PortalException ( "controllo validazione completamento task registra-esito non riuscito" ) ;
+ " non riuscito - esito non valorizzato o esito IN con testo del documento vuoto" ) ;
throw new PortalException (
"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 . getHttpServletRequest ( actionRequest ) ) ;
HttpServletRequest httpServletRequest = PortalUtil . getOriginalServletRequest ( PortalUtil
String istr = httpServletRequest . getParameter ( "kaleo--istruttore--" ) ! = null ? httpServletRequest . getParameter ( "kaleo--istruttore--" ) . trim ( ) : "" ;
. getHttpServletRequest ( actionRequest ) ) ;
String istr = httpServletRequest . getParameter ( "kaleo--istruttore--" ) ! = null ? httpServletRequest
. getParameter ( "kaleo--istruttore--" ) . trim ( ) : "" ;
if ( istr . isEmpty ( ) ) {
if ( istr . isEmpty ( ) ) {
_log . error ( "controllo validazione completamento task = " + transitionName + " -" + workflowTaskId + " non riuscito - esito non valorizzato o esito IN con testo del documento vuoto" ) ;
_log . error ( "controllo validazione completamento task = " + transitionName + " -"
throw new PortalException ( "controllo validazione completamento task registra-esito non riuscito" ) ;
+ workflowTaskId
+ " non riuscito - esito non valorizzato o esito IN con testo del documento vuoto" ) ;
throw new PortalException (
"controllo validazione completamento task registra-esito non riuscito" ) ;
}
}
}
}
/////////////////////////////////////////////////////////
Map < String , Serializable > workflowContext = new HashMap < String , Serializable > ( ) ;
Map < String , Serializable > workflowContext = new HashMap < String , Serializable > ( ) ;
@ -186,8 +191,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
WorkflowUtil . updateWorkflowContextWithTaskFormParameters ( actionRequest , workflowContext ) ;
WorkflowUtil . updateWorkflowContextWithTaskFormParameters ( actionRequest , workflowContext ) ;
WorkflowTaskManagerUtil . completeWorkflowTask ( themeDisplay . getCompanyId ( ) , themeDisplay . getUserId ( ) , workflowTaskId ,
WorkflowTaskManagerUtil . completeWorkflowTask ( themeDisplay . getCompanyId ( ) , themeDisplay . getUserId ( ) ,
transitionName , comment , workflowContext ) ;
workflowTaskId , transitionName , comment , workflowContext ) ;
}
}
protected void relaseTask ( ActionRequest actionRequest ) throws Exception {
protected void relaseTask ( ActionRequest actionRequest ) throws Exception {
@ -199,8 +204,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 , workflowTaskId , 0L ,
WorkflowTaskManagerUtil . assignWorkflowTaskToRole ( themeDisplay . getCompanyId ( ) , assigneeUserId ,
comment , null , null ) ;
workflowTaskId , 0L , comment , null , null ) ;
}
}
protected boolean isCheckMethodOnProcessAction ( ) {
protected boolean isCheckMethodOnProcessAction ( ) {
@ -227,12 +232,11 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
dueDateHour + = 12 ;
dueDateHour + = 12 ;
}
}
Date dueDate =
Date dueDate = PortalUtil . getDate ( dueDateMonth , dueDateDay , dueDateYear , dueDateHour , dueDateMinute ,
PortalUtil . getDate ( dueDateMonth , dueDateDay , dueDateYear , dueDateHour , dueDateMinute ,
WorkflowTaskDueDateException . class ) ;
WorkflowTaskDueDateException . class ) ;
WorkflowTaskManagerUtil . updateDueDate ( themeDisplay . getCompanyId ( ) , themeDisplay . getUserId ( ) , workflowTaskId ,
WorkflowTaskManagerUtil . updateDueDate ( themeDisplay . getCompanyId ( ) , themeDisplay . getUserId ( ) ,
comment , dueDate ) ;
workflowTaskId , comment , dueDate ) ;
}
}
private static final boolean _CHECK_METHOD_ON_PROCESS_ACTION = false ;
private static final boolean _CHECK_METHOD_ON_PROCESS_ACTION = false ;
@ -243,8 +247,9 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
sendRedirect ( null , actionRequest , actionResponse , redirect , null ) ;
sendRedirect ( null , actionRequest , actionResponse , redirect , null ) ;
}
}
protected void sendRedirect ( PortletConfig portletConfig , ActionRequest actionRequest , ActionResponse actionResponse ,
protected void sendRedirect ( PortletConfig portletConfig , ActionRequest actionRequest ,
String redirect , String closeRedirect ) throws IOException , SystemException {
ActionResponse actionResponse , String redirect , String closeRedirect ) throws IOException ,
SystemException {
if ( isDisplaySuccessMessage ( actionRequest ) ) {
if ( isDisplaySuccessMessage ( actionRequest ) ) {
addSuccessMessage ( actionRequest , actionResponse ) ;
addSuccessMessage ( actionRequest , actionResponse ) ;
@ -332,10 +337,11 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
protected void addSuccessMessage ( ActionRequest actionRequest , ActionResponse actionResponse ) {
protected void addSuccessMessage ( ActionRequest actionRequest , ActionResponse actionResponse ) {
PortletConfig portletConfig = ( PortletConfig ) actionRequest . getAttribute ( JavaConstants . JAVAX_PORTLET_CONFIG ) ;
PortletConfig portletConfig = ( PortletConfig ) actionRequest
. getAttribute ( JavaConstants . JAVAX_PORTLET_CONFIG ) ;
boolean addProcessActionSuccessMessage =
boolean addProcessActionSuccessMessage = GetterUtil . getBoolean (
GetterUtil . getBoolean ( portletConfig . getInitParameter ( "add-process-action-success-action" ) , true ) ;
portletConfig . getInitParameter ( "add-process-action-success-action" ) , true ) ;
if ( ! addProcessActionSuccessMessage ) {
if ( ! addProcessActionSuccessMessage ) {
return ;
return ;
@ -373,10 +379,12 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
WorkflowTask workflowTask = null ;
WorkflowTask workflowTask = null ;
if ( workflowTaskId > 0 ) {
if ( workflowTaskId > 0 ) {
workflowTask = WorkflowTaskManagerUtil . getWorkflowTask ( themeDisplay . getCompanyId ( ) , workflowTaskId ) ;
workflowTask = WorkflowTaskManagerUtil . getWorkflowTask ( themeDisplay . getCompanyId ( ) ,
workflowTaskId ) ;
}
}
String valoreTransizioneEsito = getTransitionValue ( workflowTask . getWorkflowInstanceId ( ) , "registra-esito" ) ;
String valoreTransizioneEsito = getTransitionValue ( workflowTask . getWorkflowInstanceId ( ) ,
"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 ) ;
@ -386,7 +394,10 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
ControlloPratica controlloPratica = getControlloPratica ( workflowTask . getWorkflowInstanceId ( ) ) ;
ControlloPratica controlloPratica = getControlloPratica ( workflowTask . getWorkflowInstanceId ( ) ) ;
// ADT BUG BO ID=33
// ADT BUG BO ID=33
renderRequest . setAttribute ( "historyWorkflowEsitiLogs" , getHistoryWorkfloLogs ( themeDisplay , workflowTask . getWorkflowInstanceId ( ) , renderRequest , controlloPratica ) ) ;
renderRequest . setAttribute (
"historyWorkflowEsitiLogs" ,
getHistoryWorkfloLogs ( themeDisplay , workflowTask . getWorkflowInstanceId ( ) , renderRequest ,
controlloPratica ) ) ;
long groupIdTerritorio = controlloPratica . getGroupId ( ) ;
long groupIdTerritorio = controlloPratica . getGroupId ( ) ;
Group group = GroupLocalServiceUtil . getGroup ( groupIdTerritorio ) ;
Group group = GroupLocalServiceUtil . getGroup ( groupIdTerritorio ) ;
@ -394,27 +405,28 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
User user = themeDisplay . getUser ( ) ;
User user = themeDisplay . getUser ( ) ;
Organization org = OrganizationLocalServiceUtil . getOrganization ( group . getClassPK ( ) ) ;
Organization org = OrganizationLocalServiceUtil . getOrganization ( group . getClassPK ( ) ) ;
boolean canPortosAssegnatore =
boolean canPortosAssegnatore = UserGroupRoleLocalServiceUtil . hasUserGroupRole ( user . getUserId ( ) ,
UserGroupRoleLocalServiceUtil . hasUserGroupRole ( user . getUserId ( ) , org . getGroupId ( ) , "portos_assegnatore" ) ;
org . getGroupId ( ) , "portos_assegnatore" ) ;
boolean canPortosApprovatore =
boolean canPortosApprovatore = UserGroupRoleLocalServiceUtil . hasUserGroupRole ( user . getUserId ( ) ,
UserGroupRoleLocalServiceUtil . hasUserGroupRole ( user . getUserId ( ) , org . getGroupId ( ) , "portos_approvatore" ) ;
org . getGroupId ( ) , "portos_approvatore" ) ;
boolean canPortosIstruttore =
boolean canPortosIstruttore = UserGroupRoleLocalServiceUtil . hasUserGroupRole ( user . getUserId ( ) ,
UserGroupRoleLocalServiceUtil . hasUserGroupRole ( user . getUserId ( ) , org . getGroupId ( ) , "portos_istruttore" ) ;
org . getGroupId ( ) , "portos_istruttore" ) ;
renderRequest . setAttribute ( "canPortosAssegnatore" , canPortosAssegnatore ) ;
renderRequest . setAttribute ( "canPortosAssegnatore" , canPortosAssegnatore ) ;
renderRequest . setAttribute ( "canPortosApprovatore" , canPortosApprovatore ) ;
renderRequest . setAttribute ( "canPortosApprovatore" , canPortosApprovatore ) ;
renderRequest . setAttribute ( "canPortosIstruttore" , canPortosIstruttore ) ;
renderRequest . setAttribute ( "canPortosIstruttore" , canPortosIstruttore ) ;
return originalStrutsPortletAction . render ( originalStrutsPortletAction , portletConfig , renderRequest ,
return originalStrutsPortletAction . render ( originalStrutsPortletAction , portletConfig , renderRequest , renderResponse ) ;
renderResponse ) ;
}
}
private String getTransitionValue ( long taskInstanceId , String transitionName ) throws PortalException , SystemException {
private String getTransitionValue ( long taskInstanceId , String transitionName ) throws PortalException ,
SystemException {
ClassLoader classLoaderKaleoLog =
ClassLoader classLoaderKaleoLog = ( ClassLoader ) PortletBeanLocatorUtil . locate (
( 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 ) ) ;
@ -426,8 +438,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 =
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
ControlloPraticaLocalServiceUtil . getControlloPratica ( kaleoInstance . getClassPK ( ) ) ;
. getControlloPratica ( kaleoInstance . getClassPK ( ) ) ;
if ( json . has ( "esito" ) ) {
if ( json . has ( "esito" ) ) {
String tipoEsito = "" ;
String tipoEsito = "" ;
@ -479,19 +491,17 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
private ControlloPratica getControlloPratica ( long taskInstanceId ) throws PortalException , SystemException {
private ControlloPratica getControlloPratica ( long taskInstanceId ) throws PortalException , SystemException {
ClassLoader classLoaderKaleoLog =
ClassLoader classLoaderKaleoLog = ( ClassLoader ) PortletBeanLocatorUtil . locate (
( ClassLoader ) PortletBeanLocatorUtil . locate (
it . tref . liferay . portos . kaleo . service . ClpSerializer . getServletContextName ( ) ,
it . tref . liferay . portos . kaleo . service . ClpSerializer . getServletContextName ( ) , "portletClassLoader" ) ;
"portletClassLoader" ) ;
KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil . getKaleoInstance ( taskInstanceId ) ;
KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil . getKaleoInstance ( taskInstanceId ) ;
ControlloPratica controlloPratica =
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
ControlloPraticaLocalServiceUtil . getControlloPratica ( kaleoInstance . getClassPK ( ) ) ;
. getControlloPratica ( kaleoInstance . getClassPK ( ) ) ;
return controlloPratica ;
return controlloPratica ;
}
}
/ * *
/ * *
* ADT BUG BO ID = 33 - implementazione nuovo metodo
* ADT BUG BO ID = 33 - implementazione nuovo metodo
*
*
@ -501,7 +511,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
* @param controlloPratica
* @param controlloPratica
* @return
* @return
* /
* /
private Map < Long , String > getHistoryWorkfloLogs ( ThemeDisplay themeDisplay , long workflowInstanceId , RenderRequest renderRequest , ControlloPratica controlloPratica ) {
private Map < Long , String > getHistoryWorkfloLogs ( ThemeDisplay themeDisplay , long workflowInstanceId ,
RenderRequest renderRequest , ControlloPratica controlloPratica ) {
Map < Long , String > esitiMapByWorkflowLogID = new HashMap < Long , String > ( ) ;
Map < Long , String > esitiMapByWorkflowLogID = new HashMap < Long , String > ( ) ;
try {
try {
@ -510,14 +521,18 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
logTypes . add ( WorkflowLog . TASK_COMPLETION ) ;
logTypes . add ( WorkflowLog . TASK_COMPLETION ) ;
logTypes . add ( WorkflowLog . TASK_UPDATE ) ;
logTypes . add ( WorkflowLog . TASK_UPDATE ) ;
logTypes . add ( WorkflowLog . TRANSITION ) ;
logTypes . add ( WorkflowLog . TRANSITION ) ;
List < WorkflowLog > workflowLogs = WorkflowLogManagerUtil . getWorkflowLogsByWorkflowInstance ( themeDisplay . getCompanyId ( ) , workflowInstanceId , logTypes , QueryUtil . ALL_POS , QueryUtil . ALL_POS , WorkflowComparatorFactoryUtil . getLogCreateDateComparator ( true ) ) ;
List < WorkflowLog > workflowLogs = WorkflowLogManagerUtil . getWorkflowLogsByWorkflowInstance (
themeDisplay . getCompanyId ( ) , workflowInstanceId , logTypes , QueryUtil . ALL_POS ,
QueryUtil . ALL_POS , WorkflowComparatorFactoryUtil . getLogCreateDateComparator ( true ) ) ;
for ( WorkflowLog workflowLog : workflowLogs ) {
for ( WorkflowLog workflowLog : workflowLogs ) {
try {
try {
WorkflowTask wfTask = null ;
WorkflowTask wfTask = null ;
if ( workflowLog . getWorkflowTaskId ( ) > 0 ) {
if ( workflowLog . getWorkflowTaskId ( ) > 0 ) {
wfTask = WorkflowTaskManagerUtil . getWorkflowTask ( themeDisplay . getCompanyId ( ) , workflowLog . getWorkflowTaskId ( ) ) ;
wfTask = WorkflowTaskManagerUtil . getWorkflowTask ( themeDisplay . getCompanyId ( ) ,
workflowLog . getWorkflowTaskId ( ) ) ;
ServiceContext serviceContext = ServiceContextFactory . getInstance ( renderRequest ) ;
ServiceContext serviceContext = ServiceContextFactory . getInstance ( renderRequest ) ;
FormLog formLog = FormLogLocalServiceUtil . findByC_Task ( serviceContext . getCompanyId ( ) , wfTask . getWorkflowTaskId ( ) ) ;
FormLog formLog = FormLogLocalServiceUtil . findByC_Task ( serviceContext . getCompanyId ( ) ,
wfTask . getWorkflowTaskId ( ) ) ;
if ( formLog ! = null & & Validator . isNotNull ( formLog . getFormParameters ( ) ) ) {
if ( formLog ! = null & & Validator . isNotNull ( formLog . getFormParameters ( ) ) ) {
JSONObject json = JSONFactoryUtil . createJSONObject ( formLog . getFormParameters ( ) ) ;
JSONObject json = JSONFactoryUtil . createJSONObject ( formLog . getFormParameters ( ) ) ;
@ -530,8 +545,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
break ;
break ;
case "CO" :
case "CO" :
if ( AzioniPraticheUtil . isDeposito ( controlloPratica
if ( AzioniPraticheUtil . isDeposito ( controlloPratica . getIntPraticaId ( ) ) ) {
. getIntPraticaId ( ) ) ) {
tipoEsito = "Conforme" ;
tipoEsito = "Conforme" ;
} else if ( AzioniPraticheUtil . isAutorizzazione ( controlloPratica
} else if ( AzioniPraticheUtil . isAutorizzazione ( controlloPratica
. getIntPraticaId ( ) ) ) {
. getIntPraticaId ( ) ) ) {
@ -542,7 +556,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
case "NC" :
case "NC" :
if ( AzioniPraticheUtil . isDeposito ( controlloPratica . getIntPraticaId ( ) ) ) {
if ( AzioniPraticheUtil . isDeposito ( controlloPratica . getIntPraticaId ( ) ) ) {
tipoEsito = "Non conforme" ;
tipoEsito = "Non conforme" ;
} else if ( AzioniPraticheUtil . isAutorizzazione ( controlloPratica . getIntPraticaId ( ) ) ) {
} else if ( AzioniPraticheUtil . isAutorizzazione ( controlloPratica
. getIntPraticaId ( ) ) ) {
tipoEsito = "Non autorizzata" ;
tipoEsito = "Non autorizzata" ;
}
}
break ;
break ;
@ -555,7 +570,9 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
break ;
break ;
}
}
//_log.info("WorkflowLogId="+ workflowLog.getWorkflowLogId() + " "+ tipoEsito);
// _log.info("WorkflowLogId="+
// workflowLog.getWorkflowLogId() + " "+
// tipoEsito);
esitiMapByWorkflowLogID . put ( workflowLog . getWorkflowLogId ( ) , tipoEsito ) ;
esitiMapByWorkflowLogID . put ( workflowLog . getWorkflowLogId ( ) , tipoEsito ) ;
}
}
}
}
@ -576,7 +593,6 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
}
}
/ * *
/ * *
* ADT : check congruenza WF - presenza dell ' istruttore
* ADT : check congruenza WF - presenza dell ' istruttore
*
*
@ -587,14 +603,20 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
private void checkPresenzaIstruttore ( String transitionName , long workflowTaskId ) {
private void checkPresenzaIstruttore ( String transitionName , long workflowTaskId ) {
if ( transitionName . equalsIgnoreCase ( "registra-esito" ) ) {
if ( transitionName . equalsIgnoreCase ( "registra-esito" ) ) {
try {
try {
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil . getKaleoTaskInstanceToken ( workflowTaskId ) ;
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil
ControlloPratica controlloPratica = getControlloPratica ( kaleoTaskInstanceToken . getKaleoInstanceId ( ) ) ;
. getKaleoTaskInstanceToken ( workflowTaskId ) ;
Map < String , Serializable > wfParameters = it . tref . liferay . portos . bo . util . WorkflowUtil . getFormParameters ( controlloPratica ) ;
ControlloPratica controlloPratica = getControlloPratica ( kaleoTaskInstanceToken
. getKaleoInstanceId ( ) ) ;
Map < String , Serializable > wfParameters = it . tref . liferay . portos . bo . util . WorkflowUtil
. getFormParameters ( controlloPratica ) ;
String istruttore = ( String ) wfParameters . get ( "istruttore" ) ;
String istruttore = ( String ) wfParameters . get ( "istruttore" ) ;
_log . info ( "checkPresenzaIstruttore - istruttore presente sul workflow= " + istruttore + " - ControlloPraticaId = " + controlloPratica . getControlloPraticaId ( ) ) ;
_log . info ( "checkPresenzaIstruttore - istruttore presente sul workflow= " + istruttore
+ " - ControlloPraticaId = " + controlloPratica . getControlloPraticaId ( ) ) ;
if ( istruttore = = null ) {
if ( istruttore = = null ) {
_log . info ( "checkPresenzaIstruttore - rilevata incongrueza WF - istruttore non presente per controlloPratica = " + controlloPratica . getControlloPraticaId ( ) ) ;
_log . info ( "checkPresenzaIstruttore - rilevata incongrueza WF - istruttore non presente per controlloPratica = "
long istruttoreId = IntPraticaLocalServiceUtil . getIntPratica ( controlloPratica . getIntPraticaId ( ) ) . getStatusByUserId ( ) ;
+ controlloPratica . getControlloPraticaId ( ) ) ;
long istruttoreId = IntPraticaLocalServiceUtil . getIntPratica (
controlloPratica . getIntPraticaId ( ) ) . 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 > ( ) ;
@ -605,15 +627,19 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
ServiceContext serviceContext = new ServiceContext ( ) ;
ServiceContext serviceContext = new ServiceContext ( ) ;
serviceContext . setCompanyId ( controlloPratica . getCompanyId ( ) ) ;
serviceContext . setCompanyId ( controlloPratica . getCompanyId ( ) ) ;
serviceContext . setUserId ( controlloPratica . getUserId ( ) ) ;
serviceContext . setUserId ( controlloPratica . getUserId ( ) ) ;
FormLogLocalServiceUtil . addFormLog ( kaleoTaskInstanceToken . getKaleoInstanceId ( ) , 0l , "cambio-istruttore" , jsonFormParameters , serviceContext ) ;
FormLogLocalServiceUtil . addFormLog ( kaleoTaskInstanceToken . getKaleoInstanceId ( ) , 0l ,
_log . info ( "checkPresenzaIstruttore correttamente eseguito - ControlloPraticaId = " + controlloPratica . getControlloPraticaId ( ) ) ;
"cambio-istruttore" , jsonFormParameters , serviceContext ) ;
_log . info ( "checkPresenzaIstruttore correttamente eseguito - ControlloPraticaId = "
+ controlloPratica . getControlloPraticaId ( ) ) ;
} else {
} else {
_log . info ( "checkPresenzaIstruttore KO - istruttore non calcolato - ControlloPraticaId = " + controlloPratica . getControlloPraticaId ( ) ) ;
_log . info ( "checkPresenzaIstruttore KO - istruttore non calcolato - ControlloPraticaId = "
+ controlloPratica . getControlloPraticaId ( ) ) ;
}
}
}
}
} catch ( Exception e ) {
} catch ( Exception e ) {
_log . error ( "checkPresenzaIstruttore KO per workflowTaskId = " + workflowTaskId + " [" + e . getMessage ( ) + " , " + e . getCause ( ) + "]" ) ;
_log . error ( "checkPresenzaIstruttore KO per workflowTaskId = " + workflowTaskId + " ["
+ e . getMessage ( ) + " , " + e . getCause ( ) + "]" ) ;
}
}
}
}
}
}