Start a process upon deployment in EJB application

Hi,

I have a process application created with Maven archetype “camunda-archetype-ejb-war-7.8.0”.
I want to start a process definition upon deployment.
In the pom file I have the depedency

>    <dependency>
>       <!-- client for Java EE application server integration, included in WAR as an alternative to write your own ProcessApplication class -->
>       <groupId>org.camunda.bpm.javaee</groupId>
>       <artifactId>camunda-ejb-client</artifactId>
>     </dependency>
>     <dependency>

But how can I write the code to start a process definition?
If I write something like below (to have my custom process application instead of the depedency), what do I miss?:

@ProcessApplication
public class MyEjbProcessApplication extends EjbProcessApplication {
@PostDeploy
public void onDeploymentFinished(ProcessEngine processEngine) {

processEngine.getRuntimeService().startProcessInstanceByKey(“My_Process”);
}
}

Thanks!

Have a look at this documentation:

https://docs.camunda.org/manual/7.9/user-guide/testing/

I remember reading somewhere that you can configure the process to execute upon deployment. I’m sorry I don’t have the precise information, but I am 100% certain it showed a way to cause a process to start upon deployment with a specific set of process variables as if they were sent in via a REST “start” request.