feat(REQ-3845) - 调整获取流程模型表单定义内容
This commit is contained in:
parent
279d066b3b
commit
98f560dc77
@ -8,9 +8,11 @@ import org.flowable.form.api.FormInfo;
|
||||
import org.flowable.form.api.FormInstance;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.flowable.form.api.FormService;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -38,8 +40,12 @@ public class CustomGetFormModelByProcessInstanceIdCmd extends AbstractCommand<Fo
|
||||
FormEngineConfigurationApi formEngineConfiguration = CommandContextUtil.getFormEngineConfiguration(commandContext);
|
||||
FormService formService = formEngineConfiguration.getFormService();
|
||||
|
||||
FormInstance formInstance = formService.createFormInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
||||
String formDefinitionId = formInstance.getFormDefinitionId();
|
||||
List<FormInstance> list = formService.createFormInstanceQuery().processInstanceId(processInstanceId).orderBySubmittedDate().desc().list();
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String formDefinitionId = list.get(0).getFormDefinitionId();
|
||||
FormRepositoryService formRepositoryService = formEngineConfiguration.getFormRepositoryService();
|
||||
return formRepositoryService.getFormModelById(formDefinitionId);
|
||||
}
|
||||
|
||||
@ -346,7 +346,7 @@ public class PrintAdminController implements PrintAdminApi {
|
||||
}
|
||||
|
||||
private void convertValueToObject(Map<String, Object> result, FormInfo formInfo) {
|
||||
if (CollectionUtils.isEmpty(result)) {
|
||||
if (CollectionUtils.isEmpty(result) || Objects.isNull(formInfo)) {
|
||||
return;
|
||||
}
|
||||
Map<String, FormField> stringFormFieldMap = ((SimpleFormModel) formInfo.getFormModel()).allFieldsAsMap();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user