final VersionControlInformation versionControlInfo = getVersionControlInformation(); if (versionControlInfo != null) { if (!versionControlInfo.getFlowIdentifier().equals(updatedFlow.getSnapshotMetadata().getFlowIdentifier())) { throw new IllegalStateException(this + " is under version control but the given flow does not match the flow that this Process Group is synchronized with");
throw new IllegalArgumentException("The Bucket ID must be supplied."); if (requestSnapshotMetadata.getFlowIdentifier() == null) { throw new IllegalArgumentException("The Flow ID must be supplied."); versionControlInfoDto.setBucketId(snapshotMetadata.getBucketIdentifier()); versionControlInfoDto.setBucketName(bucket.getName()); versionControlInfoDto.setFlowId(snapshotMetadata.getFlowIdentifier()); versionControlInfoDto.setFlowName(flow.getName()); versionControlInfoDto.setFlowDescription(flow.getDescription());
@Override public String toString() { final String flowName = (flow == null ? "null" : flow.getName()); return "VersionedFlowSnapshot[flowId=" + snapshotMetadata.getFlowIdentifier() + ", flowName=" + flowName + ", version=" + snapshotMetadata.getVersion() + ", comments=" + snapshotMetadata.getComments() + "]"; } }
public static FlowSnapshotEntity map(final VersionedFlowSnapshotMetadata versionedFlowSnapshot) { final FlowSnapshotEntity flowSnapshotEntity = new FlowSnapshotEntity(); flowSnapshotEntity.setFlowId(versionedFlowSnapshot.getFlowIdentifier()); flowSnapshotEntity.setVersion(versionedFlowSnapshot.getVersion()); flowSnapshotEntity.setComments(versionedFlowSnapshot.getComments()); flowSnapshotEntity.setCreated(new Date(versionedFlowSnapshot.getTimestamp())); flowSnapshotEntity.setCreatedBy(versionedFlowSnapshot.getAuthor()); return flowSnapshotEntity; }
final FlowEntity existingFlow = metadataService.getFlowById(snapshotMetadata.getFlowIdentifier()); if (existingFlow == null) { LOGGER.warn("The specified flow id [{}] does not exist.", snapshotMetadata.getFlowIdentifier()); throw new ResourceNotFoundException("The specified flow ID does not exist in this bucket."); final FlowEntity updatedFlow = metadataService.getFlowByIdWithSnapshotCounts(snapshotMetadata.getFlowIdentifier()); if (updatedFlow == null) { throw new ResourceNotFoundException("Versioned flow does not exist for identifier " + snapshotMetadata.getFlowIdentifier());
public static Event flowVersionCreated(final VersionedFlowSnapshot versionedFlowSnapshot) { final String versionComments = versionedFlowSnapshot.getSnapshotMetadata().getComments() == null ? "" : versionedFlowSnapshot.getSnapshotMetadata().getComments(); return new StandardEvent.Builder() .eventType(EventType.CREATE_FLOW_VERSION) .addField(EventFieldName.BUCKET_ID, versionedFlowSnapshot.getSnapshotMetadata().getBucketIdentifier()) .addField(EventFieldName.FLOW_ID, versionedFlowSnapshot.getSnapshotMetadata().getFlowIdentifier()) .addField(EventFieldName.VERSION, String.valueOf(versionedFlowSnapshot.getSnapshotMetadata().getVersion())) .addField(EventFieldName.USER, versionedFlowSnapshot.getSnapshotMetadata().getAuthor()) .addField(EventFieldName.COMMENT, versionComments) .build(); }
public Builder(final Bucket bucket, final VersionedFlow versionedFlow, final VersionedFlowSnapshotMetadata snapshotMetadata) { bucketId(bucket.getIdentifier()); bucketName(bucket.getName()); flowId(snapshotMetadata.getFlowIdentifier()); flowName(versionedFlow.getName()); version(snapshotMetadata.getVersion()); comments(snapshotMetadata.getComments()); author(snapshotMetadata.getAuthor()); snapshotTimestamp(snapshotMetadata.getTimestamp()); }