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)
44 return new Promise(function (resolve, reject) {
45 setTimeout(resolve, ms);
49 getPdfDownloadLink(id) {
50 const downloadUrl = this.baseUrl + 'process-instance/' + id + '/variables/reportPDF/data';
51 console.log('download: ' + downloadUrl);
56 this.callback(downloadUrl);
61 this.getPdfDownloadLink(id);
69 const completeTaskUrl = 'task/' + id + '/complete';
71 .post(completeTaskUrl)
73 const data = response.data;
82 export default CamundaService;