I found the solution nonetheless it is not perfect. The procedure:
function [code,outputs] = generateCode(task)
code = "";
outputs = {''};
end
Supports two types of outgoing variables. The code can be use to assign variables to workspace. Here you can finde example:
code=['FieldNameInWorkspace=',num2str(task.EditField.Value)]
If you need pass several variables you can do this:
code=['Name1',num2str(task.EditField1.Value)...
';Name1',num2str(task.EditField2.Value)...
';Name1',num2str(task.EditField3.Value)]
It does not look clean, but so far I think it is the only option to do it directly. If the exported variable is non-numeric remember to convert it correctly to string/char.