private void updateTaskDataInputs(FlowElementsContainer container, Definitions def) {
List<FlowElement> flowElements = container.getFlowElements();
for(FlowElement fe : flowElements) {
if(fe instanceof Task && !(fe instanceof UserTask)) {
Task task = (Task) fe;
boolean foundReadOnlyServiceTask = false;
Iterator<FeatureMap.Entry> iter = task.getAnyAttribute().iterator();
while(iter.hasNext()) {
FeatureMap.Entry entry = iter.next();
if(entry.getEStructuralFeature().getName().equals("taskName")) {
if(entry.getValue().equals("ReadOnlyService")) {
foundReadOnlyServiceTask = true;
}
}
}
if(foundReadOnlyServiceTask) {
if(task.getDataInputAssociations() != null) {
List<DataInputAssociation> dataInputAssociations = task.getDataInputAssociations();
for(DataInputAssociation dia : dataInputAssociations) {
if(dia.getTargetRef().getId().endsWith("TaskNameInput")) {
((FormalExpression) dia.getAssignment().get(0).getFrom()).setBody("ReadOnlyService");
}
}