support script task 83/11583/1
authorLvbo163 <lv.bo163@zte.com.cn>
Mon, 11 Sep 2017 07:01:53 +0000 (15:01 +0800)
committerLvbo163 <lv.bo163@zte.com.cn>
Mon, 11 Sep 2017 07:01:53 +0000 (15:01 +0800)
support create bpmn script task

Issue-ID: SDC-305

Change-Id: Ied1df14a64c96d4d5277fa50bf10c75fc11952f3
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
sdc-workflow-designer-ui/src/app/app.module.ts
sdc-workflow-designer-ui/src/app/components/node/node.component.css
sdc-workflow-designer-ui/src/app/components/property/properties.component.html
sdc-workflow-designer-ui/src/app/components/property/script-task/script-task.component.html [new file with mode: 0644]
sdc-workflow-designer-ui/src/app/components/property/script-task/script-task.component.ts [new file with mode: 0644]
sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.css
sdc-workflow-designer-ui/src/app/model/workflow/node-type.enum.ts
sdc-workflow-designer-ui/src/app/model/workflow/script-task.ts [new file with mode: 0644]
sdc-workflow-designer-ui/src/app/services/workflow-process.service.ts

index e2d36a3..55b5795 100644 (file)
@@ -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,
index 1498fce..093892e 100644 (file)
     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>");\r
 }\r
 \r
+\r
+.scriptTask {\r
+    border-radius: 8px;\r
+    border: 2px solid rgb(0, 0, 0);\r
+    height: 60px;\r
+    width: 80px;\r
+    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> ");\r
+}\r
+\r
 .restTask {\r
     border-radius: 8px;\r
     border: 2px solid rgb(0, 0, 0);\r
index 86a6782..2870a4b 100644 (file)
@@ -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 (file)
index 0000000..6d2bf1a
--- /dev/null
@@ -0,0 +1,28 @@
+<!--\r
+/*******************************************************************************\r
+ * Copyright (c) 2017 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * and the Apache License 2.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ *******************************************************************************/\r
+-->\r
+\r
+<div class="form-group row">\r
+    <label class="col-md-3 form-control-label text-md-right">Script Format</label>\r
+    <div class="col-md-9">\r
+        <input class="form-control" type="text" [(ngModel)]="node.scriptFormate">\r
+    </div>\r
+</div>\r
+\r
+<div class="form-group row">\r
+    <label class="col-md-3 form-control-label text-md-right">Script</label>\r
+    <div class="col-md-9">\r
+        <textarea class="form-control" type="text" rows="20" [(ngModel)]="node.script"></textarea>\r
+    </div>\r
+</div>\r
+\r
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 (file)
index 0000000..9e55ed4
--- /dev/null
@@ -0,0 +1,22 @@
+/*******************************************************************************\r
+ * Copyright (c) 2017 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * and the Apache License 2.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ *******************************************************************************/\r
+import { AfterViewInit, Component, Input } from '@angular/core';\r
+\r
+import { ScriptTask } from "../../../model/workflow/script-task";\r
+\r
+@Component({\r
+    selector: 'b4t-script-task',\r
+    templateUrl: 'script-task.component.html',\r
+})\r
+export class ScriptTaskComponent {\r
+    @Input() public node: ScriptTask;\r
+}\r
index 942ac58..3edffd6 100644 (file)
@@ -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>");\r
 }\r
 \r
+\r
+.scriptTask {\r
+    background-size: cover;\r
+    height: 30px;\r
+    width: 30px;\r
+    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> ");\r
+}\r
+\r
 .toscaTask {\r
     border-radius: 8px;\r
     border: 2px solid rgb(0, 0, 0);\r
index c8d2fe2..2481cdb 100644 (file)
@@ -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 (file)
index 0000000..3772226
--- /dev/null
@@ -0,0 +1,24 @@
+/**\r
+ * Copyright (c) 2017 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * and the Apache License 2.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ *     ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+import { Position } from './position';\r
+import { WorkflowNode } from './workflow-node';\r
+import { SequenceFlow } from "./sequence-flow";\r
+\r
+export class ScriptTask extends WorkflowNode {\r
+    public scriptFormat: string;\r
+    public script: string;\r
+\r
+    public constructor(public id: string, public name: string, public type: string, public position: Position, public sequenceFlows: SequenceFlow[]) {\r
+        super(id, name, type, position, sequenceFlows);\r
+    }\r
+\r
+}\r
index 7f56c4a..0441772 100644 (file)
@@ -23,6 +23,7 @@ import { WorkflowConfigService } from "./workflow-config.service";
 import { Swagger, SwaggerModelSimple, SwaggerReferenceObject } from "../model/swagger";\r
 import { WorkflowService } from "./workflow.service";\r
 import { IntermediateCatchEvent } from "../model/workflow/intermediate-catch-event";\r
+import { ScriptTask } from "../model/workflow/script-task";\r
 \r
 /**\r
  * WorkflowService\r
@@ -51,6 +52,9 @@ export class WorkflowProcessService {
             case NodeType[NodeType.intermediateCatchEvent]:\r
                 node = new IntermediateCatchEvent(this.createId(), name, type, new Position(top, left), []);\r
                 break;\r
+            case NodeType[NodeType.scriptTask]:\r
+                node = new ScriptTask(this.createId(), name, type, new Position(top, left), []);\r
+                break;\r
             default:\r
                 node = new WorkflowNode(this.createId(), name, type, new Position(top, left), []);\r
                 break;\r