I am in the process of writing a server-side event wizard (code) and I'm at the point where I want my activity to have a number of actions outcomes coming out of it (success / failure, for example).
Looking at the default client event, it appears to do the following:
a) Create a data field called "outcome"
b) Create actions, as per user entered data
c) Create a line corresponding to each action
d) Put a rule on each line checking "outcome" to determine if the corresponding action has been taken.
Now, I can create the data field in code in the wizard, like so:
if (!base.Event.Activity.DataFields.Contains("Outcome"))
{
DataField outcome = new DataField("Outcome", "");
outcome.Category = "Outcomes";
base.Event.Activity.DataFields.Add(outcome);
}
Attempting to create actions, like so, results in the error "only client events can have actions"
if (!base.Event.Actions.Contains("Success"))
{
EventAction success = new EventAction();
success.Name = "Success";
base.Event.Actions.Add(success);
}
if (!base.Event.Actions.Contains("Failure"))
{
EventAction failure = new EventAction();
failure.Name = "Failure";
base.Event.Actions.Add(failure);
}
Also, creating lines & linerules looks to be impossible since those are abstract classes.
So, I am at a bit of a loss. How do I have multiple paths leading out of my server event based on the results of said server event execution?
Thank you
