Hi. I’m looking for a rest API to get task properties which declared in extensions tab of modeler. Is there?
@M_Azizi Built-in rest api is not there for fetching extension properties. You can expose a rest api by fetching the bpmn model using repository service.
@Autowired
private RepositoryService repositoryService;
public void parseBpmn(String bpmn20XML ) throws IOException {
Collection<CamundaProperties> camundaProperties = new ArrayList<>();
BpmnModelInstance bpmnModelInstance = Bpmn.readModelFromStream(repositoryService.getProcessModel("processDefinitionId"));
Collection<UserTask> userTasks = bpmnModelInstance.getModelElementsByType(UserTask.class);
userTasks.stream().forEach(userTask -> {
if (userTask instanceof UserTask) {
camundaProperties.addAll((Collection<? extends CamundaProperties>) userTask.getExtensionElements().getElementsQuery()
.filterByType(CamundaProperties.class).singleResult().getCamundaProperties());
}
});
}
You can refer below examples:
thanks for your response @aravindhrs . I was looking for a rest. not any java code. I did that by declaring input/output parameters. I’m not sure this is a clear solution or not, but It works for my usage.
I get task variables by this API and input/output parameters are included too:
localhost:8080/engine-rest/task/{id}/form-variables
Rest api not available at this moment for this feature. Maybe you can raise a feature request in the camunda portal