From 626d74e4c51aa47da5d5d643b5b7a04188b5552a Mon Sep 17 00:00:00 2001 From: Lvbo163 Date: Thu, 31 Aug 2017 14:29:07 +0800 Subject: support set parameter for workflow support set input and output params for start event Issue-ID: SDC-120 Change-Id: Ib5a87692e06817b2676b3f2f2223e1ced117b5c9 Signed-off-by: Lvbo163 --- .../src/app/model/workflow/end-event.ts | 15 +++++++++++++++ .../src/app/model/workflow/node-type.enum.ts | 22 ++++++++++++++++++++++ .../src/app/model/workflow/parameter.ts | 20 ++++++++++++++++++++ .../src/app/model/workflow/position.ts | 21 +++++++++++++++++++++ .../src/app/model/workflow/sequence-flow.ts | 16 ++++++++++++++++ .../src/app/model/workflow/start-event.ts | 17 +++++++++++++++++ .../src/app/model/workflow/workflow-node.ts | 17 +++++++++++++++++ .../src/app/model/workflow/workflow.ts | 21 +++++++++++++++++++++ 8 files changed, 149 insertions(+) create mode 100644 sdc-workflow-designer-ui/src/app/model/workflow/end-event.ts create mode 100644 sdc-workflow-designer-ui/src/app/model/workflow/node-type.enum.ts create mode 100644 sdc-workflow-designer-ui/src/app/model/workflow/parameter.ts create mode 100644 sdc-workflow-designer-ui/src/app/model/workflow/position.ts create mode 100644 sdc-workflow-designer-ui/src/app/model/workflow/sequence-flow.ts create mode 100644 sdc-workflow-designer-ui/src/app/model/workflow/start-event.ts create mode 100644 sdc-workflow-designer-ui/src/app/model/workflow/workflow-node.ts create mode 100644 sdc-workflow-designer-ui/src/app/model/workflow/workflow.ts (limited to 'sdc-workflow-designer-ui/src/app/model/workflow') 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 new file mode 100644 index 00000000..300af898 --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/model/workflow/end-event.ts @@ -0,0 +1,15 @@ +import {WorkflowNode} from './workflow-node'; +/** + * 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 class EndEvent extends WorkflowNode { +} 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 new file mode 100644 index 00000000..994b3b67 --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/model/workflow/node-type.enum.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 + *******************************************************************************/ + +export enum NodeType { + startEvent, + endEvent, + toscaNodeManagementTask, + restTask, + exclusiveGateway, + parallelGateway, + subProcess, + intermediateCatchEvent, +} diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/parameter.ts b/sdc-workflow-designer-ui/src/app/model/workflow/parameter.ts new file mode 100644 index 00000000..cc87a6fa --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/model/workflow/parameter.ts @@ -0,0 +1,20 @@ +/** + * 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 { ValueType } from '../value-type.enum'; + +export class Parameter { + constructor(public name: string, public value: string, public valueSource: string, + public type: string = ValueType[ValueType.String]) { + } +} diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/position.ts b/sdc-workflow-designer-ui/src/app/model/workflow/position.ts new file mode 100644 index 00000000..b690f4d6 --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/model/workflow/position.ts @@ -0,0 +1,21 @@ +/** + * 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 { Injectable } from '@angular/core'; + +/** + * Position + * Workflow node position + */ +export class Position { + constructor(public top: number, public left: number, public width?: number, public height?: number) { } +} diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/sequence-flow.ts b/sdc-workflow-designer-ui/src/app/model/workflow/sequence-flow.ts new file mode 100644 index 00000000..492cc84d --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/model/workflow/sequence-flow.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 + */ + +export class SequenceFlow { + + constructor(public sourceRef: string, public targetRef: string, public name?: string, public condition?: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 new file mode 100644 index 00000000..d609f7ca --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/model/workflow/start-event.ts @@ -0,0 +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 { Parameter } from './parameter'; +import { WorkflowNode } from './workflow-node'; + +export class StartEvent extends WorkflowNode { + public parameters: 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 new file mode 100644 index 00000000..9e54be13 --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/model/workflow/workflow-node.ts @@ -0,0 +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 { 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[]) {} +} diff --git a/sdc-workflow-designer-ui/src/app/model/workflow/workflow.ts b/sdc-workflow-designer-ui/src/app/model/workflow/workflow.ts new file mode 100644 index 00000000..672396cf --- /dev/null +++ b/sdc-workflow-designer-ui/src/app/model/workflow/workflow.ts @@ -0,0 +1,21 @@ +/** + * 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 { Injectable } from '@angular/core'; +import { WorkflowNode } from "./workflow-node"; + +/** + * Workflow + */ +export class Workflow { + constructor(public id: string, public name: string, public nodes: WorkflowNode[]) {} +} -- cgit 1.2.3-korg