cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping between task identifier and activiti$

sakshik
Star Contributor
Star Contributor

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 2

sanjaybandhaniya
Elite Collaborator
Elite Collaborator

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

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

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"]