|
|
@ -18,6 +18,8 @@ import com.liferay.portal.model.Company; |
|
|
|
import com.liferay.portal.model.User; |
|
|
|
import com.liferay.portal.model.User; |
|
|
|
import com.liferay.portal.service.CompanyLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.CompanyLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.ServiceContext; |
|
|
|
import com.liferay.portal.service.ServiceContext; |
|
|
|
|
|
|
|
import com.liferay.portlet.expando.model.ExpandoBridge; |
|
|
|
|
|
|
|
import com.liferay.portlet.expando.model.ExpandoColumnConstants; |
|
|
|
|
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.model.Comune; |
|
|
|
import it.tref.liferay.portos.bo.model.Comune; |
|
|
|
import it.tref.liferay.portos.bo.model.DettPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.DettPratica; |
|
|
@ -113,6 +115,38 @@ public class QuarkusBridgeScheduler implements MessageListener { |
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil |
|
|
|
DettPratica dettPratica = DettPraticaLocalServiceUtil |
|
|
|
.addDettPratica(territorioId, tipoProcedura, serviceContext); |
|
|
|
.addDettPratica(territorioId, tipoProcedura, serviceContext); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add custom fields to IntPratica to fetch future updates from Kafka
|
|
|
|
|
|
|
|
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(dettPratica.getIntPraticaId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExpandoBridge customFieldsExpando = intPratica.getExpandoBridge(); |
|
|
|
|
|
|
|
customFieldsExpando.addAttribute(QuarkusBridgeConstants.instanceId, |
|
|
|
|
|
|
|
ExpandoColumnConstants.STRING); |
|
|
|
|
|
|
|
customFieldsExpando.addAttribute(QuarkusBridgeConstants.correlationId, |
|
|
|
|
|
|
|
ExpandoColumnConstants.STRING); |
|
|
|
|
|
|
|
customFieldsExpando.addAttribute(QuarkusBridgeConstants.clientId, |
|
|
|
|
|
|
|
ExpandoColumnConstants.STRING); |
|
|
|
|
|
|
|
customFieldsExpando.addAttribute("HeaderSportelloId", ExpandoColumnConstants.LONG); |
|
|
|
|
|
|
|
customFieldsExpando.addAttribute("SportelloId", ExpandoColumnConstants.LONG); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String instanceId = Header.getString(QuarkusBridgeConstants.instanceId); |
|
|
|
|
|
|
|
String correlationId = Header.getString(QuarkusBridgeConstants.correlationId); |
|
|
|
|
|
|
|
String clientId = Header.getString(QuarkusBridgeConstants.clientId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long headerSportelloId = Header.getLong(QuarkusBridgeConstants.recordId); |
|
|
|
|
|
|
|
Long sportelloId = Sportello.getLong(QuarkusBridgeConstants.recordId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
customFieldsExpando.setAttribute(QuarkusBridgeConstants.correlationId, correlationId); |
|
|
|
|
|
|
|
customFieldsExpando.setAttribute(QuarkusBridgeConstants.instanceId, instanceId); |
|
|
|
|
|
|
|
customFieldsExpando.setAttribute(QuarkusBridgeConstants.clientId, clientId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
customFieldsExpando.setAttribute("HeaderSportelloId", headerSportelloId); |
|
|
|
|
|
|
|
customFieldsExpando.setAttribute("SportelloId", sportelloId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
intPratica.setExpandoBridgeAttributes(customFieldsExpando); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Persist changes to custom fields
|
|
|
|
|
|
|
|
IntPraticaLocalServiceUtil.updateIntPratica(intPratica); |
|
|
|
|
|
|
|
|
|
|
|
} catch (SystemException e) { |
|
|
|
} catch (SystemException e) { |
|
|
|
_log.error(e ,e); |
|
|
|
_log.error(e ,e); |
|
|
|
} catch (PortalException e) { |
|
|
|
} catch (PortalException e) { |
|
|
|