Overview
You are using the updateSlotValue() method to update the values of a dataslot in the pre-script (aka Before Activation) or post-script (aka When Completed) call of an Adapter WorkStep.
Both data slots are added to a single hashmap after modification and the same is provided as an argument to a method.
After the execution of the workstep and the update, the value of the object dataslot is getting reset (set to empty).
Solution
The updateSlotValue() updates the existing user-defined DataSlot values of the ProcessInstance with given new values in the HashMap.
When you are using the updateSlotValue in the prescript (aka Before Activation) code, it is basically overriding the existing user-defined dataslot.
The recommendation in such cases is to invoke getDataSlotValue() which would help retrieve the values coming from the previous work step and store these values in a separate hashmap.
After that, create a hashmap with the modified values and the old values (from the map) and pass them to the updateSlotValue(). This should have both old as well as modified values.
For more information about the usage of updateSlotValue() please check the API documentation of the ProcessInstance class available in your installation folder in $SBM_HOME\docs\api\ProcessInstance.html.