on 2019 Jun 10 9:57 AM
Currently there is ‘salesApplication’ attribute in the session that stays as null for cronjobs. That is causing some solr indexing cronjobs to fail as there is a search restriction being added as part of my work which expects input for ‘(?session.salesApplication)’. What would be the best place to set that attribute in the session so that it works for all the cronjobs?
Request clarification before answering.
Use ImpersonationContext to set the value and execute the code inside impersonationService. Sample Code:-
final ImpersonationContext context = new ImpersonationContext();
context.setSite(orderProcessModel.getOrder().getSite());
context.setUser(userService.getAdminUser());
impersonationService.executeInContext(context, () ->
{
warehousingConsignmentWorkflowService.decideWorkflowAction(consignment, templateCode, null);
waitUntilWorkflowProcessIsNotRunning(workflowModel, timeOut);
return null;
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.