diff options
author | Lvbo163 <lv.bo163@zte.com.cn> | 2017-09-04 19:57:31 +0800 |
---|---|---|
committer | Lvbo163 <lv.bo163@zte.com.cn> | 2017-09-04 19:57:31 +0800 |
commit | 08a13945e82270e6bf27c2d6b26a5dde127ad198 (patch) | |
tree | 2d3ea524c9b7e5b969f716e11bfa950538b64abb /sdc-workflow-designer-ui/src/app/services | |
parent | 76f9fa54825d98013182524d16290f04e3c9398a (diff) |
support rest task node
support rest task node to call rest api definited by swagger
Issue-ID: SDC-271
Change-Id: Ifb4acdd393609da4ce1e9e2cd8d20a2848365b9b
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/services')
-rw-r--r-- | sdc-workflow-designer-ui/src/app/services/workflow-config.service.ts | 10 | ||||
-rw-r--r-- | sdc-workflow-designer-ui/src/app/services/workflow.service.ts | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sdc-workflow-designer-ui/src/app/services/workflow-config.service.ts b/sdc-workflow-designer-ui/src/app/services/workflow-config.service.ts index 00a2b9ef..469fde92 100644 --- a/sdc-workflow-designer-ui/src/app/services/workflow-config.service.ts +++ b/sdc-workflow-designer-ui/src/app/services/workflow-config.service.ts @@ -15,6 +15,7 @@ import { WorkflowService } from "./workflow.service"; import { Microservice } from "../model/workflow/microservice";
import { Observable } from "rxjs/Rx";
import { HttpService } from "../util/http.service";
+import { Swagger } from "../model/swagger";
/**
* WorkflowConfigService
@@ -36,4 +37,13 @@ export class WorkflowConfigService { };
return this.httpService.get(url).map(response => response.data);
}
+
+ public getSwaggerInfo(serviceName: string, version: string): Swagger {
+ const microservice = this.getMicroservices().find(service => (service.name === serviceName && service.version === version));
+ if(microservice) {
+ return microservice.swagger;
+ } else {
+ return undefined;
+ }
+ }
}
diff --git a/sdc-workflow-designer-ui/src/app/services/workflow.service.ts b/sdc-workflow-designer-ui/src/app/services/workflow.service.ts index 09e0e55e..3a6c5df1 100644 --- a/sdc-workflow-designer-ui/src/app/services/workflow.service.ts +++ b/sdc-workflow-designer-ui/src/app/services/workflow.service.ts @@ -19,6 +19,7 @@ import { Position } from "../model/workflow/position"; import { NodeType } from "../model/workflow/node-type.enum";
import { StartEvent } from "../model/workflow/start-event";
import { SequenceFlow } from "../model/workflow/sequence-flow";
+import { RestTask } from "../model/workflow/rest-task";
/**
* WorkflowService
@@ -44,6 +45,9 @@ export class WorkflowService { case NodeType[NodeType.startEvent]:
node = new StartEvent(this.createId(), name, type, new Position(top, left), []);
break;
+ case NodeType[NodeType.restTask]:
+ node = new RestTask(this.createId(), name, type, new Position(top, left), []);
+ break;
default:
node = new WorkflowNode(this.createId(), name, type, new Position(top, left), []);
break;
|