Al revisar los logs, se ve que la entidad no finalizo, porque el workflow dió un error que se grabó en la bitácora, al momento de terminar la instancia y antes de enviarla a finalización. Por eso es que no generó un registro en la tabla de procesos.
La excepción que se registró es un error de Timeout generado por SQL Server
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
Este error sucede cuando SQL Server no le responde a la aplicación en el tiempo pactado. Puede tener infinidad de causas, desde un problema de Deadlock hasta que el servidor estaba muy cargado de operaciones y no respondió en el tiempo que Evolution lo espera.
Se puede ampliar el tiempo de timetout, modificando los parámetros que existen a nivel de web.config del sitio del Workflow (en este caso fué el workflow el que mostró el error). Recuerde que no es que el proceso esté mal, sino que se superó el tiempo de espera por defecto configurado.
El mensaje completo del error es:
2017-12-15 11:25:09,283 [49] INFO Aseinfo.VH4.WorkflowServices.Services.AuthorizationWorkflowService - TerminarInstancia: 7b002435-54d1-432b-96f8-6c926143fc30
Exception:Aseinfo.Infrastructure.Base.Exceptions.AuthorizationWorkflowException: Sucedio un error en el flujo. Se está logueando el exception interno y luego se logueará el que terminará la instancia ---> System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext)
at System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary`2 identifierValues, List`1 generatedValues)
at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)
at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
at System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)
at Aseinfo.VH4.Data.AppDataContext.SaveChanges(SaveOptions options) in C:\vh4\VH4\Data\AppDataContext.cs:line 98
at Aseinfo.Infrastructure.Base.Entity.EntityServiceBase`2.SaveChanges() in C:\vh4\Infrastructure\Base\Entity\EntityServiceBase.cs:line 563
at Aseinfo.VH4.WorkflowServices.Services.AuthorizationWorkflowService.AutorizaInstancia(String codigoInstancia, Nullable`1 codigoExpedienteUsuario, String username) in C:\vh4\VH4\WorkflowServices\WorkflowServices\Services\AuthorizationWorkflowService.cs:line 639
at Aseinfo.VH4.WorkflowServices.Services.AuthorizationWorkflowService.FinalizaInstanciaRutaAutorizacion(Guid codigoInstancia, EstadoActividadInstancia estadoFinalizacion, Nullable`1 codigoExpedienteUsuario, String username, String entityServiceTypeName, String comentarioUsuario) in C:\vh4\VH4\WorkflowServices\WorkflowServices\Services\AuthorizationWorkflowService.cs:line 191
at Aseinfo.VH4.WorkflowServices.Services.AuthorizationWorkflowStaticService.FinalizaInstanciaRutaAutorizacion(Guid codigoInstancia, EstadoActividadInstancia estadoFinalizacion, Int32 codigoExpedienteUsuario, String username, String entityServiceTypeName, String comentarioUsuario, WorkflowContext context) in C:\vh4\VH4\WorkflowServices\WorkflowServices\Services\AuthorizationWorkflowStaticService.cs:line 234
--- End of inner exception stack trace ---
at System.Activities.Statements.MethodExecutor.InvokeAndUnwrapExceptions(Func`3 func, Object targetInstance, Object[] actualParameters)
at System.Activities.Statements.MethodResolver.SyncMethodExecutor.BeginMakeMethodCall(AsyncCodeActivityContext context, Object target, AsyncCallback callback, Object state)
at System.Activities.Statements.MethodExecutor.BeginExecuteMethod(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)