Consult functionality without creating an activity

  • 19 March 2008
  • 2 replies
  • 0 views

Badge +13

This is coming from typical K2 .NET 2003 design but I was wondering if this aspect has been improved in Black Pearl.

Example if there is a parallel route to 10 different activities (of different business unit), but each activity requires a consult action where we route to a consult activity (and the only option is to return to the activity that called it), but then we are creating 10 additional consult activities.    Could this somehow be simplified by using 1 consult activity?

I wouldn't able to use 1 activity with X number of Slots because I would never be able to route to the Consult activity w/o breaking the succeeding rule.

2 replies

Badge +9
How about an IPC event within your activity?  This can route to a child process which contains your consult activity.
Badge +13

Over the last few years I have simplified to 1 consult activity by using the following for K2 .NET 2003.


This works fine for process that does not need parallel routing.   I will try out the IPC event to see how it works in Blackpearl.    Returning from IPC event would need to go through the same activity again, a line that routes back to itself.


    Public Sub CheckConsult(ByVal K2 As ServerEventContext)

        If k2.ProcessInstance.DataFields("Action").Value = "Consult" Then
            k2.ProcessInstance.DataFields("LastActivity").Value = k2.ActivityInstanceDestination.Activity.Name
            k2.GotoActivity("Consult")
        End If       
    End Sub


 


In the Consult activity's server event it returns to the previous activity.


Sub Main(Byval K2 as ServerEventContext)
    K2.Synchronous = True
       
    k2.GotoActivity(k2.ProcessInstance.DataFields("LastActivity").Value)
End Sub

Reply