Hi,
In camunda 8, say, I have 10 service tasks, each service task has output variable.
Say, first task has output variable as x and second task has output variable of y.
I dont want x or y to be sent as input to service task 10. I can see an option in camunda 7 but I couldn’t figure out in 8. We have so many process variables and trying to avoid lot of movement of process variables.
One option i can think is to wrap task in a event subprocess. Is this the best option?
In your Job Worker (the implementation of the service task) you can specify which variables to receive and no more than that. For example in Java/Spring:
@JobWorker(type = “publish-tweet”)
public void handleTweet(@VariablesAsType TwitterProcessVariables variables)
Thanks.
Sorry for late respond.
I tried your solution and it works but doesn’t fully solve my purpose.
here is my typical worker looks like with ActivatedJob as I needed for retries and additional logic. I added as you suggested and I am getting the required variable but I also need ActivatedJob and when i do that, it is getting everything(outputs from previous service tasks).
Or Does it mean that, when I use job.getVariablesAsMap as I was using previously, camunda makes a internal call to fetch all variables that has potential to degrade the performance. I am not 100% sure of internal implementation. So, never call job.getVariablesAsMap even though ActivatedJob is passed in method signature and pass VariablesAsType. Is my understanding correct?
@Component
public class DummyWorker2 {
private final static Logger logger = LoggerFactory.getLogger(DummyWorker2.class);
@JobWorker(type = “dummyWorker2”, autoComplete = true)
public Map<String, Object> printDummy(@VariablesAsType RegIdVariableModel variables, final ActivatedJob job) {