editing a data field at any point in the process

  • 27 July 2012
  • 8 replies
  • 0 views

Badge +6

We have been asked to allow a group to edit a date at any point in the process, even if that group's task has been completed. What is the best method for doing that. An use case is below.


HR  puts in a termination date and moves the workflow along. At some point in the process they may want to edit that date even though their task is already complete. Each subsequent task would have the new date. What is the best way to accomplish this


thanks


8 replies

Badge +9

That depends on a few things, I suppose - mainly, what are you using for your UI and where are you storing this data?

Badge +9

That depends on a few things, I suppose - mainly, what are you using for your UI and where are you storing this data?

Badge +9

That depends on a few things, I suppose - mainly, what are you using for your UI and where are you storing this data?

Badge +9

That depends on a few things, I suppose - mainly, what are you using for your UI and where are you storing this data?

Badge +6

we are using either ASP.net page or an infopath form. The data that needs changed will be stored in the workflow database.

Badge +9

To update a datafield, we need Process ID, if u go for asp.net, then the below code would be useful.


// create a connection string
SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder connBldr =
                    new SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder();


// force the connection string to a specific credential of k2 server admin
SCConnectionStringBuilder cb = new SCConnectionStringBuilder();
cb.Host = "k2server";
cb.Port = 5555;
cb.SecurityLabelName = "K2";
//cb.UserID = "orion";
//cb.WindowsDomain = "";
//cb.Password = "passe";
cb.Integrated = false;
cb.IsPrimaryLogin = true;
// instantiate a connection with this connection string
SourceCode.Workflow.Management.WorkflowManagementServer server = new    SourceCode.Workflow.Management.WorkflowManagementServer(cb.Host, cb.Port);
server.CreateConnection();
server.Connection.Open(cb.ToString());


//Connect to Workflow Server
SourceCode.Workflow.Client.Connection wfConnection = new SourceCode.Workflow.Client.Connection();
cb.Port = 5252;
wfConnection.Open("k2server", cb.ToString());


//Get ProcessInstance
SourceCode.Workflow.Client.ProcessInstance proc = wfConnection.OpenProcessInstance(workflowProcessID);
                              
proc.DataFields["datafieldnametobeupdated"].Value = "Testingg...";
proc.Update();
}
}
}
}
}
// close the connection
server.Connection.Close();
}

Badge +6

thx for the code. Where do you get workflowProcessID from?

Badge +9

If u have Folio with u, u can pass that to k2 database OR whenever a process instance created, u can save it in ur custom db or somewhr. U can get it from the task created to HR Role

Reply