1 import axios from "axios";
4 constructor(callback) {
5 this.callback = callback;
6 this.baseUrl = 'http://localhost:8085/engine-rest/';
7 this.axiosInstance = axios.create({
10 this.submitPdfForm = this.submitPdfForm.bind(this);
11 this.getPdfDownloadLink = this.getPdfDownloadLink.bind(this);
12 this.completeTask = this.completeTask.bind(this);
15 submitPdfForm(terms) {
16 const termsValue = [];
17 terms.forEach(term => {
18 termsValue.push({term});
20 console.log('termsValue: ', termsValue);
21 const submitFormUrl = 'process-definition/key/sentiment-analysis/submit-form';
25 value: JSON.stringify(termsValue),
31 .post(submitFormUrl, data)
33 const data = response.data;
35 const id = data['id'];
36 this.getPdfDownloadLink(id)
43 getPdfDownloadLink(id) {
44 const downloadUrl = this.baseUrl + 'process-instance/' + id + '/variables/reportPDF/data';
45 console.log('download: ' + downloadUrl);
46 this.callback(downloadUrl);
50 const completeTaskUrl = 'task/' + id + '/complete';
52 .post(completeTaskUrl)
54 const data = response.data;
63 export default CamundaService;