/** * Validates the job signal request. This method also trims request parameters. * * @param request the request * * @throws IllegalArgumentException if any validation errors were found */ private void validateJobSignalRequest(JobSignalRequest request) { // Validate required elements Assert.hasText(request.getId(), "A job id must be specified."); Assert.hasText(request.getReceiveTaskId(), "A receive task id must be specified."); // Validate that parameter names are there and not duplicate parameterHelper.validateParameters(request.getParameters()); if (request.getS3PropertiesLocation() != null) { s3PropertiesLocationHelper.validate(request.getS3PropertiesLocation()); } // Remove leading and trailing spaces. request.setId(request.getId().trim()); request.setReceiveTaskId(request.getReceiveTaskId().trim()); } }
/** * Validates the job signal request. This method also trims request parameters. * * @param request the request * * @throws IllegalArgumentException if any validation errors were found */ private void validateJobSignalRequest(JobSignalRequest request) { // Validate required elements Assert.hasText(request.getId(), "A job id must be specified."); Assert.hasText(request.getReceiveTaskId(), "A receive task id must be specified."); // Validate that parameter names are there and not duplicate parameterHelper.validateParameters(request.getParameters()); if (request.getS3PropertiesLocation() != null) { s3PropertiesLocationHelper.validate(request.getS3PropertiesLocation()); } // Remove leading and trailing spaces. request.setId(request.getId().trim()); request.setReceiveTaskId(request.getReceiveTaskId().trim()); } }
@Override public Job signalJob(JobSignalRequest request) throws Exception { // Perform the validation. validateJobSignalRequest(request); Execution execution = activitiService.getExecutionByProcessInstanceIdAndActivitiId(request.getId(), request.getReceiveTaskId()); if (execution == null) { throw new ObjectNotFoundException( String.format("No job found for matching job id: \"%s\" and receive task id: \"%s\".", request.getId(), request.getReceiveTaskId())); } String processDefinitionKey = activitiService.getProcessInstanceById(execution.getProcessInstanceId()).getProcessDefinitionKey(); checkPermissions(processDefinitionKey, new NamespacePermissionEnum[] {NamespacePermissionEnum.EXECUTE}); // Retrieve the job before signaling. Job job = getJob(request.getId(), false, false); // Build the parameters map Map<String, Object> signalParameters = getParameters(request); // Signal the workflow. activitiService.signal(execution.getId(), signalParameters); // Build the parameters map merged with job and signal parameters. Map<String, Object> mergedParameters = new HashMap<>(); for (Parameter jobParam : job.getParameters()) { mergedParameters.put(jobParam.getName(), jobParam.getValue()); } mergedParameters.putAll(signalParameters); // Update the parameters in job populateWorkflowParameters(job, mergedParameters); return job; }
@Override public Job signalJob(JobSignalRequest request) throws Exception { // Perform the validation. validateJobSignalRequest(request); Execution execution = activitiService.getExecutionByProcessInstanceIdAndActivitiId(request.getId(), request.getReceiveTaskId()); if (execution == null) { throw new ObjectNotFoundException( String.format("No job found for matching job id: \"%s\" and receive task id: \"%s\".", request.getId(), request.getReceiveTaskId())); } String processDefinitionKey = activitiService.getProcessInstanceById(execution.getProcessInstanceId()).getProcessDefinitionKey(); checkPermissions(processDefinitionKey, new NamespacePermissionEnum[] {NamespacePermissionEnum.EXECUTE}); // Retrieve the job before signaling. Job job = getJob(request.getId(), false, false); // Build the parameters map Map<String, Object> signalParameters = getParameters(request); // Signal the workflow. activitiService.signal(execution.getId(), signalParameters); // Build the parameters map merged with job and signal parameters. Map<String, Object> mergedParameters = new HashMap<>(); for (Parameter jobParam : job.getParameters()) { mergedParameters.put(jobParam.getName(), jobParam.getValue()); } mergedParameters.putAll(signalParameters); // Update the parameters in job populateWorkflowParameters(job, mergedParameters); return job; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { String theId; theId = this.getId(); strategy.appendField(locator, this, "id", buffer, theId, (this.id!= null)); } { String theReceiveTaskId; theReceiveTaskId = this.getReceiveTaskId(); strategy.appendField(locator, this, "receiveTaskId", buffer, theReceiveTaskId, (this.receiveTaskId!= null)); } { List<Parameter> theParameters; theParameters = ((this.parameters!= null)?this.getParameters():null); strategy.appendField(locator, this, "parameters", buffer, theParameters, (this.parameters!= null)); } { S3PropertiesLocation theS3PropertiesLocation; theS3PropertiesLocation = this.getS3PropertiesLocation(); strategy.appendField(locator, this, "s3PropertiesLocation", buffer, theS3PropertiesLocation, (this.s3PropertiesLocation!= null)); } return buffer; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { String theId; theId = this.getId(); strategy.appendField(locator, this, "id", buffer, theId, (this.id!= null)); } { String theReceiveTaskId; theReceiveTaskId = this.getReceiveTaskId(); strategy.appendField(locator, this, "receiveTaskId", buffer, theReceiveTaskId, (this.receiveTaskId!= null)); } { List<Parameter> theParameters; theParameters = ((this.parameters!= null)?this.getParameters():null); strategy.appendField(locator, this, "parameters", buffer, theParameters, (this.parameters!= null)); } { S3PropertiesLocation theS3PropertiesLocation; theS3PropertiesLocation = this.getS3PropertiesLocation(); strategy.appendField(locator, this, "s3PropertiesLocation", buffer, theS3PropertiesLocation, (this.s3PropertiesLocation!= null)); } return buffer; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { String theId; theId = this.getId(); strategy.appendField(locator, this, "id", buffer, theId, (this.id!= null)); } { String theReceiveTaskId; theReceiveTaskId = this.getReceiveTaskId(); strategy.appendField(locator, this, "receiveTaskId", buffer, theReceiveTaskId, (this.receiveTaskId!= null)); } { List<Parameter> theParameters; theParameters = ((this.parameters!= null)?this.getParameters():null); strategy.appendField(locator, this, "parameters", buffer, theParameters, (this.parameters!= null)); } { S3PropertiesLocation theS3PropertiesLocation; theS3PropertiesLocation = this.getS3PropertiesLocation(); strategy.appendField(locator, this, "s3PropertiesLocation", buffer, theS3PropertiesLocation, (this.s3PropertiesLocation!= null)); } return buffer; }
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { String theId; theId = this.getId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId, (this.id!= null)); } { String theReceiveTaskId; theReceiveTaskId = this.getReceiveTaskId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "receiveTaskId", theReceiveTaskId), currentHashCode, theReceiveTaskId, (this.receiveTaskId!= null)); } { List<Parameter> theParameters; theParameters = ((this.parameters!= null)?this.getParameters():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "parameters", theParameters), currentHashCode, theParameters, (this.parameters!= null)); } { S3PropertiesLocation theS3PropertiesLocation; theS3PropertiesLocation = this.getS3PropertiesLocation(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "s3PropertiesLocation", theS3PropertiesLocation), currentHashCode, theS3PropertiesLocation, (this.s3PropertiesLocation!= null)); } return currentHashCode; }
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { String theId; theId = this.getId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId, (this.id!= null)); } { String theReceiveTaskId; theReceiveTaskId = this.getReceiveTaskId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "receiveTaskId", theReceiveTaskId), currentHashCode, theReceiveTaskId, (this.receiveTaskId!= null)); } { List<Parameter> theParameters; theParameters = ((this.parameters!= null)?this.getParameters():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "parameters", theParameters), currentHashCode, theParameters, (this.parameters!= null)); } { S3PropertiesLocation theS3PropertiesLocation; theS3PropertiesLocation = this.getS3PropertiesLocation(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "s3PropertiesLocation", theS3PropertiesLocation), currentHashCode, theS3PropertiesLocation, (this.s3PropertiesLocation!= null)); } return currentHashCode; }
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { String theId; theId = this.getId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId, (this.id!= null)); } { String theReceiveTaskId; theReceiveTaskId = this.getReceiveTaskId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "receiveTaskId", theReceiveTaskId), currentHashCode, theReceiveTaskId, (this.receiveTaskId!= null)); } { List<Parameter> theParameters; theParameters = ((this.parameters!= null)?this.getParameters():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "parameters", theParameters), currentHashCode, theParameters, (this.parameters!= null)); } { S3PropertiesLocation theS3PropertiesLocation; theS3PropertiesLocation = this.getS3PropertiesLocation(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "s3PropertiesLocation", theS3PropertiesLocation), currentHashCode, theS3PropertiesLocation, (this.s3PropertiesLocation!= null)); } return currentHashCode; }
if (idShouldBeCopiedAndSet == Boolean.TRUE) { String sourceId; sourceId = this.getId(); String copyId = ((String) strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, (this.id!= null))); copy.setId(copyId);
if (idShouldBeCopiedAndSet == Boolean.TRUE) { String sourceId; sourceId = this.getId(); String copyId = ((String) strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, (this.id!= null))); copy.setId(copyId);
if (idShouldBeCopiedAndSet == Boolean.TRUE) { String sourceId; sourceId = this.getId(); String copyId = ((String) strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, (this.id!= null))); copy.setId(copyId);