There is a way to access the K2 API from blackpoint, although I will make the disclaimer that this is not supported in blackpoint. I will go over the steps of calling the GoToActivity method of the API from a reference event within the K2 designer for K2 blackpoint.

Within K2 designer, you will need to drag a reference event onto the workspace. k2referenceevent

 

Configure an event name for the event, and after clicking next, you will come to a screen within the wizard to add a Constructor.

k2referenceevent_addevent

The next wizard you will want to click the "Add Reference” button and browse to “C:\Program Files (x86)\K2 blackpoint\Bin\SourceCode.Workflow.Management.dll” (if using a 64bit server). Select this DLL and add it to the list of available managed process references.

 

k2referenceevent_addref Click finish and then on the wizard where you select the constructor, expand the nodes as follows:

SourceCode.Workflow.Management
– SourceCode.Workflow.Management 
     – WorkflowManagementServer 

select Constructor(String host, UInt32 port).

k2referenceevent_addeventwms

 

For the configuration properties of the constructor, enter the following:

host: value is the server name of K2
port: value is the port that the K2 server is running on (typically 5555)

k2referenceevent_addeventwms_b

Once this constructor has been added, you will be brought back to the main wizard screen for the reference event and now it will allow you to add a Method event.

k2referenceevent_addmethodevent

After you click the add method option, you will need to expand the WorkflowManagementServer node and scroll down and find the method Open()

 

k2referenceevent_open Select Next and leave the default values for the configure properties and click Finish

Once more on the reference event main screen, click Add Method and expand out WorkflowManagementServer and find the method GoToActivity(Int32 procInstID, String activityName) : Boolean

k2referenceevent_goto

After clicking next, you will need to configure the method. The only values you need to worry about populating are the procInstID and activityName.

procInstID – identifies the K2 process ID that you want to perform the GoToActivity method request. This values can be accessed many different ways. For my example, I stored the K2 process ID of my workflow in a SharePoint list and I called this workflow on the update of the list item (using the SharePoint event integration process within K2) and stored the ID in a data field.

activityName – this field refers to the Activity in question that you want to “Go To”. If you reference the correct process ID, you can call an activity in any K2 process as long as you have the activity name correct.

Click Next after configuring these 2 values, leave the connection properties as default (empty) and click Finish

     k2referenceevent_gotoconfigure
k2referenceevent_finish

At this point, you are done configuring your Reference event and it should look like the screenshot to the left. Click Finish and you are done with the reference to the K2 API. Build and Deploy your process and test it out.