Compare commits
2 Commits
dc44245550
...
168a8e7d4e
| Author | SHA1 | Date | |
|---|---|---|---|
| 168a8e7d4e | |||
| 98f560dc77 |
@ -8,9 +8,11 @@ import org.flowable.form.api.FormInfo;
|
|||||||
import org.flowable.form.api.FormInstance;
|
import org.flowable.form.api.FormInstance;
|
||||||
import org.flowable.form.api.FormRepositoryService;
|
import org.flowable.form.api.FormRepositoryService;
|
||||||
import org.flowable.form.api.FormService;
|
import org.flowable.form.api.FormService;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,8 +40,12 @@ public class CustomGetFormModelByProcessInstanceIdCmd extends AbstractCommand<Fo
|
|||||||
FormEngineConfigurationApi formEngineConfiguration = CommandContextUtil.getFormEngineConfiguration(commandContext);
|
FormEngineConfigurationApi formEngineConfiguration = CommandContextUtil.getFormEngineConfiguration(commandContext);
|
||||||
FormService formService = formEngineConfiguration.getFormService();
|
FormService formService = formEngineConfiguration.getFormService();
|
||||||
|
|
||||||
FormInstance formInstance = formService.createFormInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
List<FormInstance> list = formService.createFormInstanceQuery().processInstanceId(processInstanceId).orderBySubmittedDate().desc().list();
|
||||||
String formDefinitionId = formInstance.getFormDefinitionId();
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String formDefinitionId = list.get(0).getFormDefinitionId();
|
||||||
FormRepositoryService formRepositoryService = formEngineConfiguration.getFormRepositoryService();
|
FormRepositoryService formRepositoryService = formEngineConfiguration.getFormRepositoryService();
|
||||||
return formRepositoryService.getFormModelById(formDefinitionId);
|
return formRepositoryService.getFormModelById(formDefinitionId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -416,7 +416,7 @@ public class PrintAdminController implements PrintAdminApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void convertValueToObject(Map<String, Object> result, FormInfo formInfo) {
|
private void convertValueToObject(Map<String, Object> result, FormInfo formInfo) {
|
||||||
if (CollectionUtils.isEmpty(result)) {
|
if (CollectionUtils.isEmpty(result) || Objects.isNull(formInfo)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Map<String, FormField> stringFormFieldMap = ((SimpleFormModel) formInfo.getFormModel()).allFieldsAsMap();
|
Map<String, FormField> stringFormFieldMap = ((SimpleFormModel) formInfo.getFormModel()).allFieldsAsMap();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user