Dear Community
I would like to bind process instance with some entity using @OneToMany relationship.
Let’s assume scenario that there is Employee entity and BusinessTrip process.
I use Camunda + SpringBoot + SpringDataJpa.
The entity I was thinking about, could look like this:
import org.camunda.bpm.engine.runtime.ProcessInstance;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import java.util.List;
@Entity
public class Employee {
@Id
@GeneratedValue
private long id;
private String name;
@OneToMany
List<ProcessInstance> processes;
}
of course above code failed due to:
Caused by: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: com.example.workflow.model.Employee.processes[org.camunda.bpm.engine.runtime.ProcessInstance]
In my consideration application should be employee-centric, therfore this is my prime objective to map it as above. Is such solution possible at all? If yes, any ideas how I could achieve this relationship?