I hope I am not subverting the design of these things by attempting this, but here is what I am attempting:
a) I have a server event that's invoking a WCF service (this may happen asynchronously using MSMQ, so there's no guarantee of an immediate response).
b) The server event has two "Outcomes": success and failure
c) These outcomes result in lines leaving the activity, which have rules which assess the value of a datafield within the activity, called "Outcome". In this way, it's a direct mimic of the default client event (except without the actions, only outcomes).
d) When it's done what it was doing, the WCF service "calls back" through a generic service with the final result of the call (success / failure).
What I am missing is the ability to tell the activity instance which outcome has occurred. Is there a way to do this through the K2 Client namespace? I appear to be able to set values of datafields for the subsequent activity, but not "this" activity. I am not even sure, though, whether simply setting the value of the "Outcome" datafield will be enough to trigger the lines flowing from the activity or whether I will need to tell the activity it's "Complete".
I hope this is not too convoluted or off the beaten track. I wonder if I should be using a client event instead. That would afford me access to actions, which seem to be quite easy to trigger in code...