It's timing. When you start a workflow, it will only wait for the workflow to finish initializing and it returns things like the process instance ID or whatever is found under the "Workflow" tree when you're configuring the output mappings. Your data conversion is done in the next activity after the workflow has started, which means the conversion has not taken place yet when you're trying to retrieve it.
Thank you for that explanation.
But in such situation, is there any way to retrieve the result of the workflow? Someone said in a post to check the status of Process Instance through the workflow ID and if it said Complete to query for result, however that object does not have a results method, or any other method than list. Is there any way to retrieve the results of a workflow?
Hi davidedpg10,
You can write a small piece of code to convert string input to bytes and then to base64 format inside start rule of start activity.
string dfInfo = _k2.ProcessInstance.DataFieldse"Info"].Value.ToString();
//Info is datafield name containg data to convert to base64.
byteb] bytes = Encoding.UTF8.GetBytes(dfInfo);
string base64 = Convert.ToBase64String(bytes);
_k2.ProcessInstance.DataFieldse"EncodedString"].Value = base64;
//EncodedString is datafield name which will store the converted result.
This will return the result in datafield (for example in my case EncodedString) when workflow started.
Or you can also use smartforms inline functions to convert the string to base 64 format, return string data to form and then convert it to base64 .