@Override protected boolean shouldHandleEvent(final SendReadyForPickupMessageEvent event) { final AbstractOrderModel order = event.getProcess().getConsignment().getOrder(); ServicesUtil.validateParameterNotNullStandardMessage("event.order", order); final BaseSiteModel site = order.getSite(); ServicesUtil.validateParameterNotNullStandardMessage("event.order.site", site); return SiteChannel.TELCO.equals(site.getChannel()); }
@Override protected void onSiteEvent(final SendReadyForPickupMessageEvent sendReadyForPickupMessageEvent) { final ConsignmentModel consignmentModel = sendReadyForPickupMessageEvent.getProcess().getConsignment(); final ConsignmentProcessModel consignmentProcessModel = getBusinessProcessService() .createProcess( "telcoSendReadyForPickupEmailProcess-" + consignmentModel.getCode() + "-" + System.currentTimeMillis(), "telcoSendReadyForPickupEmailProcess"); consignmentProcessModel.setConsignment(consignmentModel); getModelService().save(consignmentProcessModel); getBusinessProcessService().startProcess(consignmentProcessModel); }