I'm trying to create a simple workflow containing a while in which you can find : createtaskwithcontenttypes while Ontaskchanged completetask
When I try to launch the workflow by adding a new item to my associate list, I find myself with a "Error occured". So I tried to debug a little and found out that the error was on the ontaskchanged event receiver. But the only thing it does is leaving the workflow. I have no error message or whatever.
So I've looked upon the internet, and found out some similar problem. But I guess I didn't find mine, or I didn't understand what it was about !
Here is my create task method :
private void createTaskWithContentType1_MethodInvoking(object sender, EventArgs e)
{
TaskProperties = new SPWorkflowTaskProperties();
TaskId = Guid.NewGuid();
TaskProperties.Title = Title;
TaskProperties.Description = DescriptionName;
TaskProperties.DueDate = DueDate;
TaskProperties.AssignedTo = this.Approver;
TaskProperties.PercentComplete = 0;
TaskProperties.StartDate = DateTime.Today;
}
Here is my while code condition :
private void WaitResponse_Invoke(object sender, ConditionalEventArgs e)
{
e.Result = !isFinished;
}
Here is the invoked method of my ontaskchanged event receiver (basically does nothing) :
private void WaitApproval_Invoked(object sender, ExternalDataEventArgs e)
{
}
Here are the after and before propertie : public static DependencyProperty WaitApproval_AfterPropertiesProperty =
DependencyProperty.Register("WaitApproval_AfterProperties", typeof(Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties), typeof(ActivityLibrary.EtapeOuiNon));
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
[BrowsableAttribute(true)]
[CategoryAttribute("Misc")]
public Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties WaitApproval_AfterProperties
{
get
{
return ((Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties)(base.GetValue(ActivityLibrary.EtapeOuiNon.WaitApproval_AfterPropertiesProperty)));
}
set
{
base.SetValue(ActivityLibrary.EtapeOuiNon.WaitApproval_AfterPropertiesProperty, value);
}
}
public static DependencyProperty WaitApproval_BeforePropertiesProperty = DependencyProperty.Register("WaitApproval_BeforeProperties", typeof(Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties), typeof(ActivityLibrary.EtapeOuiNon));
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
[BrowsableAttribute(true)]
[CategoryAttribute("Misc")]
public Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties WaitApproval_BeforeProperties
{
get
{
return ((Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties)(base.GetValue(ActivityLibrary.EtapeOuiNon.WaitApproval_BeforePropertiesProperty)));
}
set
{
base.SetValue(ActivityLibrary.EtapeOuiNon.WaitApproval_BeforePropertiesProperty, value);
}
}
For information the correlation token is the same everywhere. Also all of this part of my workflow are in a separate activity.
So if someone has an idea of what it could be ! Thanks a lot !