cancel
Showing results for 
Search instead for 
Did you mean: 

Updating Document Type

Carlos_Guerra
Champ in-the-making
Champ in-the-making

Hi, Im trying to change a document type for a Document, with this code(Unity Client Script):

lockInfo = doc.LockDocument();   if (lockInfo.Status == DocumentLockStatus.LockObtained)  {             DocumentType docType = docList.Find("XXXXXXXXXXXXXXX");             ReindexProperties reindexProperties = storage.CreateReindexProperties(doc, docType);             Document newDocument = storage.ReindexDocument(reindexProperties);}lockInfo.Release();
 
 

but I'm getting a C# Exception "The operation has timed out", from Onbase I'm getting

System.Net.WebException: The operation has timed out    at System.Net.HttpWebRequest.GetResponse()    at Hyland.Types.OptimizedSoapServiceClient.ExecuteCore(RequestList requestList, Action`1 action)    at Hyland.Types.SoapServiceClient.Hyland.Types.IServiceClientInternal.Execute(RequestList requestList, Action`1 action)    at Hyland.Types.SoapServiceClient.Execute(IRequestList requestList)    at Hyland.Unity.Client.Runtime.ScriptExecutor.detachDocumentListener(String documentEventID)    at Hyland.Unity.Client.Runtime.ScriptExecutor.ExecuteClientScriptOnDocuments(Int64 operationID, Int64[] documentIDs)    at Hyland.Unity.Client.Runtime.ScriptExecutor.ExecuteClientScriptOnDocuments(Int64 operationID, Int64[] documentIDs)    at Hyland.Unity.Client.Runtime.UnityExecutor.ExecuteClientScriptOnDocuments(Int64 operationID, Int64[] documentIDs)    at Hyland.Canvas.Controls.ClientScript.ClientScriptController.Execute(Int64 operationID, Int64[] documentIDs, String taskName, String documentName)    at Hyland.Canvas.Controls.Commands.ClientScript.ExecuteScriptProgressDialog.OnContentRendered(EventArgs e)

How can I solve this?, thanks

 

Regards,

 

 

4 REPLIES 4

Michael_Aleman
Champ in-the-making
Champ in-the-making

Hi Carlos,

 

Make sure the doctype object you created is the one referenced in the Reindex operation as in your pasted code, they are different:

 

Regards,

Mike

Carlos_Guerra
Champ in-the-making
Champ in-the-making

Sorry is the same, I just wrote it wrong when was copying message  it would be docType in both cases.

Thanks,

 

 

Andrew_Matson
Champ in-the-making
Champ in-the-making

There are 2 things I would check/change:

  1. Check the default lifecycle that is configured for the document type that you're reindexing to, and make sure that there is no Core-workflow incompatible logic there.
  2. I would just switch the lock to a using statement, as a best practice. That way you don't need to manage the lock in the case of an exception.
using (DocumentLock docLock = doc.LockDocument()){	if (docLock.Status == DocumentLockStatus.LockObtained)	{		DocumentType docType = docList.Find("XXXXXXXXXXXXXXX");		ReindexProperties reindexProperties = storage.CreateReindexProperties(doc, docType);		Document newDocument = storage.ReindexDocument(reindexProperties);	}	else	{		throw new Exception(String.Format("Could not lock document {0}.", doc.ID));	}}

Patrick_Ramser
Star Contributor
Star Contributor

Hey Carlos,

Were you ever able to find a solution to this issue? I'm interested to see.