Data Manipulation event template

  • 11 December 2007
  • 9 replies
  • 0 views

Badge +3

One of the most frequently used events I used in k2 2003 was the data manipulation event.  Where has this gone in Blackpearl? Same with the SQL and Web Service event templates?


 Thanks,


Jason


9 replies

Badge +9

Unfortunately there are no udpated blackpearl wizards to these K2.net 2003 templates.  However these K2 2003 event templates will be able to be used within a blackpearl process in an upcoming blackpearl release.

Badge +3
Thanks for the reply.  Can you recommend a way I could achieve the same functionality as the data manipulation event in Blackpearl?  I'm trying to copy an activity value into a data field to be used in a line rule at a later stage.  In 2003, this would be trivial using the data manipulation event but I am pulling my hair out trying to figure out how to do this in BlackPearl..
Badge +9
Are you trying to copy an Activity level data field to a Process level data field or are XML or combinations of XML / data fields being used?
Badge +3

In one case I am just trying to copy and activity level data field to a process data field to be used in a later line rule.  In another case, I just want to set a data field's value to False (default is true) if the workflow goes down a certain path.  Was easy to do with the data manipulation template in 2003.


 


Thanks,


Jason

Badge +9

Until the K2.net 2003 Data Manipulation event wizard is supported in blackpearl, you'll need to use code within a Server Event.


To copy an Acitivty Data Field to a Process Data field:


  K2.ProcessInstance.DataFields["SomeField"].Value = K2.ActivityInstanceDestination.DataFields["SomeField"].Value ;


To set a process datafield to true:


  K2.ProcessInstance.DataFields["SomeField"].Value = true;


HTH.

Badge +10
Nice post Bob.  Good info
Badge +3

This is a big help, but I can't seem to get a handle to the user name of the destination user.  The line of code below generates an "Object reference not set to an instance of an object" error:


K2.ProcessInstance.DataFields[

"ComplianceApprover"].Value = K2.ActivityInstanceDestination.User.Name;


I know the left side is correct because if I do this, everything is fine:


K2.ProcessInstance.DataFields["ComplianceApprover"].Value = "Me";

Badge +9

Blackpearl introduces some new concepts around Activity destinations.  If you open up the destination rule then click "Back" you should see an option to run in Advanced mode.  Check this and then click next.  At this point you should be presented a set of options.  By default "Plan just once" is selected.  This means that no matter how many people will be allowed to view the task, only on instance of the activity is created.  This is different than K2.net 2003 where the default behavior was to create a physical instance for each destination user.


This can greatly improve scalability as well as allows us to my dynamically control assignment and viewing of tasks.  However it means that the K2 definition loses individiual user context (i.e. the K2.ActivityInstanceDestination.User).  If you absolutely need this user context then you can simply select "Plan per Destination (All at Once)" which operates exactly as K2.net 2003 did and thus you will access to the K2.ActivityInstanceDestination.User object.


This advanced destination functionality is quite powerful.


HTH.


 

Badge +3

That's helpful.  I understand the need to dynamically control assignments.  But ultimately, only one user actually performs the Activity.  Once that activity is performed, is there a way to determine who it was and use that information later in the workflow?

Reply