class TaskFormModelHandler extends AbstractJBPMFormModelHandler<TaskFormModel> {

    @Override
    public void checkSourceModel() throws SourceFormModelNotFoundException {
        JBPMProcessModel processModel = bpmFinderService.getModelForProcess(formModel.getProcessId(), path);

        if (processModel != null) {
            Optional<TaskFormModel> optional = processModel.getTaskFormModels().stream()
                    .filter(taskFormModel -> taskFormModel.getFormName().equals(formModel.getFormName()))
                    .findAny();

            if (!optional.isPresent()) {
                String[] params = new String[]{formModel.getTaskName(), formModel.getProcessId()};
                throw new SourceFormModelNotFoundException(JBPMFormsIntegrationBackendConstants.MISSING_TASK_SHORT_KEY, params,
                                                           JBPMFormsIntegrationBackendConstants.MISSING_TASK_FULL_KEY, params,
                                                           JBPMFormsIntegrationBackendConstants.PROCESS_KEY, formModel);
            }
        } else {
            String[] params = new String[]{formModel.getProcessId()};
            throw new SourceFormModelNotFoundException(JBPMFormsIntegrationBackendConstants.MISSING_PROCESS_SHORT_KEY, params,
                                                       JBPMFormsIntegrationBackendConstants.MISSING_PROCESS_FULL_KEY, params,
                                                       JBPMFormsIntegrationBackendConstants.PROCESS_KEY, formModel);
        }
    }

    @Inject public  TaskFormModelHandler(KieModuleService projectService,
                                ModuleClassLoaderHelper classLoaderHelper,
                                FieldManager fieldManager,
                                BPMFinderService bpmFinderService);

}