Thanks for the response .
I have got it solved by the way you suggested.
<code>
ProcessDefinitionEntity processDefinition =
(ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(processInstance.getProcessDefinitionId());
if (processDefinition != null) {
for (ActivityImpl activity : processDefinition.getActivities()) {
String type = (String) activity.getProperty("type");
String name = (String) activity.getProperty("name");
String taskId = activity.getId();
System.out.println("test "+type+" name "+name + " id: " + taskId);
}
}
</code>