Bproc - createProcessForm in MasterDetailScreen

Hi,

I’m testing out the Bproc in my application. I am able to run the sampler locally. The difference between the sampler and my application is that I use MasterDetailScreen while the sampler uses the StandardEditor screen. My application trips up during start:

@Subscribe("startProcessBtn")
private void onStartProcessBtnClick(Button.ClickEvent event) {
    ProcessDefinitionData processDefinitionData = findProcessDefinitionData();
    processFormScreens.createStartProcessForm(processDefinitionData,this);


    commitChanges()
            .then(() -> {
                Order order = getEditedEntity();
                String businessKey = order.getNumber();
                processFormContext.processStarting()
                        .withBusinessKey(businessKey)
                        .addProcessVariable("order", order)
                        .addProcessVariable("approver", order.getManager())
                        .start();
                closeWithCommit();
            });
}

}

Should I be doing anything different when using MasterDetailScreen compared to StandardEditor?
Here is the error:
image

Hi, could you please explain what behavior are you trying to implement? What should happen when you click the “Start process” button:

  • a start process form that is defined in the model should be displayed
  • the process should be started immediately?

In your code snippet I see that you’re trying to do both of these things. It’s impossible, because if you open the start process form, then it is a process form responsibility to start the process.

Thanks Max,

I think you are right. I am able to get it working with this snippet:

Order order = getEditedEntity();
Map<String, Object> processVariables = new HashMap<>();
processVariables.put(“orderId”, order.getId());
processVariables.put(“approver”, order.getManager());
bprocRuntimeService.startProcessInstanceByKey(
“entity-editor-form”,
order.getNumber(),
processVariables);