Merge branch 'feature/RDMP-3845' into dev
This commit is contained in:
commit
65b8d9f9c4
@ -15,6 +15,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.ListUtils;
|
||||||
import org.flowable.common.engine.api.FlowableObjectNotFoundException;
|
import org.flowable.common.engine.api.FlowableObjectNotFoundException;
|
||||||
import org.flowable.common.engine.impl.interceptor.CommandContext;
|
import org.flowable.common.engine.impl.interceptor.CommandContext;
|
||||||
import org.flowable.engine.HistoryService;
|
import org.flowable.engine.HistoryService;
|
||||||
@ -230,7 +231,7 @@ public class CustomGetProcessInstanceVariablesToObjectCmd extends AbstractComman
|
|||||||
&& fieldValue.toString().startsWith("[")
|
&& fieldValue.toString().startsWith("[")
|
||||||
&& fieldValue.toString().endsWith("]")) {
|
&& fieldValue.toString().endsWith("]")) {
|
||||||
List<String> selectedOptions = JSON.parseArray((String) fieldValue, String.class);
|
List<String> selectedOptions = JSON.parseArray((String) fieldValue, String.class);
|
||||||
List<String> optionNames = optionField.getOptions().stream().filter(i -> selectedOptions.contains(i.getId())).map(Option::getName).collect(Collectors.toList());
|
List<String> optionNames = ListUtils.emptyIfNull(optionField.getOptions()).stream().filter(i -> selectedOptions.contains(i.getId())).map(Option::getName).collect(Collectors.toList());
|
||||||
variables.add(VariableObjectDTO.builder()
|
variables.add(VariableObjectDTO.builder()
|
||||||
.key(field.getId())
|
.key(field.getId())
|
||||||
.desc(field.getName())
|
.desc(field.getName())
|
||||||
@ -245,7 +246,7 @@ public class CustomGetProcessInstanceVariablesToObjectCmd extends AbstractComman
|
|||||||
if (field instanceof OptionFormField) {
|
if (field instanceof OptionFormField) {
|
||||||
OptionFormField optionField = (OptionFormField) field;
|
OptionFormField optionField = (OptionFormField) field;
|
||||||
if (StringUtils.hasText(fieldValue.toString())) {
|
if (StringUtils.hasText(fieldValue.toString())) {
|
||||||
List<String> optionNames = optionField.getOptions().stream().filter(i -> Objects.equals(fieldValue, i.getId())).map(Option::getName).collect(Collectors.toList());
|
List<String> optionNames = ListUtils.emptyIfNull(optionField.getOptions()).stream().filter(i -> Objects.equals(fieldValue, i.getId())).map(Option::getName).collect(Collectors.toList());
|
||||||
variables.add(VariableObjectDTO.builder()
|
variables.add(VariableObjectDTO.builder()
|
||||||
.key(field.getId())
|
.key(field.getId())
|
||||||
.desc(field.getName())
|
.desc(field.getName())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user