BPM workflow on existing table schema with some tables missing primary key

I created a sample workflow that processes customer verification. It is intended to take the customer from one verification state to another.
Technically speaking, it should advance the value of one of the attributes of “Contact” table record each time the work flow executes until the attribute value is set to “Verification Complete”.

I observed that each time the workflow process is started, in the application, by the authorized role, a new record is created in the Contact table.The workflow does work for the newly created record.
I understand that the ID of the entity is passed by the BPM framework. It certainly seems to pass one for the record it creates but not the one already existing.
Please suggest a way to work with existing schema.

Please note: I am working with an existing schema. And there are tables that do not have primary keys. CUBA platform seems to update the existing DB by adding a primary key to each table that do not have one.

So how are your entities mapped? Did you create primary keys?

As I stated, there are tables that do not have primary keys. The respective entities were created using “Generate model” option under “Data Model” in CUBA studio.

None of the entities having no primary keys, contain a column annotated with @Id.

How did you manage to build and run your application with entities without @Id?
JPA requires primary keys and corresponding id attributes.

Deleted the scripts that force DB update.

OK, you left your tables without PK.
But anyway, you cannot use entities without @Id attributes. It’s not supported in JPA and in CUBA. You have to map @Id to some columns of your tables.