BPM Process Instance

Hi, i am trying to create a process instance, so i check the code given in examples and the method setEntityId no longer exists. So, i found setObjectEntityId but i can’t get it work. The entity ID never get saved on database, all other saved perfectly. This is my code:

public class ClientesEdit extends AbstractEditor<Clientes> {

    private static final String PROCESS_CODE = "promoverClienteEstado";

    @Inject
    private ProcActionsFrame procActionsFrame;
    @Inject
    private DataManager dataManager;    
    @Inject
    private Metadata metadata;
    
    private ProcDefinition procDefinition;
    private ProcInstance procInstance;
    
    @Override
    protected void postInit() {
        super.postInit();
        
        procDefinition = findProcDefinition();
        if (procDefinition != null) 
        {
            procInstance = findProcInstance();
            if (procInstance == null) 
            {
                procInstance = metadata.create(ProcInstance.class);
                procInstance.setProcDefinition(procDefinition);
                procInstance.setEntityName(getItem().getMetaClass().getName());
                procInstance.setObjectEntityId(getItem().getUuid());   
                initProcActionsFrame();
            }
            
        }
    }    
    
    private void initProcActionsFrame() {

        procActionsFrame.initializer()
                .setBeforeStartProcessPredicate(this::commit)
                .setAfterStartProcessListener(() -> {
                    showNotification(getMessage("processstarted!!"), NotificationType.HUMANIZED);
                    close(COMMIT_ACTION_ID);
                })
                .setBeforeCompleteTaskPredicate(this::commit)
                .setAfterCompleteTaskListener(() -> {
                    showNotification(getMessage("taskcompleted!!"), NotificationType.HUMANIZED);
                    close(COMMIT_ACTION_ID);
                })
                .init(procInstance);
    }  
    
    @Nullable
    private ProcDefinition findProcDefinition() {
        LoadContext ctx = LoadContext.create(ProcDefinition.class);
        ctx.setQueryString("select pd from bpm$ProcDefinition pd where pd.code = :code")
                .setParameter("code", PROCESS_CODE);
        return (ProcDefinition) dataManager.load(ctx);
    }

    @Nullable
    private ProcInstance findProcInstance() {
        LoadContext ctx = LoadContext.create(ProcInstance.class).setView("procInstance-start");
        ctx.setQueryString("select pi from bpm$ProcInstance pi where pi.procDefinition.id = :procDefinition and pi.entity.entityId = :entityId")
                .setParameter("procDefinition", procDefinition)
                .setParameter("entityId", getItem().getUuid());
        return (ProcInstance) dataManager.load(ctx);
    }
    
}

Hi, the changes made in the issue https://youtrack.cuba-platform.com/issue/PL-10139 (replacing the entityId property in the ProcInstace with the reference to embedded entity) shouldn’t have been merged to the release_6_7 because they break the backward compatibility. In the next bugfix release 6.7.7 the changes will be reverted. The https://youtrack.cuba-platform.com/issue/PL-10139 will be fixed in the release 6.8. Sorry for the inconvenience.
The issue: https://youtrack.cuba-platform.com/issue/PL-10213

2018-01-22 04:15:39.326 WARN [http-nio-80-exec-10/app-core/iyappan] com.haulmont.cuba.core.app.Emailer - Unable to send email to ‘no-reply@filmontop.com’

Why this error is come from that cuba console…but is local server its
is working…