how to runprocess using beanshell with save record
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.