The requirement on my side need to support something like approval submit history. I try a free trial on webapp-EE edition, but this feature seems only available to cockpit.
The reason for there being no place to view processes started by a user is just because It’s not something we’ve been asked to build.
The API’s are there to make this happen and so i suggest that if you’d like, you could utilize the REST API to build either a plugin that does what you want or you could build your own custom view.
Thanks, I will try the plugin route.
Feel free to take a look at this video tutorial to give you an idea of how you might get started building a plugin
Hi Niall, I have write some code on this plugin:
const host = "http://localhost:8080"
export default {
id: 'tasklist.myprocess',
pluginPoint: 'tasklist.list',
priority: 9001,
render: (node, {api}) => {
const data = { startedBy: 'demo'}
console.log("api", api);
fetch(api.engineApi + "/history/process-instance", {
method: 'post',
body: JSON.stringify(data),
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
"X-XSRF-TOKEN": api.CSRFToken,
}
})
.then(async (response) => await response.json())
.then(async (data) => {
const myProcessContainer = document.createElement("div");
const banner = document.createElement("h5");
banner.innerText = "Process created by me";
myProcessContainer.append(banner);
//console.log("Success:", data)
for(let i = 0; i < data.length; i++){
const obj = data[i];
console.log(obj);
let process_item_div = document.createElement("div");
let process_item_a = document.createElement("a");
process_item_a.setAttribute('id', obj['id']);
process_item_a.innerText = obj['processDefinitionKey'] + " " + obj['startTime'];
process_item_a.href = host + "/camunda/app/cockpit/default/#/history/process-instance/" + obj['id']
process_item_div.append(process_item_a)
myProcessContainer.append(process_item_div);
}
node.innerHTML = myProcessContainer.innerHTML;
})
.catch((error) => {
console.error('Error', error);
});
},
properties: {
label: 'My process instance'
}
}
what I am trying to do ls list all process started by current user( demo in my example) then give a link to the cockpit to jump to.
However, I don’t know how to get the current userId. can you help? @Niall