how to runprocess using beanshell with save record

Confluence User - 27 Mar, 2019

i have problem when run process manually using beanshell, this my bean shell script

WorkflowManager workflowManager = (WorkflowManager) AppUtil.getApplicationContext().getBean("workflowManager");
AppService appService = (AppService) AppUtil.getApplicationContext().getBean("appService");

AppDefinition appDefinition = new AppDefinition();
appDefinition = AppUtil.getCurrentAppDefinition();
WorkflowProcess processDef = appService.getWorkflowProcessForApp(appDefinition.getId(), appDefinition.getVersion().toString(), processDefKey);

WorkflowProcessResult processResult = workflowManager.processStart(processDefId, variableMap);

to fix the problem i get process id

String processId = processResult.getProcess().getInstanceId();

and then use the processId to store record

FormDataDao formDataDao = (FormDataDao) AppUtil.getApplicationContext().getBean("formDataDao");
FormRowSet rowsSubmitSetting = new FormRowSet();

rowSubmitSetting.setId(processId);
rowsSubmitSetting.add(rowSubmitSetting);
formDataDao.saveOrUpdate(formDefIdSetting, tableNameSetting, rowsSubmitSetting);

my problem is record with current process id not found when i get with jdbc or "formDataDao.find" (using bean shell again in other tool after running process).

any one to help me.

thanks in advance.

 

 

 

run-process;beanshell

1


01 Apr, 2019
confluenceUser
confluenceUser

Hi, did you check to verify that the process ID is stored correctly as the ID in the form database table? Are there any error messages in the logs?

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print