-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdploycamunda.service.ts
More file actions
31 lines (26 loc) · 964 Bytes
/
dploycamunda.service.ts
File metadata and controls
31 lines (26 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// camunda.service.ts
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class CamundaService {
private readonly apiUrl = 'http://localhost:8080/engine-rest'; // Adjust to your Camunda URL
constructor(private http: HttpClient) {}
getProcessDefinitions(): Observable<any[]> {
return this.http.get<any[]>(`${this.apiUrl}/process-definition`);
}
getTasksForProcess(processDefinitionId: string): Observable<any[]> {
return this.http.get<any[]>(`${this.apiUrl}/task`, {
params: {
processDefinitionId: processDefinitionId
}
});
}
getProcessDefinitionXml(processDefinitionId: string): Observable<string> {
return this.http.get(`${this.apiUrl}/process-definition/${processDefinitionId}/xml`)
.pipe(map((response: any) => response.bpmn20Xml));
}
}