Why is infinite loop protection being triggered on my CRM workflow?

前端 未结 2 1291
旧巷少年郎
旧巷少年郎 2021-02-09 02:56

Update

I should have added from the outset - this is in Microsoft Dynamics CRM 2011


I know CRM well, but I\'m at a loss to explain behav

相关标签:
2条回答
  • 2021-02-09 03:40

    For the one hour "reset" to take place you have to have NO activity for an hour. It doesn't reset just 1 hour from the original. So since you have an activity every 15 minutes, it never has a chance to reset. I don't know that is said in stone anywhere... but from my experience.

    In CRM 4 it was possible to create a CRM Service (Google creating a CRM service in the child pipeline) and reset the correlation ID (using CorrelationToken.NewToken()). I don't see anything so easy in the 2011 SDK. No idea if this trick worked in the online environment. Is 2011 online backwards compatible with CRM 4 plug-ins?

    One thing you could try would be to use the IExecutionContext.CorrelationId to scavenge the asyncoperation (System Job) table. But according to the metadata, the attribute I think might be useful (CorrelationId, CorrelationUpdatedTime, Depth) are NOT valid for update. Maybe you could delete the rows? Even that may not help.

    0 讨论(0)
  • 2021-02-09 03:53

    I doubt this can be solved like this.

    I'd suggest a different approach: deploy a simple application alongside CRM and let it call the web service, which in turn can use the XRM endpoints in order to change the records.

    UPDATE

    Or, you can try something like this upon your crm service initialization in the plugin (dug it up from one of my plugins) leaving your workflow untouched:

    CrmService service = new CrmService();
    //initialize service here, then...
    
    CorrelationToken newtoken = new CorrelationToken();
    newtoken.CorrelationId = context.CorrelationId;
    newtoken.CorrelationUpdatedTime = context.CorrelationUpdatedTime;
    
    // WILD GUESS: Enforce unlimited depth ?
    corToken.Depth = 0; // THIS WAS: context.Depth;
    
    //updating correlation token
    service.CorrelationTokenValue = corToken;
    

    I admit I don't really remember much about this (code dates back to about 2 years ago), but it might help.

    0 讨论(0)
提交回复
热议问题