diff options
author | 2018-01-10 15:05:39 +0800 | |
---|---|---|
committer | 2018-01-10 15:05:39 +0800 | |
commit | 38dfd59a8b5d05266e5567f79dcf30fd10ef7c54 (patch) | |
tree | 043a724663d3324ce80cc546a241898e99796897 /sdc-workflow-designer-ui/src/app/model/workflow | |
parent | eb2d1c385e5c3d96e770b776f74ddbde9f2b133f (diff) |
split element by type
split elements by type in toolbar
Issue-ID: SDC-895
Change-Id: I0254c9c5f938df80942d60ffefe4b8577c788233
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/model/workflow')
14 files changed, 110 insertions, 41 deletions
diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/end-event.ts b/sdc-workflow-designer-ui/src/app/model/workflow/end-event.ts index 300af898..e3fbcad3 100644 --- a/sdc-workflow-designer-ui/src/app/model/workflow/end-event.ts +++ b/sdc-workflow-designer-ui/src/app/model/workflow/end-event.ts @@ -1,4 +1,3 @@ -import {WorkflowNode} from './workflow-node'; /** * Copyright (c) 2017 ZTE Corporation. * All rights reserved. This program and the accompanying materials @@ -10,6 +9,7 @@ import {WorkflowNode} from './workflow-node'; * Contributors: * ZTE - initial API and implementation and/or initial documentation */ +import {WorkflowNode} from './workflow-node'; -export class EndEvent extends WorkflowNode { +export interface EndEvent extends WorkflowNode { } diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/error-event.ts b/sdc-workflow-designer-ui/src/app/model/workflow/error-event.ts new file mode 100644 index 00000000..7285402a --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/model/workflow/error-event.ts @@ -0,0 +1,18 @@ +/**
+ * 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 { ValueSource } from '../value-source.enum';
+import { Parameter } from './parameter';
+import { WorkflowNode } from './workflow-node';
+
+export interface ErrorEvent extends WorkflowNode {
+ parameter?: Parameter;
+}
diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/intermediate-catch-event.ts b/sdc-workflow-designer-ui/src/app/model/workflow/intermediate-catch-event.ts index 13a3d1e0..653e627f 100644 --- a/sdc-workflow-designer-ui/src/app/model/workflow/intermediate-catch-event.ts +++ b/sdc-workflow-designer-ui/src/app/model/workflow/intermediate-catch-event.ts @@ -12,7 +12,6 @@ import { TimerEventDefinition, TimerEventDefinitionType } from './timer-event-definition'; import { WorkflowNode } from './workflow-node'; -export class IntermediateCatchEvent extends WorkflowNode { - public timerEventDefinition: TimerEventDefinition = - new TimerEventDefinition(TimerEventDefinitionType[TimerEventDefinitionType.timeDuration]); +export interface IntermediateCatchEvent extends WorkflowNode { + timerEventDefinition?: TimerEventDefinition; } 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 2481cdbb..22170c16 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 @@ -13,9 +13,13 @@ export enum NodeType { startEvent, endEvent, + errorStartEvent, + errorEndEvent, + toscaNodeManagementTask, restTask, - intermediateCatchEvent, exclusiveGateway, parallelGateway, - scriptTask, + subProcess, + intermediateCatchEvent, + scriptTask } 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 cc87a6fa..67ca7f3f 100644 --- a/sdc-workflow-designer-ui/src/app/model/workflow/parameter.ts +++ b/sdc-workflow-designer-ui/src/app/model/workflow/parameter.ts @@ -15,6 +15,6 @@ 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 type: string = ValueType[ValueType.String], public required: boolean = false) { } } diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/rest-parameter.ts b/sdc-workflow-designer-ui/src/app/model/workflow/rest-parameter.ts index ecea3541..a7e4eeea 100644 --- a/sdc-workflow-designer-ui/src/app/model/workflow/rest-parameter.ts +++ b/sdc-workflow-designer-ui/src/app/model/workflow/rest-parameter.ts @@ -14,7 +14,7 @@ import { WorkflowNode } from './workflow-node'; export class RestParameter extends Parameter { constructor(name: string, value: string, valueSource: string, type: string, - public position: string, public schema: any) { - super(name, value, valueSource, type); + public position: string, public schema: any, public required: boolean) { + super(name, value, valueSource, type, required); } } 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 2b3045df..12637d01 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,17 @@ * Contributors: * ZTE - initial API and implementation and/or initial documentation */ +import { SwaggerResponse } from "../swagger"; import { RestParameter } from './rest-parameter'; import { WorkflowNode } from './workflow-node'; -export class RestTask extends WorkflowNode { - public serviceName: string; - public serviceVersion: string; - public url: string; - public method: string; - public operationId: string; - public produces: string[] = []; - public consumes: string[] = []; - public parameters: RestParameter[] = []; - public responses: any[] = []; +export interface RestTask extends WorkflowNode { + restConfigId?: string; + path?: string; + method?: string; + operationId?: string; + produces?: string[]; + consumes?: string[]; + parameters?: RestParameter[]; + responses?: SwaggerResponse[]; } 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 3772226c..392376ad 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 @@ -9,16 +9,9 @@ * Contributors:
* ZTE - initial API and implementation and/or initial documentation
*/
-import { Position } from './position';
import { WorkflowNode } from './workflow-node';
-import { SequenceFlow } from "./sequence-flow";
-
-export class ScriptTask extends WorkflowNode {
- public scriptFormat: string;
- public script: string;
-
- public constructor(public id: string, public name: string, public type: string, public position: Position, public sequenceFlows: SequenceFlow[]) {
- super(id, name, type, position, sequenceFlows);
- }
+export interface ScriptTask extends WorkflowNode {
+ scriptFormat: string;
+ script?: string;
}
diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/start-event.ts b/sdc-workflow-designer-ui/src/app/model/workflow/start-event.ts index d609f7ca..a8f6444c 100644 --- a/sdc-workflow-designer-ui/src/app/model/workflow/start-event.ts +++ b/sdc-workflow-designer-ui/src/app/model/workflow/start-event.ts @@ -12,6 +12,6 @@ import { Parameter } from './parameter'; import { WorkflowNode } from './workflow-node'; -export class StartEvent extends WorkflowNode { - public parameters: Parameter[] = []; +export interface StartEvent extends WorkflowNode { + parameters?: Parameter[]; } diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/sub-process.ts b/sdc-workflow-designer-ui/src/app/model/workflow/sub-process.ts new file mode 100644 index 00000000..0da453e4 --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/model/workflow/sub-process.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
+ */
+import { WorkflowNode } from './workflow-node';
+export interface SubProcess extends WorkflowNode {
+ children?: WorkflowNode[];
+}
diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/timer-event-definition.ts b/sdc-workflow-designer-ui/src/app/model/workflow/timer-event-definition.ts index f78d3973..101ef46c 100644 --- a/sdc-workflow-designer-ui/src/app/model/workflow/timer-event-definition.ts +++ b/sdc-workflow-designer-ui/src/app/model/workflow/timer-event-definition.ts @@ -17,11 +17,9 @@ export enum TimerEventDefinitionType { timeCycle, } -export class TimerEventDefinition { - constructor(public type: string, // 'timeDate', 'timeCycle', 'timeDuration' - public timeDate?: string, // <timeDate>10/10/2099 00:00:00</timeDate> - public timeDuration?: string, // ISO 8601 P1Y3M5DT6H7M30S - public timeCycle?: string) { // ISO 8601 P1Y3M5DT6H7M30S - - } +export interface TimerEventDefinition extends WorkflowNode { + type: string; // 'timeDate', 'timeCycle', 'timeDuration' + timeDate?: string; // 2007-04-05T12:30-02:00 + timeDuration?: string; // ISO 8601 P1Y3M5DT6H7M30S + timeCycle?: string; // ISO 8601 R5/P1Y2M10DT2H30M } diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/tosca-node-task.ts b/sdc-workflow-designer-ui/src/app/model/workflow/tosca-node-task.ts new file mode 100644 index 00000000..986f0188 --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/model/workflow/tosca-node-task.ts @@ -0,0 +1,22 @@ +/**
+ * 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 { NodeTemplate } from '../topology/node-template';
+import { Parameter } from './parameter';
+import { WorkflowNode } from './workflow-node';
+
+export interface ToscaNodeTask extends WorkflowNode {
+ input?: Parameter[];
+ output?: Parameter[];
+ nodeInterface?: string;
+ operation?: string;
+ template?: NodeTemplate;
+}
diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/workflow-element.ts b/sdc-workflow-designer-ui/src/app/model/workflow/workflow-element.ts new file mode 100644 index 00000000..9b0e2fe0 --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/model/workflow/workflow-element.ts @@ -0,0 +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 interface WorkflowElement {
+}
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 9e54be13..628148a4 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 @@ -9,9 +9,15 @@ * Contributors: * ZTE - initial API and implementation and/or initial documentation */ +import { WorkflowElement } from './workflow-element'; import { Position } from './position'; import { SequenceFlow } from './sequence-flow'; -export class WorkflowNode { - public constructor(public id: string, public name: string, public type: string, public position: Position, public sequenceFlows: SequenceFlow[]) {} +export interface WorkflowNode extends WorkflowElement { + connection: SequenceFlow[]; + id: string; + name: string; + parentId: string; + position: Position; + type: string; } |