Make fetching of Job variables more convenient and DRY
See original GitHub issueInstead of repeating variable names in the fetchVariables
property of the @ZeebeWorker
annotation and then later in the actual variable access, e.g.
@ZeebeWorker(type = "myType", fetchVariables = { "orderId" } )
public void handleJob(final JobClient client, final ActivatedJob job) {
String orderNumber = (String) job.getVariablesAsMap().get("orderId");
}
we could keep it DRY (Don’t Repeat Yourself) and convenient with an argument list, e.g.
@ZeebeWorker(type = "myType")
public void handleJob(final JobClient client, final ActivatedJob job, String orderId) {
}
Type casting would also be done implicitly here. Not sure if the additional parameter would have to be annotated to make this work.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Specify variables when retrying a manual job - GitLab.org
Enter another value for the TEST_VARIABLE and run the job; The new value for TEST_VARIABLE is not echoed. The variable is empty. Im...
Read more >Parameterized Jobs on Nomad - HashiCorp Developer
Parameterized jobs allow run-specific metadata in a job specification. Write and dispatch your first parameterized jobs on Nomad.
Read more >Job Variables | Matillion ETL Docs
To create a job-scoped variable, right-click on the desired orchestration or transformation job within the explorer panel and select Manage Variables. This will ......
Read more >16. Job Templates — Ansible Tower User Guide v3.8.6
A job template is a definition and set of parameters for running an Ansible job. Job templates are useful to execute the same...
Read more >Azure Pipeline Variables | Colin's ALM Corner
The trick to making variable groups work for environment values is to keep the names the same in each variable group. That way...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Or probably?
@ZeebeWorker(type = "myType") public void handleJob(final JobClient client, final ActivatedJob job, @ZeebeVariable String orderId) { }
I generally like that direction, but I am worried that this allows configuring wired things:
But maybe I am too worried 😉 The above situation could raise an exception during startup as being invalid - or we simply say that “fetchAllVariables=true” always wins - which still make sense I guess