Hi,
I am trying to develop a custom activity for my sharepoint workflow that would simplify some things. Within it I create a task, log, set a custom workflow status (setState) and some other things.
The problem I have is with the setState activity which needs the workflowToken that is available in main workflow only. I've found the following blog post: http://blog.sharepoint.ch/2009/11/how-to-set-correlation-token-property.html that explains how to create a property that you can then assign workflowToken to and that works well, however I don't know how can I then set this token that I receive to the setState activity?
In designer it looks that I can't and when I tried to do programmatically like this:
private void setState_MethodInvoking(object sender, EventArgs e)
{
SetState s = (SetState)sender;
s.CorrelationToken = WorkflowToken;
}
in the invoking call I get the following error:
This operation can not be performed at runtime. at System.Workflow.ComponentModel.DependencyObject.SetValueCommon(DependencyProperty dependencyProperty, Object value, PropertyMetadata metadata, Boolean shouldCallSetValueOverrideIfExists)
at System.Workflow.ComponentModel.DependencyObject.SetValu
Any ideas?