@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:
@dirkw65 based on activity type, you can get extension properties from DelegateTask/Delegate Execution or by parsing the whole process definition xml itself.
Example to get extension properties from DelegateTask/DelegateExecution:
UserTask:
UserTaskImpl userTaskImpl = bpmnModelElementInstance.getModelInstance().getModelElementById(modelElementId);
ExtensionElements userTaskExtensionElements = userTaskImpl.getExtensionElements();
Collection<CamundaProperty> userTaskProperties = userTaskExtens…
@Minisha_M you can add static data in the Extension properties like below:
[image]
In order to access these properties at runtime you need to parse it. From TaskListener you can access it like,
ExtensionElements extensionElements =((UserTask) delegateTask.getBpmnModelElementInstance()).getExtensionElements();
Collection<CamundaProperty> properties = extensionElements.getElementsQuery()
.filterByType(CamundaProperties.class).singleResult().getCamundaProperties();
We use something like this:
String taskId = ...;
ProcessEngineServices processEngineServices = ...;
Task task = processEngineServices.getTaskService().createTaskQuery().taskId(taskId).singleResult();
String taskDefinitionKey = task.getTaskDefinitionKey();
String processDefinitionId = task.getProcessDefinitionId();
Optional<String> myPropertyValue = processEngineServices
.getRepositoryService()
.getBpmnModelInstance(processDefinitionId)
…