Source:
public Response createSituationTrigger(final SituationTriggerDTO situationTrigger) { final Collection<Situation> sits = Lists.newArrayList(); for (final Long situationId : situationTrigger.getSituationIds()) { final Situation situation = this.instanceService.getSituation(situationId); sits.add(situation); } ServiceTemplateInstance serviceInstance; try { serviceInstance = this.instanceService.getServiceTemplateInstance(situationTrigger.getServiceInstanceId(), false); } catch (final NotFoundException e) { serviceInstance = null; } NodeTemplateInstance nodeInstance = null; if (situationTrigger.getNodeInstanceId() != null) { nodeInstance = this.instanceService.getNodeTemplateInstance(situationTrigger.getNodeInstanceId()); } final Set<SituationTriggerProperty> inputs = Sets.newHashSet(); float eventProbability = -1.0f; if (situationTrigger.getEventProbability() != -1.0f) { eventProbability = situationTrigger.getEventProbability(); } String eventTime = null; if (situationTrigger.getEventTime() != null) { eventTime = situationTrigger.getEventTime(); } situationTrigger.getInputParams() .forEach(x -> inputs.add(new SituationTriggerProperty(x.getName(), x.getValue(), x.getType()))); final SituationTrigger sitTrig = this.instanceService.createNewSituationTrigger(sits, situationTrigger.isOnActivation(), situationTrigger.isSingleInstance(), serviceInstance, nodeInstance, situationTrigger.getInterfaceName(), situationTrigger.getOperationName(), inputs, eventProbability, eventTime); final URI instanceURI = UriUtil.generateSubResourceURI(this.uriInfo, sitTrig.getId().toString(), false); return Response.ok(instanceURI).build(); }

Target:
public Response createSituationTrigger(final SituationTriggerDTO situationTrigger) { final Collection<Situation> sits = Lists.newArrayList(); for (final Long situationId : situationTrigger.getSituationIds()) { final Situation situation = this.instanceService.getSituation(situationId); sits.add(situation); } ServiceTemplateInstance serviceInstance; try { serviceInstance = this.instanceService.getServiceTemplateInstance(situationTrigger.getServiceInstanceId(), false); } catch (final NotFoundException e) { serviceInstance = null; } NodeTemplateInstance nodeInstance = null; if (situationTrigger.getNodeInstanceId() != null) { nodeInstance = this.instanceService.getNodeTemplateInstance(situationTrigger.getNodeInstanceId()); } final Set<SituationTriggerProperty> inputs = Sets.newHashSet(); float eventProbability = -1.0f; if (Float.compare(situationTrigger.getEventProbability(), eventProbability) != 0) { eventProbability = situationTrigger.getEventProbability(); } String eventTime = null; if (situationTrigger.getEventTime() != null) { eventTime = situationTrigger.getEventTime(); } situationTrigger.getInputParams() .forEach(x -> inputs.add(new SituationTriggerProperty(x.getName(), x.getValue(), x.getType()))); final SituationTrigger sitTrig = this.instanceService.createNewSituationTrigger(sits, situationTrigger.isOnActivation(), situationTrigger.isSingleInstance(), serviceInstance, nodeInstance, situationTrigger.getInterfaceName(), situationTrigger.getOperationName(), inputs, eventProbability, eventTime); final URI instanceURI = UriUtil.generateSubResourceURI(this.uriInfo, sitTrig.getId().toString(), false); return Response.ok(instanceURI).build(); }