FieldInjections vs Input Parameters

As the title say, I would like to have a better understanding of the difference between Field Injections and Input Parameters, and when to use one instead of the other.
Mostly I use them in service tasks, but I don’t get the pro or cons of each one.

Many thanks to whom will help.

Hi @Leonardo_Chirivi,

I’m not sure I understand the context of your question. Can you provide and example of your use-case?

Thanks

They amount to much the same thing, with a few differences:

  1. Field injections are controlled through Expression types at the class level.
  2. Field Injections dont create local variables
  3. Input Parameters create local variables
  4. Field Injection is a older features that does not seem to get much attention, as Input Params basically do all the same things without the complexities of using “Expression”

There is 1 major difference i have found: When using Execution and Task Listeners, and you use a Java Delegate, there is the additional option for Field Injection. This creates a great opportunity for simplifying the amount of variables you create and allow Delegates for Listeners to be configurable through field injection, rather than overloading a activity with Local Variables that are used for configuring the 1 or more listeners

4 Likes