.setServiceInstanceId(activeRequests.getServiceInstanceId())
.setNetworkId(activeRequests.getNetworkId()).setEndTime(activeRequests.getEndTime())
.setRequestStatus(activeRequests.getRequestStatus())
- .setServiceIstanceName(activeRequests.getServiceInstanceName())
+ .setServiceInstanceName(activeRequests.getServiceInstanceName())
.setServiceType(activeRequests.getServiceType()).setStartTime(activeRequests.getStartTime())
.build();
result.add(soInfraRequest);
}
/**
- * @return the processInstancId
+ * @return the processInstanceId
*/
public String getProcessInstanceId() {
return processInstanceId;
private final String requestId;
private final String serviceInstanceId;
- private final String serviceIstanceName;
+ private final String serviceInstanceName;
private final String networkId;
private final String requestStatus;
private final String serviceType;
public SoInfraRequest(final SoInfraRequestBuilder requestBuilder) {
this.requestId = requestBuilder.getRequestId();
this.serviceInstanceId = requestBuilder.getServiceInstanceId();
- this.serviceIstanceName = requestBuilder.getServiceIstanceName();
+ this.serviceInstanceName = requestBuilder.getServiceInstanceName();
this.networkId = requestBuilder.getNetworkId();
this.requestStatus = requestBuilder.getRequestStatus();
this.serviceType = requestBuilder.getServiceType();
}
/**
- * @return the serviceIstanceName
+ * @return the serviceInstanceName
*/
- public String getServiceIstanceName() {
- return serviceIstanceName;
+ public String getServiceInstanceName() {
+ return serviceInstanceName;
}
/**
result = prime * result + ((requestId == null) ? 0 : requestId.hashCode());
result = prime * result + ((requestStatus == null) ? 0 : requestStatus.hashCode());
result = prime * result + ((serviceInstanceId == null) ? 0 : serviceInstanceId.hashCode());
- result = prime * result + ((serviceIstanceName == null) ? 0 : serviceIstanceName.hashCode());
+ result = prime * result + ((serviceInstanceName == null) ? 0 : serviceInstanceName.hashCode());
result = prime * result + ((serviceType == null) ? 0 : serviceType.hashCode());
result = prime * result + ((startTime == null) ? 0 : startTime.hashCode());
return result;
if (obj instanceof SoInfraRequest) {
final SoInfraRequest other = (SoInfraRequest) obj;
return isEqual(requestId, other.requestId) && isEqual(serviceInstanceId, other.serviceInstanceId)
- && isEqual(serviceIstanceName, other.serviceIstanceName) && isEqual(networkId, other.networkId)
+ && isEqual(serviceInstanceName, other.serviceInstanceName) && isEqual(networkId, other.networkId)
&& isEqual(requestStatus, other.requestStatus) && isEqual(serviceType, other.serviceType)
&& isEqual(startTime, other.startTime) && isEqual(endTime, other.endTime);
}
private String requestId;
private String serviceInstanceId;
- private String serviceIstanceName;
+ private String serviceInstanceName;
private String networkId;
private String requestStatus;
private String serviceType;
return this;
}
- public SoInfraRequestBuilder setServiceIstanceName(final String serviceIstanceName) {
- this.serviceIstanceName = serviceIstanceName;
+ public SoInfraRequestBuilder setServiceInstanceName(final String serviceInstanceName) {
+ this.serviceInstanceName = serviceInstanceName;
return this;
}
}
/**
- * @return the serviceIstanceName
+ * @return the serviceInstanceName
*/
- public String getServiceIstanceName() {
- return serviceIstanceName;
+ public String getServiceInstanceName() {
+ return serviceInstanceName;
}
/**
"balanced-match": {
"version": "1.0.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
"code-point-at": {
"version": "1.1.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"core-util-is": {
"version": "1.0.2",
"inherits": {
"version": "2.0.3",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"ini": {
"version": "1.3.5",
"version": "1.0.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
"version": "3.0.4",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
"minimist": {
"version": "0.0.8",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
"version": "0.5.1",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"minimist": "0.0.8"
}
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"object-assign": {
"version": "4.1.1",
"version": "1.4.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"wrappy": "1"
}
"version": "1.0.2",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
-/**\r
-============LICENSE_START=======================================================\r
- Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
-*/\r
-\r
-import { NgModule } from '@angular/core';\r
-import { Routes, RouterModule } from '@angular/router';\r
-import { HomeComponent } from './home/home.component';\r
-import { DetailsComponent } from './details/details.component';\r
-\r
-const routes: Routes = [\r
- {\r
- // Route to home page\r
- path: '',\r
- component: HomeComponent\r
- },\r
- {\r
- // Route to page to show individual process based on ID\r
- path: 'details/:id',\r
- component: DetailsComponent\r
- },\r
-];\r
-\r
-@NgModule({\r
- imports: [RouterModule.forRoot(routes, { onSameUrlNavigation: 'reload' })],\r
- exports: [RouterModule]\r
-})\r
-\r
-export class AppRoutingModule { }\r
+/**
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+ limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+*/
+
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { HomeComponent } from './home/home.component';
+import { DetailsComponent } from './details/details.component';
+
+const routes: Routes = [
+ {
+ // Route to home page
+ path: '',
+ component: HomeComponent
+ },
+ {
+ // Route to page to show individual process based on ID
+ path: 'details/:id',
+ component: DetailsComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forRoot(routes, { onSameUrlNavigation: 'reload' })],
+ exports: [RouterModule]
+})
+
+export class AppRoutingModule { }
expect(service).toBeTruthy();
})));
- // Test retrieveInstance function making POST call
- it('test retrieveInstance POST request', async(inject([HttpTestingController, DataService, ToastrNotificationService],
+ // Test getBpmnInfraRequest function making POST call
+ it('test getBpmnInfraRequest POST request', async(inject([HttpTestingController, DataService, ToastrNotificationService],
(httpClient: HttpTestingController, service: DataService, toastr: ToastrNotificationService) => {
- service.retrieveInstance({}, 1, 2).subscribe(data => { });
+ service.getBpmnInfraRequest({}, 1, 2).subscribe(data => { });
var url = environment.soMonitoringBackendURL + 'v1/search?from=1&to=2';
const mockReq = httpClient.expectOne(url);
expect(mockReq.request.method).toEqual('POST');
-/**\r
-============LICENSE_START=======================================================\r
- Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
-*/\r
-\r
-import { Injectable } from '@angular/core';\r
-import { HttpClient, HttpErrorResponse } from '@angular/common/http';\r
-import { Process } from './model/process.model';\r
-import { catchError } from 'rxjs/operators';\r
-import { Observable } from 'rxjs';\r
-import { ProcessInstanceId } from './model/processInstanceId.model';\r
-import { environment } from '../environments/environment';\r
-import { HttpResponse } from '@angular/common/http';\r
-import { PII } from './model/processInstance.model';\r
-import { HttpErrorHandlerService } from './http-error-handler.service';\r
-import { ACTINST } from './model/activityInstance.model';\r
-\r
-\r
-@Injectable({\r
- providedIn: 'root'\r
-})\r
-export class DataService {\r
-\r
- constructor(private http: HttpClient, private httpErrorHandlerService: HttpErrorHandlerService) { }\r
-\r
- // HTTP POST call to running Spring Boot application\r
- retrieveInstance(servInstId: {}, from: number, to: number) {\r
- var url = environment.soMonitoringBackendURL + 'v1/search?from=' + from + "&to=" + to;\r
- return this.http.post<Process[]>(url, servInstId)\r
- .pipe(\r
- catchError(this.httpErrorHandlerService.handleError("POST", url))\r
- );\r
- }\r
-\r
- // HTTP GET to return Process Instance using RequestID\r
- getProcessInstanceId(requestId): Observable<HttpResponse<ProcessInstanceId>> {\r
- var url = environment.soMonitoringBackendURL + 'process-instance-id/' + requestId;\r
- console.log(requestId);\r
- return this.http.get<ProcessInstanceId>(url, { observe: 'response' })\r
- .pipe(\r
- catchError(this.httpErrorHandlerService.handleError("GET", url))\r
- );\r
- }\r
-\r
- // HTTP GET to return Activity instancs using ProcessInstanceID\r
- getActivityInstance(processInstanceId): Promise<ACTINST[]> {\r
- var url = environment.soMonitoringBackendURL + 'activity-instance/' + processInstanceId;\r
- return this.http.get<ACTINST[]>(url)\r
- .pipe(\r
- catchError(this.httpErrorHandlerService.handleError("GET", url))\r
- ).toPromise();\r
- }\r
-\r
- // HTTP GET to return Activity Instance using ProcessInstanceID\r
- async getProcessInstance(processInstanceId): Promise<PII> {\r
- var url = environment.soMonitoringBackendURL + 'process-instance/' + processInstanceId;\r
- return await (this.http.get<PII>(url)\r
- .pipe(\r
- catchError(this.httpErrorHandlerService.handleError("GET", url))))\r
- .toPromise();\r
- }\r
-\r
- // HTTP GET to return Process Definition using processDefinitionId\r
- getProcessDefinition(processDefinitionId) {\r
- var url = environment.soMonitoringBackendURL + 'process-definition/' + processDefinitionId;\r
- return this.http.get(url).pipe(\r
- catchError(this.httpErrorHandlerService.handleError("GET", url))\r
- );\r
- }\r
-\r
- // HTTP GET to return Variable Instance using ProcessInstanceID\r
- getVariableInstance(processDefinitionId) {\r
- var url = environment.soMonitoringBackendURL + 'variable-instance/' + processDefinitionId;\r
- return this.http.get(url).pipe(\r
- catchError(this.httpErrorHandlerService.handleError("GET", url))\r
- );\r
- }\r
-}\r
+/**
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+ limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+*/
+
+import { Injectable } from '@angular/core';
+import { HttpClient, HttpErrorResponse } from '@angular/common/http';
+import { BpmnInfraRequest } from './model/bpmnInfraRequest.model';
+import { catchError } from 'rxjs/operators';
+import { Observable } from 'rxjs';
+import { ProcessInstanceId } from './model/processInstanceId.model';
+import { environment } from '../environments/environment';
+import { HttpResponse } from '@angular/common/http';
+import { ProcessInstanceDetail } from './model/processInstance.model';
+import { HttpErrorHandlerService } from './http-error-handler.service';
+import { ActivityInstance } from './model/activityInstance.model';
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class DataService {
+
+ constructor(private http: HttpClient, private httpErrorHandlerService: HttpErrorHandlerService) { }
+
+ // HTTP POST call to running Spring Boot application
+ getBpmnInfraRequest(servInstId: {}, from: number, to: number): Observable<BpmnInfraRequest[]> {
+ var url = environment.soMonitoringBackendURL + 'v1/search?from=' + from + "&to=" + to;
+ return this.http.post<BpmnInfraRequest[]>(url, servInstId)
+ .pipe(
+ catchError(this.httpErrorHandlerService.handleError("POST", url))
+ );
+ }
+
+ // HTTP GET to return Process Instance using RequestID
+ getProcessInstanceId(requestId: string): Observable<HttpResponse<ProcessInstanceId>> {
+ var url = environment.soMonitoringBackendURL + 'process-instance-id/' + requestId;
+ console.log(requestId);
+ return this.http.get<ProcessInstanceId>(url, { observe: 'response' })
+ .pipe(
+ catchError(this.httpErrorHandlerService.handleError("GET", url))
+ );
+ }
+
+ // HTTP GET to return Activity instancs using ProcessInstanceID
+ getActivityInstance(processInstanceId: string): Promise<ActivityInstance[]> {
+ var url = environment.soMonitoringBackendURL + 'activity-instance/' + processInstanceId;
+ return this.http.get<ActivityInstance[]>(url)
+ .pipe(
+ catchError(this.httpErrorHandlerService.handleError("GET", url))
+ ).toPromise();
+ }
+
+ // HTTP GET to return Activity Instance using ProcessInstanceID
+ async getProcessInstance(processInstanceId: string): Promise<ProcessInstanceDetail> {
+ var url = environment.soMonitoringBackendURL + 'process-instance/' + processInstanceId;
+ return await (this.http.get<ProcessInstanceDetail>(url)
+ .pipe(
+ catchError(this.httpErrorHandlerService.handleError("GET", url))))
+ .toPromise();
+ }
+
+ // HTTP GET to return Process Definition using processDefinitionId
+ getProcessDefinition(processDefinitionId: string): Observable<Object> {
+ var url = environment.soMonitoringBackendURL + 'process-definition/' + processDefinitionId;
+ return this.http.get(url).pipe(
+ catchError(this.httpErrorHandlerService.handleError("GET", url))
+ );
+ }
+
+ // HTTP GET to return Variable Instance using ProcessInstanceID
+ getVariableInstance(processDefinitionId: string): Observable<Object> {
+ var url = environment.soMonitoringBackendURL + 'variable-instance/' + processDefinitionId;
+ return this.http.get(url).pipe(
+ catchError(this.httpErrorHandlerService.handleError("GET", url))
+ );
+ }
+}
import { ToastrNotificationService } from '../toastr-notification-service.service';
import { DataService } from '../data.service';
import { Observable, of, throwError } from 'rxjs';
-import { ACTINST } from '../model/activityInstance.model';
-import { PDI } from '../model/processDefinition.model';
-import { PII } from '../model/processInstance.model';
-import { VarInstance } from '../model/variableInstance.model';
+import { ActivityInstance } from '../model/activityInstance.model';
+import { ProcessDefinitionDetail } from '../model/processDefinition.model';
+import { ProcessInstanceDetail } from '../model/processInstance.model';
+import { VariableInstance } from '../model/variableInstance.model';
import { ActivatedRoute } from '@angular/router';
import { Params } from '@angular/router';
error() {}
}
-const startActivity: ACTINST = {
+const startActivity: ActivityInstance = {
activityId: "StartEvent_1",
processInstanceId: "processInstanceId-val-1234",
calledProcessInstanceId: "",
startTime: ""
};
-const subProcessActivity: ACTINST = {
+const subProcessActivity: ActivityInstance = {
activityId: "CallActivity_14h26ae",
processInstanceId: "processInstanceId-val-1234",
calledProcessInstanceId: "1234",
startTime: ""
};
-const processDefinition: PDI = {
+const processDefinition: ProcessDefinitionDetail = {
processDefinitionId: "processDefinitionId-val-1234",
processDefinitionXml: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<bpmn:definitions xmlns:bpmn=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:di=\"http://www.omg.org/spec/DD/20100524/DI\" xmlns:dc=\"http://www.omg.org/spec/DD/20100524/DC\" xmlns:camunda=\"http://camunda.org/schema/1.0/bpmn\" id=\"Definitions_01lwydo\" targetNamespace=\"http://bpmn.io/schema/bpmn\" exporter=\"Camunda Modeler\" exporterVersion=\"2.2.4\">" +
"</bpmn:definitions>"
};
-const emptyProcessDefinition: PDI = {
+const emptyProcessDefinition: ProcessDefinitionDetail = {
processDefinitionId: "processDefinitionId-val",
processDefinitionXml: ""
};
-const processInstance: PII = {
- processInstancId: "processInstanceId-val-1234",
+const processInstance: ProcessInstanceDetail = {
+ processInstanceId: "processInstanceId-val-1234",
processDefinitionId: "1",
processDefinitionName: "test",
superProcessInstanceId: "1"
};
-const varInstanceObj: VarInstance = {
+const varInstanceObj: VariableInstance = {
name: 'ABC',
type: 'Object',
value: '{value: 1234}'
};
-const varInstanceStr: VarInstance = {
+const varInstanceStr: VariableInstance = {
name: 'NameStr',
type: 'String',
value: 'valOfStr'
-/**\r
-============LICENSE_START=======================================================\r
- Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
-*/\r
-\r
-import { Component, OnInit } from '@angular/core';\r
-import { DataService } from '../data.service';\r
-import { ActivatedRoute, Router } from "@angular/router";\r
-import { Process } from '../model/process.model';\r
-import { ACTINST } from '../model/activityInstance.model';\r
-import { PII } from '../model/processInstance.model';\r
-import { PDI } from '../model/processDefinition.model';\r
-import { CommonModule } from '@angular/common';\r
-import Viewer from 'bpmn-js/lib/NavigatedViewer';\r
-import { ViewEncapsulation } from '@angular/core';\r
-import { MatTabsModule } from '@angular/material/tabs';\r
-import { VarInstance } from '../model/variableInstance.model';\r
-import { ToastrNotificationService } from '../toastr-notification-service.service';\r
-import { NgxSpinnerService } from 'ngx-spinner';\r
-\r
-@Component({\r
- selector: 'app-details',\r
- templateUrl: './details.component.html',\r
- styleUrls: ['./details.component.scss'],\r
- encapsulation: ViewEncapsulation.None\r
-})\r
-\r
-export class DetailsComponent implements OnInit {\r
- bpmnViewer: any;\r
-\r
- processInstanceID: string;\r
-\r
- processDefinitionID: string;\r
-\r
- processDefinitionName: string;\r
-\r
- activityInstance: ACTINST[];\r
-\r
- processInstance: PII;\r
-\r
- processDefinition: PDI;\r
-\r
- variableInstance: VarInstance[];\r
-\r
- displayedColumns = ['activityId', 'activityName', 'activityType', 'startTime', 'endTime', 'durationInMillis'];\r
-\r
- displayedColumnsVariable = ['name', 'type', 'value'];\r
-\r
- constructor(private route: ActivatedRoute, private data: DataService, private popup: ToastrNotificationService,\r
- private router: Router, private spinner: NgxSpinnerService) { }\r
-\r
- async getActInst(procInstId: string) {\r
- await this.data.getActivityInstance(procInstId).then(\r
- (data: ACTINST[]) => {\r
- this.activityInstance = data;\r
- console.log(data);\r
- }, error => {\r
- console.log(error);\r
- this.popup.error("Unable to get activity instance details for id: " + procInstId + " Error code:" + error.status);\r
- });\r
- }\r
-\r
- async getProcessDefinition(procDefId) {\r
- await this.data.getProcessDefinition(procDefId).subscribe(\r
- async (data: PDI) => {\r
- this.processDefinition = data;\r
- console.log(data);\r
- await this.displayCamundaflow(this.processDefinition.processDefinitionXml, this.activityInstance, this.router);\r
- }, error => {\r
- console.log(error);\r
- this.popup.error("Unable to get process definition for id: " + procDefId + " Error code:" + error.status);\r
- });\r
- }\r
-\r
- async getProcInstance(procInstId) {\r
- await this.data.getProcessInstance(procInstId).then(\r
- async (data: PII) => {\r
- this.processInstance = data;\r
- this.processDefinitionID = this.processInstance.processDefinitionId;\r
- this.processDefinitionName = this.processInstance.processDefinitionName;\r
- console.log("Process definition id: " + this.processDefinitionID);\r
- await this.getActInst(this.processInstanceID);\r
- await this.getProcessDefinition(this.processDefinitionID);\r
- }, error => {\r
- console.log(error);\r
- this.popup.error("Unable to get process instance for id: " + procInstId + " Error code:" + error.status);\r
- });\r
- }\r
-\r
- displayCamundaflow(bpmnXml, activities: ACTINST[], r: Router) {\r
- this.spinner.show();\r
-\r
- this.bpmnViewer.importXML(bpmnXml, (error) => {\r
- if (error) {\r
- console.error('Unable to load BPMN flow ', error);\r
- this.popup.error('Unable to load BPMN flow ');\r
- this.spinner.hide();\r
- } else {\r
- this.spinner.hide();\r
- let canvas = this.bpmnViewer.get('canvas');\r
- var eventBus = this.bpmnViewer.get('eventBus');\r
- eventBus.on('element.click', function(e) {\r
-\r
- activities.forEach(a => {\r
- if (a.activityId == e.element.id && a.calledProcessInstanceId !== null) {\r
- console.log("will drill down to : " + a.calledProcessInstanceId);\r
- r.navigate(['/details/' + a.calledProcessInstanceId]);\r
- this.spinner.show();\r
- }\r
- });\r
- });\r
- // zoom to fit full viewport\r
- canvas.zoom('fit-viewport');\r
- activities.forEach(a => {\r
- canvas.addMarker(a.activityId, 'highlight');\r
- });\r
- }\r
- });\r
- }\r
-\r
- getVarInst(procInstId) {\r
- this.data.getVariableInstance(procInstId).subscribe(\r
- (data: VarInstance[]) => {\r
- this.variableInstance = [];\r
- for (let i = 0; i < data.length; i++) {\r
- var value = data[i]['value'];\r
- var type = data[i]['type'];\r
- if ((type == 'Object') && !(value == null)) {\r
- try {\r
- data[i]['value'] = JSON.stringify(value, null, 2);\r
- }\r
- catch (error) {\r
- console.log("Unable to \nError Code: " + error);\r
- }\r
- }\r
- this.variableInstance[i] = data[i];\r
- }\r
- console.log(data);\r
- }, error => {\r
- console.log(error);\r
- this.popup.error("Unable to get Variable instances for id: " + procInstId + " Error code:" + error.status);\r
- });\r
- }\r
-\r
- async ngOnInit() {\r
- this.bpmnViewer = new Viewer({\r
- container: '.canvas'\r
- });\r
- this.route.params.subscribe(\r
- async params => {\r
- this.processInstanceID = params.id as string;\r
- console.log("Will GET Process instanc using id: " + this.processInstanceID);\r
- await this.getProcInstance(this.processInstanceID);\r
-\r
- this.getVarInst(this.processInstanceID);\r
- });\r
- }\r
-\r
-}\r
+/**
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+ limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+*/
+
+import { Component, OnInit } from '@angular/core';
+import { DataService } from '../data.service';
+import { ActivatedRoute, Router } from "@angular/router";
+import { BpmnInfraRequest } from '../model/bpmnInfraRequest.model';
+import { ActivityInstance } from '../model/activityInstance.model';
+import { ProcessInstanceDetail } from '../model/processInstance.model';
+import { ProcessDefinitionDetail } from '../model/processDefinition.model';
+import { CommonModule } from '@angular/common';
+import Viewer from 'bpmn-js/lib/NavigatedViewer';
+import { ViewEncapsulation } from '@angular/core';
+import { MatTabsModule } from '@angular/material/tabs';
+import { VariableInstance } from '../model/variableInstance.model';
+import { ToastrNotificationService } from '../toastr-notification-service.service';
+import { NgxSpinnerService } from 'ngx-spinner';
+
+@Component({
+ selector: 'app-details',
+ templateUrl: './details.component.html',
+ styleUrls: ['./details.component.scss'],
+ encapsulation: ViewEncapsulation.None
+})
+
+export class DetailsComponent implements OnInit {
+ bpmnViewer: any;
+
+ processInstanceID: string;
+
+ processDefinitionID: string;
+
+ processDefinitionName: string;
+
+ activityInstance: ActivityInstance[];
+
+ processInstance: ProcessInstanceDetail;
+
+ processDefinition: ProcessDefinitionDetail;
+
+ variableInstance: VariableInstance[];
+
+ displayedColumns = ['activityId', 'activityName', 'activityType', 'startTime', 'endTime', 'durationInMillis'];
+
+ displayedColumnsVariable = ['name', 'type', 'value'];
+
+ constructor(private route: ActivatedRoute, private data: DataService, private popup: ToastrNotificationService,
+ private router: Router, private spinner: NgxSpinnerService) { }
+
+ async getActivityInstance(procInstId: string) {
+ await this.data.getActivityInstance(procInstId).then(
+ (data: ActivityInstance[]) => {
+ this.activityInstance = data;
+ console.log(data);
+ }, error => {
+ console.log(error);
+ this.popup.error("Unable to get activity instance details for id: " + procInstId + " Error code:" + error.status);
+ });
+ }
+
+ async getProcessDefinition(procDefId: string) {
+ await this.data.getProcessDefinition(procDefId).subscribe(
+ async (data: ProcessDefinitionDetail) => {
+ this.processDefinition = data;
+ console.log(data);
+ await this.displayCamundaflow(this.processDefinition.processDefinitionXml, this.activityInstance, this.router);
+ }, error => {
+ console.log(error);
+ this.popup.error("Unable to get process definition for id: " + procDefId + " Error code:" + error.status);
+ });
+ }
+
+ async getProcInstance(procInstId: string) {
+ await this.data.getProcessInstance(procInstId).then(
+ async (data: ProcessInstanceDetail) => {
+ this.processInstance = data;
+ this.processDefinitionID = this.processInstance.processDefinitionId;
+ this.processDefinitionName = this.processInstance.processDefinitionName;
+ console.log("Process definition id: " + this.processDefinitionID);
+ await this.getActivityInstance(this.processInstanceID);
+ await this.getProcessDefinition(this.processDefinitionID);
+ }, error => {
+ console.log(error);
+ this.popup.error("Unable to get process instance for id: " + procInstId + " Error code:" + error.status);
+ });
+ }
+
+ displayCamundaflow(bpmnXml, activities: ActivityInstance[], r: Router) {
+ this.spinner.show();
+
+ this.bpmnViewer.importXML(bpmnXml, (error) => {
+ if (error) {
+ console.error('Unable to load BPMN flow ', error);
+ this.popup.error('Unable to load BPMN flow ');
+ this.spinner.hide();
+ } else {
+ this.spinner.hide();
+ var canvas = this.bpmnViewer.get('canvas');
+ var eventBus = this.bpmnViewer.get('eventBus');
+ eventBus.on('element.click', function(e) {
+
+ activities.forEach(a => {
+ if (a.activityId == e.element.id && a.calledProcessInstanceId !== null) {
+ console.log("will drill down to : " + a.calledProcessInstanceId);
+ r.navigate(['/details/' + a.calledProcessInstanceId]);
+ this.spinner.show();
+ }
+ });
+ });
+ // zoom to fit full viewport
+ canvas.zoom('fit-viewport');
+ activities.forEach(a => {
+ canvas.addMarker(a.activityId, 'highlight');
+ });
+ }
+ });
+ }
+
+ getVarInst(procInstId: string) {
+ this.data.getVariableInstance(procInstId).subscribe(
+ (data: VariableInstance[]) => {
+ this.variableInstance = [];
+ for (let i = 0; i < data.length; i++) {
+ var value = data[i]['value'];
+ var type = data[i]['type'];
+ if ((type == 'Object') && !(value == null)) {
+ try {
+ data[i]['value'] = JSON.stringify(value, null, 2);
+ }
+ catch (error) {
+ console.log("Unable to \nError Code: " + error);
+ }
+ }
+ this.variableInstance[i] = data[i];
+ }
+ console.log(data);
+ }, error => {
+ console.log(error);
+ this.popup.error("Unable to get Variable instances for id: " + procInstId + " Error code:" + error.status);
+ });
+ }
+
+ async ngOnInit() {
+ this.bpmnViewer = new Viewer({
+ container: '.canvas'
+ });
+ this.route.params.subscribe(
+ async params => {
+ this.processInstanceID = params.id as string;
+ console.log("Will GET BpmnInfraRequest instance using id: " + this.processInstanceID);
+ await this.getProcInstance(this.processInstanceID);
+
+ this.getVarInst(this.processInstanceID);
+ });
+ }
+
+}
<mat-table [dataSource]="processData" matSort>
<ng-container matColumnDef="requestId">
<mat-header-cell *matHeaderCellDef mat-sort-header> Request Id </mat-header-cell>
- <mat-cell *matCellDef="let process"><a routerLink="" (click)="getProcessIsntanceId(process.requestId)">{{ process.requestId }}</a></mat-cell>
+ <mat-cell *matCellDef="let process"><a routerLink="" (click)="getProcessInstanceId(process.requestId)">{{ process.requestId }}</a></mat-cell>
</ng-container>
<ng-container matColumnDef="serviceInstanceId">
<mat-header-cell *matHeaderCellDef mat-sort-header> Instance Id </mat-header-cell>
<mat-cell *matCellDef="let process"> {{ process.serviceInstanceId }} </mat-cell>
</ng-container>
- <ng-container matColumnDef="serviceIstanceName">
+ <ng-container matColumnDef="serviceInstanceName">
<mat-header-cell *matHeaderCellDef mat-sort-header> Instance Name </mat-header-cell>
- <mat-cell *matCellDef="let process"> {{ process.serviceIstanceName }} </mat-cell>
+ <mat-cell *matCellDef="let process"> {{ process.serviceInstanceName }} </mat-cell>
</ng-container>
<ng-container matColumnDef="networkId">
<mat-header-cell *matHeaderCellDef mat-sort-header> Network Id </mat-header-cell>
import { Observable, of, throwError } from 'rxjs';
import { SearchRequest } from '../model/SearchRequest.model';
import { DataService } from '../data.service'; // may be able to remove
-import { Process } from '../model/process.model';
+import { BpmnInfraRequest } from '../model/bpmnInfraRequest.model';
import { By } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ProcessInstanceId } from '../model/processInstanceId.model';
let fixture: ComponentFixture<HomeComponent>;
beforeEach(() => {
- spyDataService = jasmine.createSpyObj('DataService', ['retrieveInstance', 'getProcessInstanceId']);
+ spyDataService = jasmine.createSpyObj('DataService', ['getBpmnInfraRequest', 'getProcessInstanceId']);
TestBed.configureTestingModule({
providers: [
it('should should navigate to a process if response status is OK', async(() => {
spyDataService.getProcessInstanceId.and.returnValue(of(<HttpResponse<ProcessInstanceId>>{body: {processInstanceId: '114e9ae4-4a32-11e9-8646-d663bd873d93'}, status: 200}));
spyOn(router, 'navigate');
- component.getProcessIsntanceId('e8a75940-4a32-11e9-8646-d663bd873d93');
+ component.getProcessInstanceId('e8a75940-4a32-11e9-8646-d663bd873d93');
fixture.whenStable().then(() => {
expect(router.navigate).toHaveBeenCalledWith(['/details/114e9ae4-4a32-11e9-8646-d663bd873d93']);
it('should handle error if no process instance id found', () => {
spyDataService.getProcessInstanceId.and.returnValue(of(<HttpResponse<ProcessInstanceId>>{body: {processInstanceId: 'getProcessInstanceId error not found'}, status: 404}));
- component.getProcessIsntanceId('e8a75940-4a32-11e9-8646-d663bd873d93');
+ component.getProcessInstanceId('e8a75940-4a32-11e9-8646-d663bd873d93');
});
it('should handle error when searchData.getSearchRequest returns an error', () => {
component.makeCall();
});
- it('should handle error when dataService.retrieveInstance returns an error', () => {
+ it('should handle error when dataService.getBpmnInfraRequest returns an error', () => {
spyOn(component.searchData, 'getSearchRequest').and.returnValue(of(getSearchRequest("965d3c92-44e0-11e9-b210-d663bd873d93", "85a7c354-44e0-11e9-b210-d663bd873d93", undefined, undefined, undefined, undefined, undefined, undefined, "ALL")));
- spyDataService.retrieveInstance.and.callFake(() => {
- return throwError(new Error('retrieveInstance error'));
+ spyDataService.getBpmnInfraRequest.and.callFake(() => {
+ return throwError(new Error('getBpmnInfraRequest error'));
});
component.makeCall();
});
it('should calculate statistics correctly', async(() => {
let requestStatusTypes: string[] = ["COMPLETE", "IN_PROGRESS", "FAILED", "PENDING", "UNLOCKED"];
- let processArr: Process[] = [];
+ let processArr: BpmnInfraRequest[] = [];
// create 5 processes, one of each requestStatusType, with default time.
requestStatusTypes.forEach((status) => {
// search request has default filter.
spyOn(component.searchData, 'getSearchRequest').and.returnValue(of(getSearchRequest(undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, "ALL")));
- spyDataService.retrieveInstance.and.returnValue(of(processArr));
+ spyDataService.getBpmnInfraRequest.and.returnValue(of(processArr));
component.makeCall();
fixture.whenStable().then(() => {
return new SearchRequest({ serviceInstanceId: [selectedValueSII, serviceInstanceIdVal], requestId: [selectedValueRI, requestIdVal], serviceInstanceName: [selectedValueSN, serviceInstanceNameVal] }, startTimeInMilliseconds, endTimeInMilliseconds);
}
- function getProcess(requestIdVal: string, serviceInstanceIdVal: string, serviceIstanceNameVal: string, networkIdVal: string, requestStatusVal: string, serviceTypeVal: string, startTimeVal = "1", endTimeVal = "2"): Process {
- return <Process>{ requestId: requestIdVal, serviceInstanceId: serviceInstanceIdVal, serviceIstanceName: serviceIstanceNameVal, networkId: networkIdVal, requestStatus: requestStatusVal, serviceType: serviceTypeVal, startTime: startTimeVal, endTime: endTimeVal };
+ function getProcess(requestIdVal: string, serviceInstanceIdVal: string, serviceInstanceNameVal: string, networkIdVal: string, requestStatusVal: string, serviceTypeVal: string, startTimeVal = "1", endTimeVal = "2"): BpmnInfraRequest {
+ return <BpmnInfraRequest>{ requestId: requestIdVal, serviceInstanceId: serviceInstanceIdVal, serviceInstanceName: serviceInstanceNameVal, networkId: networkIdVal, requestStatus: requestStatusVal, serviceType: serviceTypeVal, startTime: startTimeVal, endTime: endTimeVal };
}
});
import { Component, OnInit, ViewChild, ElementRef, Input, ViewEncapsulation } from '@angular/core';
import { DataService } from '../data.service';
import { ActivatedRoute, Router } from "@angular/router";
-import { Process } from '../model/process.model';
+import { BpmnInfraRequest } from '../model/bpmnInfraRequest.model';
import { ProcessInstanceId } from '../model/processInstanceId.model';
import { ToastrNotificationService } from '../toastr-notification-service.service';
import { MatSelectModule } from '@angular/material/select';
encapsulation: ViewEncapsulation.None
})
-export class HomeComponent implements OnInit {
+export class HomeComponent {
totalVal = 0;
completeVal = 0;
searchData: SearchData;
startingDate: Date;
- processData: MatTableDataSource<Process>;
+ processData: MatTableDataSource<BpmnInfraRequest>;
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
var search = this.searchData.getSearchRequest().subscribe((result: SearchRequest) => {
- this.data.retrieveInstance(result.getFilters(), result.getStartTimeInMilliseconds(), result.getEndTimeInMilliseconds())
- .subscribe((data: Process[]) => {
+ this.data.getBpmnInfraRequest(result.getFilters(), result.getStartTimeInMilliseconds(), result.getEndTimeInMilliseconds())
+ .subscribe((data: BpmnInfraRequest[]) => {
this.spinner.hide();
- var processData: Process[] = data;
- this.processData = new MatTableDataSource<Process>(processData);
+ var processData: BpmnInfraRequest[] = data;
+ this.processData = new MatTableDataSource<BpmnInfraRequest>(processData);
this.processData.sort = this.sort;
this.processData.paginator = this.paginator;
this.processData.paginator.firstPage();
});
}
- getProcessIsntanceId(requestId: string) {
+ getProcessInstanceId(requestId: string) {
this.spinner.show();
var response = this.data.getProcessInstanceId(requestId).subscribe((data) => {
}
});
}
-
- ngOnInit() { }
}
"36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55",
"56", "57", "58", "59"];
- public static DISPLAYED_COLUMNS = ['requestId', 'serviceInstanceId', 'serviceIstanceName', 'networkId', 'requestStatus', 'serviceType', 'startTime', 'endTime'];
+ public static DISPLAYED_COLUMNS = ['requestId', 'serviceInstanceId', 'serviceInstanceName', 'networkId', 'requestStatus', 'serviceType', 'startTime', 'endTime'];
public static DEFAULT_PAGE_SIZE_OPTIONS = [10, 25, 50, 100];
}
-/**\r
-============LICENSE_START=======================================================\r
- Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
-*/\r
-\r
-export interface ACTINST {\r
- activityId: string;\r
- activityName: string;\r
- activityType: string;\r
- processInstanceId: string;\r
- calledProcessInstanceId: string;\r
- startTime: string;\r
- endTime: string;\r
- durationInMillis: string;\r
-}\r
+/**
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+ limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+*/
+
+export interface ActivityInstance {
+ activityId: string;
+ activityName: string;
+ activityType: string;
+ processInstanceId: string;
+ calledProcessInstanceId: string;
+ startTime: string;
+ endTime: string;
+ durationInMillis: string;
+}
-/**\r
-============LICENSE_START=======================================================\r
- Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
-*/\r
-\r
-export interface Process {\r
- requestId: string;\r
- serviceInstanceId: string;\r
- serviceIstanceName: string;\r
- networkId: string;\r
- requestStatus: string;\r
- serviceType: string;\r
- startTime: string;\r
- endTime: string;\r
-}\r
+/**
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+ limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+*/
+
+export interface BpmnInfraRequest {
+ requestId: string;
+ serviceInstanceId: string;
+ serviceInstanceName: string;
+ networkId: string;
+ requestStatus: string;
+ serviceType: string;
+ startTime: string;
+ endTime: string;
+}
-/**\r
-============LICENSE_START=======================================================\r
- Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
-*/\r
-\r
-export interface PDI {\r
- processDefinitionId: string;\r
- processDefinitionXml: string;\r
-}\r
+/**
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+ limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+*/
+
+export interface ProcessDefinitionDetail {
+ processDefinitionId: string;
+ processDefinitionXml: string;
+}
-/**\r
-============LICENSE_START=======================================================\r
- Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
-*/\r
-\r
-export interface PII {\r
- processInstancId: string;\r
- processDefinitionId: string;\r
- processDefinitionName: string;\r
- superProcessInstanceId: string;\r
-}\r
+/**
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+ limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+*/
+
+export interface ProcessInstanceDetail {
+ processInstanceId: string;
+ processDefinitionId: string;
+ processDefinitionName: string;
+ superProcessInstanceId: string;
+}
-import { ToastrNotificationService } from "../toastr-notification-service.service";\r
-\r
-/**\r
-============LICENSE_START=======================================================\r
- Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
-*/\r
-\r
-import { Observable, throwError, of } from 'rxjs';\r
-import { SearchRequest } from "./SearchRequest.model";\r
-export class SearchData {\r
-\r
- public selectedValueSII = "EQ";\r
- public selectedValueRI = "EQ";\r
- public selectedValueSN = "EQ";\r
- public selectedValueSTATUS = "ALL";\r
-\r
- private now = Date.now();\r
- // Minus 1 hour from current time for start date\r
- public startDate = new Date(this.now - (1 * 60 * 60 * 1000));\r
- public selectedStartHour = this.getNumberAsString(this.startDate.getHours());\r
- public selectedStartMinute = this.getNumberAsString(this.startDate.getMinutes());\r
-\r
- public endDate = new Date(this.now);\r
- public selectedEndHour = this.getNumberAsString(this.endDate.getHours());\r
- public selectedEndMinute = this.getNumberAsString(this.endDate.getMinutes());\r
-\r
-\r
- public serviceInstanceId: string;\r
- public requestId: string;\r
- public serviceInstanceName: string;\r
-\r
- private startTimeInMilliseconds: number;\r
- private endTimeInMilliseconds: number;\r
-\r
- constructor() {\r
- }\r
-\r
- public getSearchRequest(): Observable<SearchRequest> {\r
- var searchFields = {};\r
- if ((!this.startDate || this.startDate === null) || (!this.endDate || this.endDate === null)) {\r
- console.error("Found either start time or end time null or undefined");\r
- return throwError("Found end or start date empty, Please enter start and end date");\r
- }\r
-\r
- this.startDate.setHours(parseInt(this.selectedStartHour));\r
- this.startDate.setMinutes(parseInt(this.selectedStartMinute));\r
-\r
- this.endDate.setHours(parseInt(this.selectedEndHour));\r
- this.endDate.setMinutes(parseInt(this.selectedEndMinute));\r
-\r
- this.startTimeInMilliseconds = this.startDate.getTime();\r
- this.endTimeInMilliseconds = this.endDate.getTime();\r
-\r
- if (this.startTimeInMilliseconds > this.endTimeInMilliseconds) {\r
- console.error("End time: " + this.endDate + " can not be greater then start time: " + this.startDate);\r
- return throwError("End time: " + this.endDate + " can not be greater then start time: " + this.startDate);\r
- }\r
-\r
-\r
- if (!this.isEmpty(this.selectedValueSII) && !this.isEmpty(this.serviceInstanceId)) {\r
- searchFields["serviceInstanceId"] = [this.selectedValueSII, this.serviceInstanceId]\r
- }\r
- if (!this.isEmpty(this.selectedValueRI) && !this.isEmpty(this.requestId)) {\r
- searchFields["requestId"] = [this.selectedValueRI, this.requestId]\r
- }\r
- if (!this.isEmpty(this.selectedValueSN) && !this.isEmpty(this.serviceInstanceName)) {\r
- searchFields["serviceInstanceName"] = [this.selectedValueSN, this.serviceInstanceName]\r
- }\r
-\r
- if (!this.isEmpty(this.selectedValueSTATUS) && this.selectedValueSTATUS !== "ALL") {\r
- searchFields["requestStatus"] = ["EQ", this.selectedValueSTATUS]\r
- }\r
-\r
- return of(new SearchRequest(searchFields, this.startTimeInMilliseconds, this.endTimeInMilliseconds));\r
- }\r
-\r
- private isEmpty(str) {\r
- return (!str || 0 === str.length);\r
- }\r
-\r
- private getNumberAsString(num: number) {\r
- if (num <= 9) {\r
- return "0" + num;\r
- }\r
- return "" + num;\r
- }\r
-\r
-}\r
+import { ToastrNotificationService } from "../toastr-notification-service.service";
+
+/**
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+ limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+*/
+
+import { Observable, throwError, of } from 'rxjs';
+import { SearchRequest } from "./SearchRequest.model";
+import { Input } from "@angular/core";
+
+export class SearchData {
+
+ @Input() selectedValueSII = "EQ";
+ @Input() selectedValueRI = "EQ";
+ @Input() selectedValueSN = "EQ";
+ @Input() selectedValueSTATUS = "ALL";
+
+ private now = Date.now();
+ // Minus 1 hour from current time for start date
+ @Input() startDate = new Date(this.now - (1 * 60 * 60 * 1000));
+ @Input() selectedStartHour = this.getNumberAsString(this.startDate.getHours());
+ @Input() selectedStartMinute = this.getNumberAsString(this.startDate.getMinutes());
+
+ @Input() endDate = new Date(this.now);
+ @Input() selectedEndHour = this.getNumberAsString(this.endDate.getHours());
+ @Input() selectedEndMinute = this.getNumberAsString(this.endDate.getMinutes());
+
+
+ @Input() serviceInstanceId: string;
+ @Input() requestId: string;
+ @Input() serviceInstanceName: string;
+
+ private startTimeInMilliseconds: number;
+ private endTimeInMilliseconds: number;
+
+ constructor() {
+ }
+
+ public getSearchRequest(): Observable<SearchRequest> {
+ var searchFields = {};
+ if ((!this.startDate || this.startDate === null) || (!this.endDate || this.endDate === null)) {
+ console.error("Found either start time or end time null or undefined");
+ return throwError("Found end or start date empty, Please enter start and end date");
+ }
+
+ this.startDate.setHours(parseInt(this.selectedStartHour));
+ this.startDate.setMinutes(parseInt(this.selectedStartMinute));
+
+ this.endDate.setHours(parseInt(this.selectedEndHour));
+ this.endDate.setMinutes(parseInt(this.selectedEndMinute));
+
+ this.startTimeInMilliseconds = this.startDate.getTime();
+ this.endTimeInMilliseconds = this.endDate.getTime();
+
+ if (this.startTimeInMilliseconds > this.endTimeInMilliseconds) {
+ console.error("End time: " + this.endDate + " can not be greater then start time: " + this.startDate);
+ return throwError("End time: " + this.endDate + " can not be greater then start time: " + this.startDate);
+ }
+
+
+ if (!this.isEmpty(this.selectedValueSII) && !this.isEmpty(this.serviceInstanceId)) {
+ searchFields["serviceInstanceId"] = [this.selectedValueSII, this.serviceInstanceId]
+ }
+ if (!this.isEmpty(this.selectedValueRI) && !this.isEmpty(this.requestId)) {
+ searchFields["requestId"] = [this.selectedValueRI, this.requestId]
+ }
+ if (!this.isEmpty(this.selectedValueSN) && !this.isEmpty(this.serviceInstanceName)) {
+ searchFields["serviceInstanceName"] = [this.selectedValueSN, this.serviceInstanceName]
+ }
+
+ if (!this.isEmpty(this.selectedValueSTATUS) && this.selectedValueSTATUS !== "ALL") {
+ searchFields["requestStatus"] = ["EQ", this.selectedValueSTATUS]
+ }
+
+ return of(new SearchRequest(searchFields, this.startTimeInMilliseconds, this.endTimeInMilliseconds));
+ }
+
+ private isEmpty(str) {
+ return (!str || 0 === str.length);
+ }
+
+ private getNumberAsString(num: number) {
+ if (num <= 9) {
+ return "0" + num;
+ }
+ return "" + num;
+ }
+
+}
-/**\r
-============LICENSE_START=======================================================\r
- Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
-*/\r
-\r
-export interface VarInstance {\r
- name: string;\r
- value: string;\r
- type: string;\r
-}\r
+/**
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+ limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+*/
+
+export interface VariableInstance {
+ name: string;
+ value: string;
+ type: string;
+}
-/**\r
-============LICENSE_START=======================================================\r
- Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
-*/\r
-\r
-import { Component, OnInit } from '@angular/core';\r
-import { Router, NavigationEnd } from '@angular/router';\r
-\r
-@Component({\r
- selector: 'app-sidebar',\r
- templateUrl: './sidebar.component.html',\r
- styleUrls: ['./sidebar.component.scss']\r
-})\r
-\r
-export class SidebarComponent implements OnInit {\r
-\r
- currentUrl: string;\r
-\r
- constructor(private router: Router) {\r
- router.events.subscribe((_: NavigationEnd) => this.currentUrl = _.url);\r
- }\r
- ngOnInit() { }\r
-}\r
+/**
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+ limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+*/
+
+import { Component, OnInit } from '@angular/core';
+import { Router, NavigationEnd } from '@angular/router';
+
+@Component({
+ selector: 'app-sidebar',
+ templateUrl: './sidebar.component.html',
+ styleUrls: ['./sidebar.component.scss']
+})
+
+export class SidebarComponent {
+
+ currentUrl: string;
+
+ constructor(private router: Router) {
+ router.events.subscribe((_: NavigationEnd) => this.currentUrl = _.url);
+ }
+}
-/**\r
-============LICENSE_START=======================================================\r
- Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
-*/\r
-\r
-import { Component, OnInit } from '@angular/core';\r
-\r
-@Component({\r
- selector: 'app-topbar',\r
- templateUrl: './topbar.component.html',\r
- styleUrls: ['./topbar.component.scss']\r
-})\r
-\r
-export class TopbarComponent implements OnInit {\r
-\r
- constructor() { }\r
-\r
- ngOnInit() { }\r
-}\r
+/**
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+ limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+*/
+
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-topbar',
+ templateUrl: './topbar.component.html',
+ styleUrls: ['./topbar.component.scss']
+})
+
+export class TopbarComponent {
+
+ constructor() { }
+
+}