locked
Error loading workflow services RRS feed

  • Question

  • Hello,

    I'm developing a service library using the new wf 4.0 and one of my requirements is that some activities have the ability to be resumed by a client, so i created a wcf resume service that could load a workflow definition and resume a bookmark of that workflow.

    One of the services i created was a flowchart that has a receive reply activites inside a sequence activity has a start point, after that i have another sequence that have another sequence, yes 2 sequence activities, and my custom activity that needs to be resumed by a client.
    The 2 nested sequence activites was a something i used only for testing, but if i had those 2 sequence activities nested i got an error when loading that workflow definition in my resume service:

    'ObtemPareceres' is not of type 'Sequence'. When loading this instance you must ensure that the activity with name 'ObtemPareceres' implements 'Sequence'.

    The "ObtemPareceres" is my custom activity, and if i remove that second nested sequence everything works fine.

    Anyone has any idea of whats going where?

    thanks

    Frederico Regateiro
    Monday, March 1, 2010 11:44 AM

Answers

  • These types of errors typically  happen when you resume a workflow after changing the workflow definition. WF4 is not able to handle runtime changes to the workflow definition. In practice this means you have to clean out the persistence database a lot while developing your workflow, I keep a short batch file handy for this purpose.
    • Marked as answer by fregateiro Tuesday, March 2, 2010 2:58 PM
    Monday, March 1, 2010 4:33 PM

All replies

  • These types of errors typically  happen when you resume a workflow after changing the workflow definition. WF4 is not able to handle runtime changes to the workflow definition. In practice this means you have to clean out the persistence database a lot while developing your workflow, I keep a short batch file handy for this purpose.
    • Marked as answer by fregateiro Tuesday, March 2, 2010 2:58 PM
    Monday, March 1, 2010 4:33 PM
  • After i debuged my service i could see that the definition was'nt sync with my workflow service.

    Thanks a lot.
    Frederico Regateiro
    Tuesday, March 2, 2010 3:02 PM
  • Just in case somebody else finds this thread, here is a SQL script that will clean up your persistence DB.

    set nocount on
    
    declare @InstanceId uniqueidentifier
    declare @SurrogateInstanceId bigint
    
    declare csr cursor fast_forward for
    	select InstanceId from [System.Activities.DurableInstancing].Instances
    
    open csr
    fetch next from csr into @InstanceId
    
    while @@fetch_status = 0
    begin
    	(
    		select @SurrogateInstanceId = SurrogateInstanceId
    		from [System.Activities.DurableInstancing].InstancesTable i
    		where i.Id = @InstanceId
    	)
    
    	execute [System.Activities.DurableInstancing].DeleteInstance @SurrogateInstanceId
    
    	fetch next from csr into @InstanceId
    end
    
    close csr
    deallocate csr
    

    • Proposed as answer by Md Jawed Sunday, June 7, 2015 7:45 PM
    Thursday, January 12, 2012 1:45 PM