Mapping between task identifier and activiti$

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
sakshik
Established Member

Mapping between task identifier and activiti$

I have a ruby script that can delete a task given its activiti$<number>. 

I get this number from admin console:

Command: show workflows all

I want to automate the process of deleting workflows. Can I get this activiti number from Task identifier

2 Replies
sanjaybandhniya
Senior Member

Re: Mapping between task identifier and activiti$

Yes.You will get activiti Id from that task id.

WorkflowTask workflowTask =serviceRegistry.getWorkflowService().getTaskById("activiti$18563");
String activitiId=workflowTask.getPath().getInstance().getId();

sakshik
Established Member

Re: Mapping between task identifier and activiti$

Hi Sanjay,

Thanks for the answer. I do not have alfresco SDK setup and hence I could not do this in Java.

I found an API provided by alfresco that returns details about a task :

https://<Domain name>/alfresco/service/api/task-instances/activiti$<taskidentifier>.

It throws lots of details about this task in JSON. I pull the activiti ID like this:

JSON.parse(result)["data"]["workflowInstance"]["id"]