cancel
Showing results for 
Search instead for 
Did you mean: 

get Expression

arag
Confirmed Champ
Confirmed Champ

Hello!!!

Well i have a question, and I don´t know if it is posible...

I have a bpmn with many form properties, all of them have a Expression, and i need to recover this information

is there some method or a way to do that??

Thanks for your time Smiley Happy

1 ACCEPTED ANSWER

I'm sorry that the following code works with both versions.

BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefition.getId());

// Start form
StartEvent startEvent = (StartEvent) bpmnModel.getFlowElement("startevent1");
List<org.activiti.bpmn.model.FormProperty> formProps = startEvent.getFormProperties();
for(FormProperty prop : formProps){
    System.out.println(prop.getExpression());
}

// Task form
UserTask userTask = (UserTask) bpmnModel.getFlowElement("usertask1");
formProps = userTask.getFormProperties();
for(FormProperty prop : formProps){
    System.out.println(prop.getExpression());
}

View answer in original post

5 REPLIES 5

I'm sorry that the following code works with both versions.

BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefition.getId());

// Start form
StartEvent startEvent = (StartEvent) bpmnModel.getFlowElement("startevent1");
List<org.activiti.bpmn.model.FormProperty> formProps = startEvent.getFormProperties();
for(FormProperty prop : formProps){
    System.out.println(prop.getExpression());
}

// Task form
UserTask userTask = (UserTask) bpmnModel.getFlowElement("usertask1");
formProps = userTask.getFormProperties();
for(FormProperty prop : formProps){
    System.out.println(prop.getExpression());
}