Connector to update variable
1 answer
Hi,
The best starting point is the documentation for that.
You can see a connector as a Java method executed at a specific moment in the process lifecycle that receive a set of inputs and return a result.
In your case, I think you should take a look to the concept of Operation which seems to suit your needs better.
Cheers.
Comments
Thanks Lionel.
I understood everything (I think) till the point of implementing the Java class.
In the Java class, as per the documentation, I implemented the Connector class. Then, in the execute method, I simply wrote:
parameters.put("Something", 1);
return parameters;
(parameters is a Map<String,Object>) and I didn't do anything else besides setting the input parameters (this.parameters = parameters).
But the variable taking the value returned by the connector still has null as it's value. Shouldn't it have the String "Something" as the value?
In the executeBusinessLogic method, you should call the method setResult(result) to set the output of the connector.
Thank you very much! I am now able to update a variable value!
Now I have another question..How can I pass an input to the connector? I'm asking this because the method setInputParameters only accepts a Map..I would like it to receive, for example, a String.
How can I pass, well, something, to the connector, and have that something be a string?
If it helps, I want to do the following:
I want to change the expected end date of a task. For that I want to make a connector that receives the expected end date (I don't exactly know how I'm going to obtain it, but i'll figure it out ;) ), changes it to something else (for example to working days), and returns that changed date, which I will than apply to the task. Basically, that's it ;)