Bpm process form param


I’d like to ask that how can I get a custom ProcForm param?

I made a new bpm ProcForm and I would like to get the edited entity from the process in the new form’s controller.
Is it possible, and if it is, how can I do that?

Thanks for the answers.

To get the edited entity you probably need to get entity id from the process variables. Each time the new process is started the entity id is written to the process variable called entityId.

To get its value in the process form you may try to do something like this:

public class TaskContractApprovalForm extends Screen implements ProcForm {

    protected TextField<String> contractField;

    protected ProcessVariablesService processVariablesService;

    private DataManager dataManager;

    //ProcInstance can be get from window params
    private ProcInstance procInstance;

    protected void onInit(InitEvent event) {
        //get the entityId process variable
        UUID entityId = (UUID) processVariablesService.getVariable(procInstance.getActProcessInstanceId(), "entityId");
        //load the entity with the given id
        Contract contract = dataManager.load(Contract.class)
        //use the loaded entity

Unfortunately, there was an issue - the ProcessVariablesService cannot be injected to the screen controller. It is fixed and the fix will appear in the next 7.1. bugfix release. So the snippet above will only work after bugfix release is published.