yawlfoundation / yawl

Yet Another Workflow Language
http://www.yawlfoundation.org
GNU Lesser General Public License v3.0
88 stars 35 forks source link

AbstractCodelet should load inParams and outParams in the constructor #624

Closed Marco-Sulla closed 4 years ago

Marco-Sulla commented 5 years ago

The population of these two parameters are demanded to the execute() method, since YAWL passes these parameters to it. I think that YAWL should pass these parameters to the constructor instead, and execute() will be a method with only the inData parameter. IMHO it's much more standard this way.

Furthermore, I think it's more simple if inParams and outParams will be a Map<String, YParameter>, so you have no to cycle over the parameters every time one needs to get a parameter by its name.

adamsmj commented 4 years ago

A codelet is loaded by the class loader exactly once. Since each task will have different parameters, these cannot be passed to the constructor, but rather must be passed to the execute method.

Task parameters and stored as lists throughout the system. You are free to change the lists to maps in your codelet implementation as you wish.