aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/model
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/model')
-rw-r--r--sdc-workflow-designer-ui/src/app/model/model.ts16
-rw-r--r--sdc-workflow-designer-ui/src/app/model/notice-type.enum.ts11
-rw-r--r--sdc-workflow-designer-ui/src/app/model/plan-model.ts9
-rw-r--r--sdc-workflow-designer-ui/src/app/model/rest-config.ts34
-rw-r--r--sdc-workflow-designer-ui/src/app/model/swagger.ts16
-rw-r--r--sdc-workflow-designer-ui/src/app/model/value-object.ts15
-rw-r--r--sdc-workflow-designer-ui/src/app/model/value-source.enum.ts5
-rw-r--r--sdc-workflow-designer-ui/src/app/model/value-type.enum.ts9
-rw-r--r--sdc-workflow-designer-ui/src/app/model/workflow/node-type.enum.ts6
-rw-r--r--sdc-workflow-designer-ui/src/app/model/workflow/parameter.ts5
-rw-r--r--sdc-workflow-designer-ui/src/app/model/workflow/rest-task.ts12
-rw-r--r--sdc-workflow-designer-ui/src/app/model/workflow/script-task.ts2
-rw-r--r--sdc-workflow-designer-ui/src/app/model/workflow/service-task.ts19
-rw-r--r--sdc-workflow-designer-ui/src/app/model/workflow/workflow-node.ts2
14 files changed, 122 insertions, 39 deletions
diff --git a/sdc-workflow-designer-ui/src/app/model/model.ts b/sdc-workflow-designer-ui/src/app/model/model.ts
new file mode 100644
index 00000000..bd3c2c64
--- /dev/null
+++ b/sdc-workflow-designer-ui/src/app/model/model.ts
@@ -0,0 +1,16 @@
+/**
+ * Copyright (c) 2017 ZTE Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * ZTE - initial API and implementation and/or initial documentation
+ */
+import { WorkflowNode } from './workflow/workflow-node';
+export class Model {
+ public nodes: WorkflowNode[] = [];
+ public configs: any = {};
+}
diff --git a/sdc-workflow-designer-ui/src/app/model/notice-type.enum.ts b/sdc-workflow-designer-ui/src/app/model/notice-type.enum.ts
index 5ea60051..417f79cc 100644
--- a/sdc-workflow-designer-ui/src/app/model/notice-type.enum.ts
+++ b/sdc-workflow-designer-ui/src/app/model/notice-type.enum.ts
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2017 ZTE Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * ZTE - initial API and implementation and/or initial documentation
+ *******************************************************************************/
export enum NoticeType {
success, info, warning, danger
}
diff --git a/sdc-workflow-designer-ui/src/app/model/plan-model.ts b/sdc-workflow-designer-ui/src/app/model/plan-model.ts
index 9897f70e..7246e1c9 100644
--- a/sdc-workflow-designer-ui/src/app/model/plan-model.ts
+++ b/sdc-workflow-designer-ui/src/app/model/plan-model.ts
@@ -10,8 +10,13 @@
* ZTE - initial API and implementation and/or initial documentation
*/
import { WorkflowNode } from './workflow/workflow-node';
+import { Model } from './model';
export class PlanModel {
- public nodes: WorkflowNode[] = [];
- public configs: any = {};
+ public id: string;
+ public name: string;
+ public version: string;
+ public description: string;
+ public scene: string;
+ public data = new Model();
}
diff --git a/sdc-workflow-designer-ui/src/app/model/rest-config.ts b/sdc-workflow-designer-ui/src/app/model/rest-config.ts
index 9101bcef..cace1c48 100644
--- a/sdc-workflow-designer-ui/src/app/model/rest-config.ts
+++ b/sdc-workflow-designer-ui/src/app/model/rest-config.ts
@@ -1,17 +1,17 @@
-/**
- * Copyright (c) 2017 ZTE Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and the Apache License 2.0 which both accompany this distribution,
- * and are available at http://www.eclipse.org/legal/epl-v10.html
- * and http://www.apache.org/licenses/LICENSE-2.0
- *
- * Contributors:
- * ZTE - initial API and implementation and/or initial documentation
- */
-import { Swagger } from './swagger';
-
-export class RestConfig {
- constructor(public id: string, public name: string, public version: string, public url: string, public definition: string,
- public swagger?: Swagger) { }
-}
+/**
+ * Copyright (c) 2017 ZTE Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * ZTE - initial API and implementation and/or initial documentation
+ */
+import { Swagger } from './swagger';
+
+export class RestConfig {
+ constructor(public id: string, public name: string, public version: string, public url: string,
+ public swagger?: Swagger) { }
+}
diff --git a/sdc-workflow-designer-ui/src/app/model/swagger.ts b/sdc-workflow-designer-ui/src/app/model/swagger.ts
index e0ed1495..18867086 100644
--- a/sdc-workflow-designer-ui/src/app/model/swagger.ts
+++ b/sdc-workflow-designer-ui/src/app/model/swagger.ts
@@ -10,12 +10,13 @@
* ZTE - initial API and implementation and/or initial documentation
*******************************************************************************/
-export class SwaggerParameter {
+export class SwaggerParameterClass {
public description: string;
public position: string; // in path, query, header, body, form
public name: string;
public required: boolean;
public type: string;
+ public enum: any[];
// if position is body
public schema: SwaggerSchemaObject;
@@ -26,6 +27,7 @@ export class SwaggerParameter {
this.name = options.name;
this.required = options.required;
this.type = options.type;
+ this.enum = options.enum;
if (this.position === 'body') {
this.schema = getSchemaObject(options.schema);
}
@@ -40,7 +42,7 @@ export class SwaggerHeader {
}
}
-export class SwaggerResponse {
+export class SwaggerResponseClass {
public description: string;
public schema: SwaggerSchemaObject;
public headers: any;
@@ -65,7 +67,7 @@ export class SwaggerMethod {
public consumes: string[];
public description: string;
public operationId: string;
- public parameters: SwaggerParameter[];
+ public parameters: SwaggerParameterClass[];
public produces: string[];
public responses: any;
public summary: string;
@@ -75,7 +77,7 @@ export class SwaggerMethod {
this.consumes = consumes;
this.description = description;
this.operationId = operationId;
- this.parameters = parameters.map(param => new SwaggerParameter(param));
+ this.parameters = parameters.map(param => new SwaggerParameterClass(param));
this.produces = produces;
this.responses = this.initResponses(responses);
this.summary = summary;
@@ -85,7 +87,7 @@ export class SwaggerMethod {
private initResponses(responses: any): any {
const responseObjs = {};
for (const key in responses) {
- responseObjs[key] = new SwaggerResponse(responses[key]);
+ responseObjs[key] = new SwaggerResponseClass(responses[key]);
}
return responseObjs;
@@ -189,7 +191,7 @@ export class SwaggerReferenceObject extends SwaggerSchemaObject {
export class SwaggerPrimitiveObject extends SwaggerSchemaObject {
public collectionFormat: string;
- public defaultValue: any;
+ public default: any;
public enumValues: any[];
public exclusiveMaximum: boolean;
public exclusiveMinimum: boolean;
@@ -205,7 +207,7 @@ export class SwaggerPrimitiveObject extends SwaggerSchemaObject {
constructor(options: any) {
super();
this.collectionFormat = options.collectionFormat;
- this.defaultValue = options.default;
+ this.default = options.default;
this.enumValues = options.enum;
this.exclusiveMaximum = options.exclusiveMaximum;
this.exclusiveMinimum = options.exclusiveMinimum;
diff --git a/sdc-workflow-designer-ui/src/app/model/value-object.ts b/sdc-workflow-designer-ui/src/app/model/value-object.ts
new file mode 100644
index 00000000..0a079a8d
--- /dev/null
+++ b/sdc-workflow-designer-ui/src/app/model/value-object.ts
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2017 ZTE Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * ZTE - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+export interface ValueObject {
+ value?: any;
+ valueSource: string;
+}
diff --git a/sdc-workflow-designer-ui/src/app/model/value-source.enum.ts b/sdc-workflow-designer-ui/src/app/model/value-source.enum.ts
index f76f6591..720185a5 100644
--- a/sdc-workflow-designer-ui/src/app/model/value-source.enum.ts
+++ b/sdc-workflow-designer-ui/src/app/model/value-source.enum.ts
@@ -11,7 +11,10 @@
*******************************************************************************/
export enum ValueSource {
- String,
+ integer,
+ number,
+ boolean,
+ string,
Plan,
Topology,
Variable,
diff --git a/sdc-workflow-designer-ui/src/app/model/value-type.enum.ts b/sdc-workflow-designer-ui/src/app/model/value-type.enum.ts
index ab6d07b8..d3056968 100644
--- a/sdc-workflow-designer-ui/src/app/model/value-type.enum.ts
+++ b/sdc-workflow-designer-ui/src/app/model/value-type.enum.ts
@@ -11,7 +11,10 @@
*******************************************************************************/
export enum ValueType {
- String,
- Number,
- Date,
+ integer,
+ number,
+ boolean,
+ string,
+ array,
+ object
}
diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/node-type.enum.ts b/sdc-workflow-designer-ui/src/app/model/workflow/node-type.enum.ts
index 22170c16..c02816e8 100644
--- a/sdc-workflow-designer-ui/src/app/model/workflow/node-type.enum.ts
+++ b/sdc-workflow-designer-ui/src/app/model/workflow/node-type.enum.ts
@@ -15,11 +15,13 @@ export enum NodeType {
endEvent,
errorStartEvent,
errorEndEvent,
+ intermediateCatchEvent,
toscaNodeManagementTask,
+ serviceTask,
+ scriptTask,
restTask,
exclusiveGateway,
parallelGateway,
subProcess,
- intermediateCatchEvent,
- scriptTask
+ callActivity
}
diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/parameter.ts b/sdc-workflow-designer-ui/src/app/model/workflow/parameter.ts
index 67ca7f3f..7a904005 100644
--- a/sdc-workflow-designer-ui/src/app/model/workflow/parameter.ts
+++ b/sdc-workflow-designer-ui/src/app/model/workflow/parameter.ts
@@ -14,7 +14,8 @@ import { ValueSource } from '../value-source.enum';
import { ValueType } from '../value-type.enum';
export class Parameter {
- constructor(public name: string, public value: string, public valueSource: string,
- public type: string = ValueType[ValueType.String], public required: boolean = false) {
+ constructor(public name: string, public value: any, public valueSource: string,
+ public type = ValueType[ValueType.string], public required = false,
+ public show = true, public errorMsg = '') {
}
}
diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/rest-task.ts b/sdc-workflow-designer-ui/src/app/model/workflow/rest-task.ts
index 12637d01..1235a479 100644
--- a/sdc-workflow-designer-ui/src/app/model/workflow/rest-task.ts
+++ b/sdc-workflow-designer-ui/src/app/model/workflow/rest-task.ts
@@ -9,17 +9,21 @@
* Contributors:
* ZTE - initial API and implementation and/or initial documentation
*/
-import { SwaggerResponse } from "../swagger";
+import { SwaggerResponseClass } from "../swagger";
import { RestParameter } from './rest-parameter';
import { WorkflowNode } from './workflow-node';
+import { SwaggerBaseParameter } from "./swagger/swagger-base-parameter";
export interface RestTask extends WorkflowNode {
restConfigId?: string;
+ baseUrl?: string;
+ serviceName?: string;
+ serviceVersion?: string;
path?: string;
method?: string;
operationId?: string;
- produces?: string[];
+ produces?: string[]; // do not support non json MIME types, maybe use this later.
consumes?: string[];
- parameters?: RestParameter[];
- responses?: SwaggerResponse[];
+ parameters?: any[];
+ responses?: SwaggerResponseClass[];
}
diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/script-task.ts b/sdc-workflow-designer-ui/src/app/model/workflow/script-task.ts
index 880f38a0..75d86f5a 100644
--- a/sdc-workflow-designer-ui/src/app/model/workflow/script-task.ts
+++ b/sdc-workflow-designer-ui/src/app/model/workflow/script-task.ts
@@ -13,5 +13,5 @@ import { WorkflowNode } from './workflow-node';
export interface ScriptTask extends WorkflowNode {
scriptFormat: string;
- script?: string;
+ script: string;
}
diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/service-task.ts b/sdc-workflow-designer-ui/src/app/model/workflow/service-task.ts
new file mode 100644
index 00000000..c0ce6412
--- /dev/null
+++ b/sdc-workflow-designer-ui/src/app/model/workflow/service-task.ts
@@ -0,0 +1,19 @@
+/**
+ * Copyright (c) 2017 ZTE Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * ZTE - initial API and implementation and/or initial documentation
+ */
+import { WorkflowNode } from './workflow-node';
+import { Parameter } from './parameter';
+
+export interface ServiceTask extends WorkflowNode {
+ className: string;
+ inputs: Parameter[];
+ outputs: Parameter[];
+}
diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/workflow-node.ts b/sdc-workflow-designer-ui/src/app/model/workflow/workflow-node.ts
index 628148a4..f278d188 100644
--- a/sdc-workflow-designer-ui/src/app/model/workflow/workflow-node.ts
+++ b/sdc-workflow-designer-ui/src/app/model/workflow/workflow-node.ts
@@ -17,7 +17,9 @@ export interface WorkflowNode extends WorkflowElement {
connection: SequenceFlow[];
id: string;
name: string;
+ icon?: string;
parentId: string;
position: Position;
type: string;
+ typeId?: string;
}