Skip to main content

I am running K2 BlackPearl 0803 (can't yet upgrade to 0807).  I have a Workflow, SmartObject and Web Service that controls my workflow, and SharePoint that stores the configuration details.   


I have a SmartObject that stores a uniqueId, WorkflowId, DataOwner, DataName, TimeToEscalate in it. This SmO is populated by reading from a SharePoint List (it does this as it needs a snapshot of the data which can't be changed for the process of the workflow).
My issue is that at a point in the workflow I need to create an Activity for each instance of the SmO records where WorkflowId=n. So if there are 6 rows in the SmO that matches that criteria, I need to create 6 instances of the Activity, assign the Activity to the DataOwner.
When each DataOwner completes their assigned task, it needs to run through some business logic. I need to know which Task was completed (DataName field), based on that, the workflow needs to decide whether a child workflow(s) needs to be launched.
1 DataOwner may be responsible for multiple DataNames, therefore may receive multiple tasks. Each DataName can be associated with another SmO, based on that association it may kick off a child workflow.

Essentially, I need to catch the Action Event that completes each Activity, run the business logic, and launch a child process if required. The other issue I have, is that I cannot get the DataName of the Event being fired on complete, and cannot even get the AssignedUser (it's reading blank).  The Activity is not successfully reading from the SmO in the traditional sense, I have broken open the Destination Event and created code to assign users to the Activity.  As each user completes their task, I have no way of knowing who completed the task, as when I catch that event, the user information is blank, and also, I can't get any Activity Instance information as I am unsure where this would be assigned. 

How do I go about this. Read from SmO to create multiple instances of an Activity, catch each Action Completed and fire off another event (this part here I can do from a Web Service that we have created, but we don't have any information being parsed other than the Serial Number and Name of the Activity & Event.)

All right, I'll take a stab at this.  You can create an activity that uses destination rules to create an instance of that activity for each item returned by a smart object method.  To do this, drag out an activity and click the 'Destination Rule' icon.  Back up a screen to select 'advanced mode' and click 'next'.  Select 'Plan Per Slot (no destinations)' and click 'next'.  Tick the 'Select a list field to determine how many slots should be created', and within that field specify the 'get list' method of your smart object, including the workflow Id parameter in the query (use the object browser to drill down into SmartObject Servers and then down to your smart object).


This activity will need to utlize an IPC to handle creating the activity for a specific user (your data owner) and reacting to the action that the data owner took on the task.  I hope that helps, I can certainly go into more detail if this seems to be on the right track.


Reply