What you need to use here is a "BPMN Parse Listener".
https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParseListener.java
Camunda provides a nice example of how to setup a parse listener here:
https://github.com/camunda/camunda-bpm-examples/tree/master/process-engine-plugin/bpmn-parse-listener
The original intent of Parse Handlers was to automatically add task or execution listeners to the process model. Why do you do this?
An example is if you automatically want all users to receive an email notification when they are assigned a task (a really common use case). Trouble is, modelling this into the process really messes up the process diagram. So...we use a ParseListener to inject the behavior automatically.
Now, how does this help your use case?
The answer is simple. It gives you access to the model deployment operation.
Every time a new model is deployed, the BPMN is "parsed" and any registered ParseListeners are triggered.
In your case, you would tie into the "parseProcess()" method and execute your custom code.
I would recommend you use a service call and externalize the custom logic so the call to the logic and the execution of the logic are abstracted, but that's up to you.
While an un-usual use case, this is actually a very nice use case for BpmnParseListeners.
Hope this helps.
Greg