In all the available application samples I browsed the CorrelationInitializer is always attributed to a method, and not to an event. Is there a reason for this
The usual is something like:
[ExternalDataExchange]
[CorrelationParameter("nextStage")]
public interface ISMConnector
{
[CorrelationAlias("nextStage", "e.Command")]
event EventHandler<RegEventArgs> OwnerInfoSubmitted;
[CorrelationInitializer()]
void SMSnapshot( string nextStage);
}
I had originally thought of doing something more like:
[CorrelationParameter("WorkflowInstanceId")]
[ExternalDataExchange]
public interface ICaseManagementLocalService
{
[CorrelationInitializer]
[CorrelationAlias("WorkflowInstanceId", "e.Case.WorkflowInstanceId")]
event EventHandler<CaseEventArgs> CaseCreated;
[CorrelationAlias("WorkflowInstanceId", "e.Case.WorkflowInstanceId")]
event EventHandler<CaseEventArgs> CaseUpdated;
}
Is there a problem with defining the CorrelationInitializer as an event (I'm having problems with this approach).
thanks,
GLR

CorrelationInitializer question
bmains
ImagineNation
BABU_NEO
This happens when I execute this piece of code to test the wf:
CaseData cd = GetDummyCaseData();
CaseManager manager = new CaseManager();
//raises CaseCreated event
string instanceid = manager.OpenNewCase(caseData);
caseData.WorkflowInstanceId = instanceid;
But I'm not paying much attention to the exception because I know things are already inconsistent before I get the exception.The state machine defined looks like this, and the initial state is something like this.caseData.CaseStatus = "Assigned";
caseData.AssignedTo = "technician";
//raises CaseUpdated event
manager.UpdateCase(caseData, "dispatcher");
When I raise the CaseCreated event, I know the handleExternalEventActivity1_Invoked handler gets invoked, because it writes in the EventLog, but the second activity (PersistCaseData, the code activity) never gets executed.
Persistence service is enabled, if I look at the persistence database, each time I run the test code, a new row appears in the WorkflowInstance table. So I guess It's just unloading on idle somewhere, but I don't get why, and why it just doesn't run the code activity and continue to the next state.
Any hint will be appreciated,
thanks,
GLR
Kangaroo_Marco
Yes to state machine - dont' remember if I was using persistence.
Are you getting exceptions
Mosesm
THANKS!!
Floubadour
Jon,
In your case, were you working with a state machine workflow was persistence enabled
thanks,
GLR