Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Hi,
In v5, FormService had been changed to an interface with FormServiceImpl as its implementation.
I can't replicate your issue. From the error you posted, it could be you are building your plugin with v4 source code?
The following still the correct way to retrieve FormService.
FormService formService = (FormService) AppUtil.getApplicationContext().getBean("formService");
I am able to resolve the issue by compiling the Code with V5 dependency
FormDefinitionDao formDefinitionDao = (FormDefinitionDao) AppUtil.getApplicationContext().getBean("formDefinitionDao");
FormService formService = (FormService) AppUtil.getApplicationContext().getBean("formService");
AppDefinition appDef = appService.getAppDefinition(appId, appVersion.toString());
FormDefinition formDef = formDefinitionDao.loadById(formId, appDef);
if
(formDef !=
null
) {
//create the form
Form form = (Form) formService.createElementFromJson(formDef.getJson(),
true
);