2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 Nokia Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.vid.model
23 import com.google.common.collect.Lists
25 enum class WorkflowSource(val source: String) {
26 SDC("sdc"), NATIVE("native")
29 data class SOWorkflow constructor(
32 val source: WorkflowSource,
33 val workflowInputParameters: List<WorkflowInputParameter>
35 fun clone(): SOWorkflow {
40 data class SOWorkflows @JvmOverloads constructor(
41 val workflows: List<SOWorkflow> = emptyList()) {
42 fun clone(): SOWorkflows {
43 return copy(workflows.toMutableList())
47 enum class SOWorkflowType(
52 enum class LocalWorkflowType(
58 data class SOWorkflowParameterDefinition constructor(
62 val type: SOWorkflowType,
63 val required: Boolean)
65 data class SOWorkflowParameterDefinitions constructor(
66 val parameterDefinitions: List<SOWorkflowParameterDefinition> = emptyList()) {
67 fun clone(): SOWorkflowParameterDefinitions {
68 return copy(parameterDefinitions.toMutableList())
72 data class LocalWorkflowParameterDefinition @JvmOverloads constructor(
75 val displayName: String,
76 val required: Boolean,
77 val type: LocalWorkflowType,
78 val pattern: String? = null,
79 val msgOnPatternError: String? = null,
80 val msgOnContentError: String? = null,
81 val acceptableFileType: String? = null
84 data class LocalWorkflowParameterDefinitions constructor(
85 val parameterDefinitions: List<LocalWorkflowParameterDefinition> = emptyList()
87 fun clone(): LocalWorkflowParameterDefinitions {
88 return copy(parameterDefinitions.toMutableList())
93 data class ArtifactInfo constructor(
94 val artifactType: String,
95 val artifactUuid: String,
96 val artifactName: String,
97 val artifactVersion: String,
98 val artifactDescription: String? = null,
99 val workflowName: String,
100 val operationName: String? = null,
101 val workflowSource: String,
102 val workflowResourceTarget: String
105 data class ActivitySequenceItem constructor(
107 val description: String
110 data class WorkflowInputParameter constructor(
112 val inputType: String,
113 val required: Boolean,
114 val validation: List<InputParameterValidation>? = Lists.newArrayList(),
115 val soFieldName: String,
116 val soPayloadLocation: String?,
117 val description: String?
121 data class InputParameterValidation constructor(
122 val maxLength: String?,
123 val allowableChars: String?
126 data class WorkflowSpecification constructor(
127 val artifactInfo: ArtifactInfo,
128 val activitySequence: List<ActivitySequenceItem>? = Lists.newArrayList(),
129 val workflowInputParameters: List<WorkflowInputParameter>
132 data class WorkflowSpecificationWrapper constructor(
133 val workflowSpecification: WorkflowSpecification
136 data class SOWorkflowList constructor(
137 val workflowSpecificationList: List<WorkflowSpecificationWrapper>? = Lists.newArrayList()