summaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/app.component.ts
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2017-08-30 09:21:09 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2017-08-30 09:29:32 +0800
commita53dbd4f12ddd206c2ce9dc0a8ff14a08aadc1fe (patch)
treea5565b63067331dc9cde0a1285bcef640868abf6 /sdc-workflow-designer-ui/src/app/app.component.ts
parentce786628733cb20ff806fa5bb8e061400c7213ef (diff)
save and query workflow definition
add in memory web api to mock backend rest api to save and load workflow definition. Issue-ID: SDC-257 Change-Id: Ibedcbe5db5706773de9f6d1093babbcbd7b73297 Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/app.component.ts')
-rw-r--r--sdc-workflow-designer-ui/src/app/app.component.ts20
1 files changed, 15 insertions, 5 deletions
diff --git a/sdc-workflow-designer-ui/src/app/app.component.ts b/sdc-workflow-designer-ui/src/app/app.component.ts
index b02ce675..59b457f9 100644
--- a/sdc-workflow-designer-ui/src/app/app.component.ts
+++ b/sdc-workflow-designer-ui/src/app/app.component.ts
@@ -10,21 +10,31 @@
* ZTE - initial API and implementation and/or initial documentation
*/
-import { Component, AfterViewInit } from '@angular/core';
+import { Component, AfterViewInit, OnInit } from '@angular/core';
import { JsPlumbService } from "./services/jsplumb.service";
import { WorkflowService } from "./services/workflow.service";
import { WorkflowNode } from "./model/workflow-node";
+import { Workflow } from "./model/workflow";
+import { DataAccessService } from "./services/data-access/data-access.service";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
-export class AppComponent implements AfterViewInit {
- constructor(private jsplumbService: JsPlumbService, private workflowService: WorkflowService) {}
+export class AppComponent implements AfterViewInit, OnInit {
+ constructor(private jsplumbService: JsPlumbService,
+ private dataAccessService: DataAccessService,
+ private workflowService: WorkflowService) {}
- public getNodes(): WorkflowNode[] {
- return this.workflowService.getNodes();
+ ngOnInit(): void {
+ this.dataAccessService.catalogService.loadWorkflow('workflow1').subscribe(workflow => {
+ this.workflowService.workflow = workflow;
+ });
+ }
+
+ public getWorkflow(): Workflow {
+ return this.workflowService.workflow;
}
ngAfterViewInit(): void {