using ActivityInstanceDestination status

  • 18 February 2008
  • 1 reply
  • 0 views

Badge +7

Hi

I would like to check whether an activity has been completed before sending an escalation email. The default behaviour in an escalation seems to be to email everyone, even if they have already completed their activity.

The ActivityInstanceDestination.Status enumeration is not documented in the K2 help.

How can I check if this value is "Completed" before sending the email?

I would have thought this would work:

     ActivityInstance oActInst = K2.ActivityInstance;
    foreach(ActivityInstanceDestination oActDest in oActInst.Destinations)
    {
        if(oActDest.Status != ActivityInstanceDestination.Status.Completed)
        {
            //Email code here
        }

But it does not - I get:

 Compile Error: Send Reminder to Register Decision(EscAction) Line 14: An object reference is required for the nonstatic field, method, or property 'SourceCode.KO.ActivityInstanceDestination.Status.get'
Compile Error: Send Reminder to Register Decision(EscAction) Line 14: Static member 'SourceCode.KO.ActInstDestStatus.Completed' cannot be accessed with an instance reference; qualify it with a type name instead

Cheers, Richard 


 


1 reply

Badge +7

Changed to

 if(oActDest.Status != SourceCode.KO.ActInstDestStatus.Completed)

And it works like a charm. 

Reply