Took over some existing models that were used with Activiti 5.22 that made calls similar to this:
execution.getEngineServices().getRuntimeService().setVariables(
execution.getId(),
{'blah1': execution.getVariable('blah1'), 'blah2Key': 'blah2Val'});
getEngineServices is not part of DelegateExecution in Activiti 6, so not sure how to change so the results are identical to what we were doing in 5.22.
I'm guessing the following call would result in variables being set on a different scope:
execution.setVariables({'...': '...'});
execution.setVariables({'...': '...'}) should just work!
Also, did you try runtimeService.setVariables( execution.getId(), {});? The runtimeService bean should be available in the script context.
Thanks for the response.
I did get it to work by using Context:
org.activiti.engine.impl.context.Context.getProcessEngineConfiguration().getRuntimeService().setVariables(...);
I didn't realize runtimeService was directly available to the script, so removing Context.getProcessEngineConfiguration() works great. Much cleaner solution. Thank you.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.