aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2017-09-11 15:01:53 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2017-09-11 15:01:53 +0800
commitc5f5d9b03e04ee1dfea490ecabc5c4b54760d062 (patch)
tree6197cccbc4dc4a3b5267407d07334f35f3f83ba7
parentd65b413cc3d03d4ce042a116c1b348a76de3a9ab (diff)
support script task
support create bpmn script task Issue-ID: SDC-305 Change-Id: Ied1df14a64c96d4d5277fa50bf10c75fc11952f3 Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
-rw-r--r--sdc-workflow-designer-ui/src/app/app.module.ts2
-rw-r--r--sdc-workflow-designer-ui/src/app/components/node/node.component.css9
-rw-r--r--sdc-workflow-designer-ui/src/app/components/property/properties.component.html1
-rw-r--r--sdc-workflow-designer-ui/src/app/components/property/script-task/script-task.component.html28
-rw-r--r--sdc-workflow-designer-ui/src/app/components/property/script-task/script-task.component.ts22
-rw-r--r--sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.css8
-rw-r--r--sdc-workflow-designer-ui/src/app/model/workflow/node-type.enum.ts1
-rw-r--r--sdc-workflow-designer-ui/src/app/model/workflow/script-task.ts24
-rw-r--r--sdc-workflow-designer-ui/src/app/services/workflow-process.service.ts4
9 files changed, 99 insertions, 0 deletions
diff --git a/sdc-workflow-designer-ui/src/app/app.module.ts b/sdc-workflow-designer-ui/src/app/app.module.ts
index e2d36a3a..55b57953 100644
--- a/sdc-workflow-designer-ui/src/app/app.module.ts
+++ b/sdc-workflow-designer-ui/src/app/app.module.ts
@@ -45,6 +45,7 @@ import { SwaggerTreeConverterService } from "./services/swagger-tree-converter.s
import { WorkflowProcessService } from "./services/workflow-process.service";
import { IntermediateCatchEventComponent } from "./components/property/intermediate-catch-event/intermediate-catch-event.component";
import { SequenceFlowComponent } from "./components/sequence-flow/sequence-flow.component";
+import { ScriptTaskComponent } from "./components/property/script-task/script-task.component";
@NgModule({
declarations: [
@@ -62,6 +63,7 @@ import { SequenceFlowComponent } from "./components/sequence-flow/sequence-flow.
PropertiesComponent,
RestTaskComponent,
RestTaskParametersComponent,
+ ScriptTaskComponent,
SequenceFlowComponent,
StartEventParametersComponent,
ToolbarComponent,
diff --git a/sdc-workflow-designer-ui/src/app/components/node/node.component.css b/sdc-workflow-designer-ui/src/app/components/node/node.component.css
index 1498fcea..093892e4 100644
--- a/sdc-workflow-designer-ui/src/app/components/node/node.component.css
+++ b/sdc-workflow-designer-ui/src/app/components/node/node.component.css
@@ -256,6 +256,15 @@
background-image: url("data:image/svg+xml;utf8,<?xml version='1.0' encoding='UTF-8' standalone='no'?><svg xmlns='http://www.w3.org/2000/svg' xmlns:oryx='http://www.b3mn.org/oryx' viewBox='1 1 30 30' width='28' height='28' style='fill:transparent' version='1.0'> <defs></defs> <oryx:magnets> <oryx:magnet oryx:cx='16' oryx:cy='16' oryx:default='yes' /> </oryx:magnets> <oryx:docker oryx:cx='16' oryx:cy='16' /> <g pointer-events='fill'> <defs> <radialGradient id='background' cx='10%' cy='10%' r='100%' fx='10%' fy='10%'> <stop offset='0%' stop-color='#ffffff' stop-opacity='1'/> <stop id='fill_el' offset='100%' stop-color='#ffffff' stop-opacity='1'/> </radialGradient> </defs> <circle id='bg_frame' cx='16' cy='16' r='15' stroke='black' stroke-width='1' style='stroke-dasharray: 5.5, 3' /> <circle id='frame2_non_interrupting' cx='16' cy='16' r='12' stroke='black' fill='none' stroke-width='1' style='stroke-dasharray: 4.5, 3' /><circle id='frame' cx='16' cy='16' r='15' stroke='black' fill='none' stroke-width='1'/><circle id='frame2' cx='16' cy='16' r='12' stroke='black' fill='none' stroke-width='1'/><circle id='circle' cx='16' cy='16' r='10' stroke='black' fill='none' stroke-width='1'/> <path id='path1' d='M 16 6 L 16 9 M 21 7 L 19.5 10 M 25 11 L 22 12.5 M 26 16 L 23 16 M 25 21 L 22 19.5 M 21 25 L 19.5 22 M 16 26 L 16 23 M 11 25 L 12.5 22 M 7 21 L 10 19.5 M 6 16 L 9 16 M 7 11 L 10 12.5 M 11 7 L 12.5 10 M 18 9 L 16 16 L 20 16' fill='none' stroke='black' /> <text font-size='11' id='text_name' x='16' y='33' oryx:align='top center' stroke='black'></text></g></svg>");
}
+
+.scriptTask {
+ border-radius: 8px;
+ border: 2px solid rgb(0, 0, 0);
+ height: 60px;
+ width: 80px;
+ background-image: url("data:image/svg+xml;utf8,<?xml version='1.0' encoding='UTF-8' standalone='no'?> <svg xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg' xmlns:oryx='http://www.b3mn.org/oryx' version='1.0' width='100%' height='100%'> <g id='scriptTask' transform='scale(1, 1) translate(8,8)'> <path oryx:anchors='top left' id='paper' style='opacity:1;fill:none;stroke:#000000' d='M6.402,0.5h14.5c0,0-5.833,2.833-5.833,5.583s4.417,6,4.417,9.167 s-4.167,5.083-4.167,5.083H0.235c0,0,5-2.667,5-5s-4.583-6.75-4.583-9.25S6.402,0.5,6.402,0.5z'/> <path oryx:anchors='top left' id='line1' style='opacity:1;fill:none;stroke:#000000;stroke-width:1.5' d='M 3.5 4.5 L 13.5 4.5' /> <path oryx:anchors='top left' id='line2' style='opacity:1;fill:none;stroke:#000000;stroke-width:1.5' d='M 3.8 8.5 L 13.8 8.5' /> <path oryx:anchors='top left' id='line3' style='opacity:1;fill:none;stroke:#000000;stroke-width:1.5' d='M 6.3 12.5 L 16.3 12.5' /> <path oryx:anchors='top left' id='line4' style='opacity:1;fill:none;stroke:#000000;stroke-width:1.5' d='M 6.5 16.5 L 16.5 16.5' /> </g> </svg> ");
+}
+
.restTask {
border-radius: 8px;
border: 2px solid rgb(0, 0, 0);
diff --git a/sdc-workflow-designer-ui/src/app/components/property/properties.component.html b/sdc-workflow-designer-ui/src/app/components/property/properties.component.html
index 86a67823..2870a4b1 100644
--- a/sdc-workflow-designer-ui/src/app/components/property/properties.component.html
+++ b/sdc-workflow-designer-ui/src/app/components/property/properties.component.html
@@ -42,4 +42,5 @@
<b4t-start-event-parameters *ngIf="'startEvent' == node.type" [node]="node"></b4t-start-event-parameters>
<b4t-rest-task *ngIf="node.type == 'restTask'" [node]="node" [planItems]="planItems"></b4t-rest-task>
<b4t-intermediate-catch-event *ngIf="'intermediateCatchEvent' == node.type" [node]="node"></b4t-intermediate-catch-event>
+ <b4t-script-task *ngIf="node.type == 'scriptTask'" [node]="node"></b4t-script-task>
</div>
diff --git a/sdc-workflow-designer-ui/src/app/components/property/script-task/script-task.component.html b/sdc-workflow-designer-ui/src/app/components/property/script-task/script-task.component.html
new file mode 100644
index 00000000..6d2bf1ac
--- /dev/null
+++ b/sdc-workflow-designer-ui/src/app/components/property/script-task/script-task.component.html
@@ -0,0 +1,28 @@
+<!--
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+-->
+
+<div class="form-group row">
+ <label class="col-md-3 form-control-label text-md-right">Script Format</label>
+ <div class="col-md-9">
+ <input class="form-control" type="text" [(ngModel)]="node.scriptFormate">
+ </div>
+</div>
+
+<div class="form-group row">
+ <label class="col-md-3 form-control-label text-md-right">Script</label>
+ <div class="col-md-9">
+ <textarea class="form-control" type="text" rows="20" [(ngModel)]="node.script"></textarea>
+ </div>
+</div>
+
diff --git a/sdc-workflow-designer-ui/src/app/components/property/script-task/script-task.component.ts b/sdc-workflow-designer-ui/src/app/components/property/script-task/script-task.component.ts
new file mode 100644
index 00000000..9e55ed49
--- /dev/null
+++ b/sdc-workflow-designer-ui/src/app/components/property/script-task/script-task.component.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 { AfterViewInit, Component, Input } from '@angular/core';
+
+import { ScriptTask } from "../../../model/workflow/script-task";
+
+@Component({
+ selector: 'b4t-script-task',
+ templateUrl: 'script-task.component.html',
+})
+export class ScriptTaskComponent {
+ @Input() public node: ScriptTask;
+}
diff --git a/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.css b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.css
index 942ac586..3edffd66 100644
--- a/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.css
+++ b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.css
@@ -93,6 +93,14 @@ button span{
background-image: url("data:image/svg+xml;utf8,<?xml version='1.0' encoding='UTF-8' standalone='no'?><svg xmlns='http://www.w3.org/2000/svg' xmlns:oryx='http://www.b3mn.org/oryx' viewBox='1 1 30 30' width='28' height='28' style='fill:transparent' version='1.0'> <defs></defs> <oryx:magnets> <oryx:magnet oryx:cx='16' oryx:cy='16' oryx:default='yes' /> </oryx:magnets> <oryx:docker oryx:cx='16' oryx:cy='16' /> <g pointer-events='fill'> <defs> <radialGradient id='background' cx='10%' cy='10%' r='100%' fx='10%' fy='10%'> <stop offset='0%' stop-color='#ffffff' stop-opacity='1'/> <stop id='fill_el' offset='100%' stop-color='#ffffff' stop-opacity='1'/> </radialGradient> </defs> <circle id='bg_frame' cx='16' cy='16' r='15' stroke='black' stroke-width='1' style='stroke-dasharray: 5.5, 3' /> <circle id='frame2_non_interrupting' cx='16' cy='16' r='12' stroke='black' fill='none' stroke-width='1' style='stroke-dasharray: 4.5, 3' /><circle id='frame' cx='16' cy='16' r='15' stroke='black' fill='none' stroke-width='1'/><circle id='frame2' cx='16' cy='16' r='12' stroke='black' fill='none' stroke-width='1'/><circle id='circle' cx='16' cy='16' r='10' stroke='black' fill='none' stroke-width='1'/> <path id='path1' d='M 16 6 L 16 9 M 21 7 L 19.5 10 M 25 11 L 22 12.5 M 26 16 L 23 16 M 25 21 L 22 19.5 M 21 25 L 19.5 22 M 16 26 L 16 23 M 11 25 L 12.5 22 M 7 21 L 10 19.5 M 6 16 L 9 16 M 7 11 L 10 12.5 M 11 7 L 12.5 10 M 18 9 L 16 16 L 20 16' fill='none' stroke='black' /> <text font-size='11' id='text_name' x='16' y='33' oryx:align='top center' stroke='black'></text></g></svg>");
}
+
+.scriptTask {
+ background-size: cover;
+ height: 30px;
+ width: 30px;
+ background-image: url("data:image/svg+xml;utf8,<?xml version='1.0' encoding='UTF-8' standalone='no'?> <svg xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg' xmlns:oryx='http://www.b3mn.org/oryx' version='1.0' width='100%' height='100%'> <g id='scriptTask' transform='scale(1, 1) translate(8,8)'> <path oryx:anchors='top left' id='paper' style='opacity:1;fill:none;stroke:#000000' d='M6.402,0.5h14.5c0,0-5.833,2.833-5.833,5.583s4.417,6,4.417,9.167 s-4.167,5.083-4.167,5.083H0.235c0,0,5-2.667,5-5s-4.583-6.75-4.583-9.25S6.402,0.5,6.402,0.5z'/> <path oryx:anchors='top left' id='line1' style='opacity:1;fill:none;stroke:#000000;stroke-width:1.5' d='M 3.5 4.5 L 13.5 4.5' /> <path oryx:anchors='top left' id='line2' style='opacity:1;fill:none;stroke:#000000;stroke-width:1.5' d='M 3.8 8.5 L 13.8 8.5' /> <path oryx:anchors='top left' id='line3' style='opacity:1;fill:none;stroke:#000000;stroke-width:1.5' d='M 6.3 12.5 L 16.3 12.5' /> <path oryx:anchors='top left' id='line4' style='opacity:1;fill:none;stroke:#000000;stroke-width:1.5' d='M 6.5 16.5 L 16.5 16.5' /> </g> </svg> ");
+}
+
.toscaTask {
border-radius: 8px;
border: 2px solid rgb(0, 0, 0);
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 c8d2fe2b..2481cdbb 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
@@ -17,4 +17,5 @@ export enum NodeType {
intermediateCatchEvent,
exclusiveGateway,
parallelGateway,
+ scriptTask,
}
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
new file mode 100644
index 00000000..3772226c
--- /dev/null
+++ b/sdc-workflow-designer-ui/src/app/model/workflow/script-task.ts
@@ -0,0 +1,24 @@
+/**
+ * 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 { 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);
+ }
+
+}
diff --git a/sdc-workflow-designer-ui/src/app/services/workflow-process.service.ts b/sdc-workflow-designer-ui/src/app/services/workflow-process.service.ts
index 7f56c4af..04417726 100644
--- a/sdc-workflow-designer-ui/src/app/services/workflow-process.service.ts
+++ b/sdc-workflow-designer-ui/src/app/services/workflow-process.service.ts
@@ -23,6 +23,7 @@ import { WorkflowConfigService } from "./workflow-config.service";
import { Swagger, SwaggerModelSimple, SwaggerReferenceObject } from "../model/swagger";
import { WorkflowService } from "./workflow.service";
import { IntermediateCatchEvent } from "../model/workflow/intermediate-catch-event";
+import { ScriptTask } from "../model/workflow/script-task";
/**
* WorkflowService
@@ -51,6 +52,9 @@ export class WorkflowProcessService {
case NodeType[NodeType.intermediateCatchEvent]:
node = new IntermediateCatchEvent(this.createId(), name, type, new Position(top, left), []);
break;
+ case NodeType[NodeType.scriptTask]:
+ node = new ScriptTask(this.createId(), name, type, new Position(top, left), []);
+ break;
default:
node = new WorkflowNode(this.createId(), name, type, new Position(top, left), []);
break;