Process Instance showing status "Error"

  • 1 March 2007
  • 1 reply
  • 1 view

Badge +1
Hi,

I have a workflow that is developed in K2 .Net and is linked with Share Point. In some of the steps the document status showing "error" and most of the time some process inastances are success in this particular steps.

Is there any way to repair those documents showing the "error status" and What will be the source of the "Error" status? I checked the error profile of the K2 .net service manager and there is no error log showing for these particular instances. Since these instances came through a lot of steps it is difficult to recreate the forms also.

Can anyone suggest me a way for repairing these documents please.

Warm Regards,
Sareesh

1 reply

Badge +1
Managed to solve the problem, The problem was with the start rule of an event, the users entered an invalid date format and I developed a utility for correcting the dates using the K2ROM and K2Utilities class.

You can update the XML field of a process instance using these and repair the error using the error log.

Here is the code sample I used:

SourceCode.K2ROM.Connection myConnection = new SourceCode.K2ROM.Connection();
SourceCode.K2ROM.ProcessInstance pi;

//Update these variables to appropriate values
//The procID and date will be different for each process instance in error log
int procID = 436;
string newDateTime = "01/15/2007";
string k2server = "k2Server";

myConnection.Open(k2server);
try
{
pi = myConnection.OpenProcessInstance(procID);
//pi.XmlFields["XMLDTTest"].Value = pi.XmlFields["XMLDTTest"].MetaData;
pi.XmlFields["XMLDTTest"].Value = SourceCode.K2Utilities.XMLFieldMod.SetXMLValue(pi.XmlFields["XMLDTTest"].Value, "Root/OldDateTime", newDateTime);
pi.Update();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message.ToString());
}

Reply