我在运行工作流程以重新激活已取消或已完成的QueueItem时遇到问题。工作流程仅是将记录状态更改为:重新激活队列项目。当我在任何队列项目上运行此工作流时,它将返回并显示错误消息:
The queued entity instance does not allow associated queue item to be activated in its current state.
我更新了工作流程,以首先包括检查QueueItem Status Reason是否在[Canceled; Completed]中。然后以相同的结果调用更改记录状态。
我还有另一个工作流程,将QueueItem设置为Completed(工作正常),唯一的区别是对Active与Completed / Canceled的状态检查。
这是该错误的堆栈跟踪(但不是很有帮助)。
Plugin Trace:
[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.SetState]
[SetStateStep7]
Error Message:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The queued entity instance does not allow associated queue item to be activated in its current state.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ActivityId>47401963-9bd2-4668-93f6-db26bcbfdf93</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>The queued entity instance does not allow associated queue item to be activated in its current state.</Message>
<Timestamp>2018-08-10T14:17:29.4038347Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>47401963-9bd2-4668-93f6-db26bcbfdf93</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>The queued entity instance does not allow associated queue item to be activated in its current state.</Message>
<Timestamp>2018-08-10T14:17:29.4038347Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>47401963-9bd2-4668-93f6-db26bcbfdf93</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d4p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>System.InvalidOperationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #E7D606B6</Message>
<Timestamp>2018-08-10T14:17:29.4038347Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<OriginalException i:nil="true" />
<TraceText>[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.SetState]
[SetStateStep7]
</TraceText>
</OrganizationServiceFault>
at Microsoft.Crm.Workflow.Services.SetStateActivityService.Execute(ActivityContext executionContext, SetState setState)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
有人经历过此事,还是知道为什么此工作流程失败?