Hi,
I am using 4.6.7/8
I have assigned ProcessInstance Datafields from ASP.NET code LIKE :
ProcessInstance.DataFields["DtFldRoleID"].Value = strK2RoleID; (This is only datafield I am writing here but there are few more)
Before this line I am creating process instance.
The process Instance is getting created properly but when I am looking for the value of this datafield (in a email event) it is just showing me the initial value of the datafield that is 0.
This is very surprising actually I have seen the values getting assigned from code previously but how this is not working now.
There are some datafields on which the whole business logic of K2 Process depends. If the datafields are not getting assignined then it will be very big issue.
Following is the code : I debugged and no any error.
public Int32 InvokeK2Process(RequestFormDTO requestFormDTO)
{
ProcessInstance piK2ProcessInstance = null;
int procInstID = 0;
//Declare and Open Connection to K2 Server
Connection conn = new Connection();
try
{
strK2ConnectionStringValue = K2ConnectionString();
conn.Open(WebConfigurationManager.AppSettings.Get(GlobalConstant.K2_WORKFLOW_SERVER_NAME), strK2ConnectionStringValue);
string piK2ProcessInstance = "@StandardRequestWorkflow";
piK2ProcessInstance = conn.CreateProcessInstance(strK2ProcessName);
conn.StartProcessInstance(piK2ProcessInstance );
procInstID=piK2ProcessInstance.ID;
piK2ProcessInstance .DataFields["DtFldFormID"].Value = requestFormDTO.ServiceMasterId.ToString();
piK2ProcessInstance .DataFields["DtFldUserID"].Value = requestFormDTO.LoggedInUserId.ToString();
piK2ProcessInstance .DataFields["DtFldRoleID"].Value = requestFormDTO.RoleId.ToString();
piK2ProcessInstance .DataFields["DtFldRequestID"].Value = requestFormDTO.ServiceRequestId.ToString();
piK2ProcessInstance .Update();
}
Please, help on this, Is the code correct.