From da8c367fc069efd35d3e8e0aabeea8fc78c8036c Mon Sep 17 00:00:00 2001 From: YuanHu Date: Thu, 12 Apr 2018 11:29:50 +0800 Subject: Parse uuid & operationId from url Parse uuid & operationId from url Issue-ID: SDC-1209 Change-Id: I96cd05711f83cae3825a445c630f7b92b4c2a4e5 Signed-off-by: YuanHu --- sdc-workflow-designer-ui/src/app/model/plan-model.ts | 4 +++- sdc-workflow-designer-ui/src/app/services/interface.service.ts | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'sdc-workflow-designer-ui/src') diff --git a/sdc-workflow-designer-ui/src/app/model/plan-model.ts b/sdc-workflow-designer-ui/src/app/model/plan-model.ts index 7246e1c9..afe05f72 100644 --- a/sdc-workflow-designer-ui/src/app/model/plan-model.ts +++ b/sdc-workflow-designer-ui/src/app/model/plan-model.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017 ZTE Corporation. + * Copyright (c) 2017-2018 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, @@ -14,6 +14,8 @@ import { Model } from './model'; export class PlanModel { public id: string; + public uuid: string; + public operationId: string; public name: string; public version: string; public description: string; diff --git a/sdc-workflow-designer-ui/src/app/services/interface.service.ts b/sdc-workflow-designer-ui/src/app/services/interface.service.ts index c9ef87d8..9dcafe96 100644 --- a/sdc-workflow-designer-ui/src/app/services/interface.service.ts +++ b/sdc-workflow-designer-ui/src/app/services/interface.service.ts @@ -30,8 +30,14 @@ export class InterfaceService { public getModelData() { this.activatedRoute.queryParams.subscribe(queryParams => { - let modelId = queryParams.id; - this.http.get(InterfaceService.ModelUrl + modelId).subscribe(data => { + let modelId = queryParams.hasOwnProperty("id") ? queryParams.id : ""; + let name = queryParams.hasOwnProperty("name") ? queryParams.name : ""; + let uuid = queryParams.hasOwnProperty("uuid") ? queryParams.uuid :""; + let operationId = queryParams.hasOwnProperty("operationId") ? queryParams.operationId : ""; + + this.http.get(InterfaceService.ModelUrl + modelId + + "?name=" + name + "&uuid=" + uuid + + "&operationId=" + operationId).subscribe(data => { this.broadcast.broadcast(this.broadcast.initModel, data); }, error => { this.translate.get('WORKFLOW.MSG.LOAD_FAIL').subscribe((res: string) => { -- cgit 1.2.3-korg