I am in the process of migrating a solution with workflows from EPiServer 6 to 7. In my workflow one of the activities creates a task and I get an entry in tblTask table. However this task is not being displayed in Edit mode->Tasks gadget. I also tried Task.List(HttpContext.Current.User.Identity.Name) and it lists all the tasks from the table. Any ideas why this might be the case?
Have you tried doing a network trace via Developer Tools when opening the Tasks gadget? Maybe some errors will get logged that may provide hints. And is this 7/7.1 or 7.5 site (just to make sure since you mentioned upgrade from 6 to 7).
Firebug show that request is sent to:
which both return this:
And that's it - no further info on net/js console. Only the "Recently Changed" tasks are displayed, but they do not seem to be read from tblTask table.
As for the version: the EPiServer.dll referenced in my project is version 220.127.116.11.
Doing a bit of research on this, the reason why views such as "My Tasks" are empty is because the list only fetches tasks from workflows. So in order for tasks to appear on the list, you'll need to start a workflow instance and then assign it to a task. So it seems that the gadget won't just list tasks from that table out of the workflow context.
What do you exactly mean by "workflow context"? The tasks that I have in tblTask were created by an activity inside a workflow (which has been started from code and is listed in running workflow instances). How do I specify that the task I create using CreateTask activity (I cannot check the exact name right now) should be associated with a workflow. BTW, it worked ok in CMS 6.
And one more thing: the WorkflowInstanceId column contains Guid of workflow instance from InstanceState table.
Unfortunately, I'm not too familiar with the task/workflow implementation. Perhaps someone else here will be able to clarify this, otherwise, feel free to submit a support ticket and we'll investigate this further.
Has there been any progress on this? I have a similar problem (please see my recent post).
Yes, but thanks to decompiler rather than EPiServer support. In epi7 each task needs to be assigned to a page - in tasks gadget pages are listed, not tasks (as was the case in epi6) therefore you need this line when creating a task:
Of course PageReference.RootPage can be changed for any other page reference.
It works! Thanks a million Tomasz. I can't accept your answer as correct since it's not my thread; if you post the same answer to my question I'll accept it; this may help someone else and give you those valuable fake internet points ;-)
my question is here:
Another strange thing about tasks: I assumed that the person who would see the task in the "My Tasks" section was the AssignedTo, but it seems instead to be the Owner of the task who sees it. Does this make any sense? Plus, it seems that the Owner cannot be a group. So, how can I create a task that more than one person will see as 'to do'?
OK I finally realized that if you set AssignedTo to a group you have to set AssignedIsRole to true.