Hello
I have a simple workflow with Couple of activities
First Activity is fetching data from downsteam system using REST API
then it adding few more addition properties
and then return that value
@Data
class DownstreamFirstActivityMethodResponse implements Serializable {
//serial version id included here
private String prop1;
private String prop2;
/**/
private String firstActivityMethodSettingAsAdditionalParam;
}
class FirstActivityParam implements Serializable {
//serial version id included here
private String workflowIsSetting;
private String firstActivityMethodSettingAsReturnParam;
}
Signature of the first activity:
________________________________
DownstreamFirstActivityMethodResponse firstActivityMethod(FirstActivityParam param)
Note: firstActivityMethod does 3 things
1) param.setFirstActivityMethodSettingValueAsReturnParam("first activity setting value")
2) Calls REST API and result of downstream is an instance of DownstreamFirstActivityMethodResponse
3) sets a new prop -
downstreamFirstActivityMethodResponse.setFirstActivityMethodSettingAsAdditionalParam("THIS IS NEW PROP VALUE SET BY 1st ACTIVYT");
Signature of the second activity:
---------------------------------
void secondActivityMethod(FirstActivityParam param, DownstreamFirstActivityMethodResponse input )
workflow logic - inside workflow method:
--------------------------------------
FirstActivityParam param = new FirstActivityParam();
param.setWorkflowIsSetting("somevalue");
DownstreamFirstActivityMethodResponse firstActityReturnValue = firstactivity.firstActivityMethod(param);
System.out.println(firstActityReturnValue.getFirstActivityMethodSettingAsReturnParam());
//Expected : THIS IS NEW PROP VALUE SET BY 1st ACTIVYT
//BUT - is NULL
System.out.println(FirstActivityParam.getFirstActivityMethodSettingValue());
//Expected : "first activity setting value"
//BUT - is NULL
secondActivityObject.secondActivityMethod(param,firstActityReturnValue)
//2nd Activity Needs those additional return param value and addional prop value from downstreamResponse
Question : it s really a puzzle for me to see that, after 1stActivityMethod call completion - those addional elements are nullfied, why