I understand from your question that you need to set the variables as per the condition that is satisfied in the process.
If you can define the variables during the service task itself, the you can programmatically complete the job worker in the Job Worker method definition ( I have used Spring Client and we can have an optional chaining of method .variables(variables) where the argument variables is a Map<String,Object> ) inorder to send the variables into the process.
Or, you can define variables in the Output Mapping of an activity inside the activity itself.