Modify process variable on historical instances

Hello I have a requirement of reconcile some variable data on historical instances. It seems it cant be done via historyservice.

I am using spring boot integration. Does anybody know how I can get a instance of commandcontext so i can get various entity managers?

Many thanks