How to use start process in bpm 6.10 version of CUBA

Hi,
I am using cuba 6.10 version and used bpm which is supported by activiti engine,
I wanted to use procActionFrame for starting the process in entiry browser screen on click of button but i am not able to use this .
any help will be appreciated thanks in advanced.

Hi,
what did you try? what difficulties did you have?

It looks that you need to add the procActionsFrame somewhere in the browse screen and initialize it each time the entity is selected in the table.

The following documentation may be useful: CUBA Platform. BPM subsystem

If you need just to start the process from the browser you may consider using the regular button that starts the process programmatically instead of ProcActionsFrame.

Take a look at this sample project. Especially at the TaskEdit.java - it demonstrates how to start the process programmatically.

In starting process programmatically and using procActions Frame also facing one issue which is I have entity with compKey so when I pass selected entity from table it shows that error compKey is not valid attribute. How do I pass entityId in this case along with process code.

It looks like a bug. We’ve created an issue.

As a workaround you may override the BpmEntitiesServiceBean in your project.

Create the ExtBpmEntitiesServiceBean.java in your project:

public class ExtBpmEntitiesServiceBean extends BpmEntitiesServiceBean {

    @Override
    public ProcInstance createProcInstance(ProcInstanceDetails procInstanceDetails) {
        Entity entity = procInstanceDetails.getEntity();

        //clear entity to prevent throwing an exception from a supet method
        procInstanceDetails.setEntity(null);

        ProcInstance procInstance = super.createProcInstance(procInstanceDetails);
        if (entity != null) {
            Object entityId = referenceToEntitySupport.getReferenceId(entity);
            procInstance.setObjectEntityId(entityId);
            procInstance.setEntityName(entity.getMetaClass().getName());
        }
        return procInstance;
    }
}

Register the bean in the spring.xml:

<bean id="bpm_BpmEntitiesService" class="com.company.sample.core.ExtBpmEntitiesServiceBean"/>

The sample project that demonstrates this approach: bpm-composite-key.zip (109.3 KB)

In the project there is a “Start process” button in the employees browse screen.