Skip to main content
Nintex Community Menu Bar

How to raise an event after Initialize but before Completed.?

  • October 8, 2008
  • 5 replies
  • 21 views

Forum|alt.badge.img+2

Hi!


I got my workflow sample with start activity, myClientActivity and my Server finish event.


I need to raise a specific method AFTER "Initialize" execution, but BEFORE "Completed" execution.


I don't know how (and where) to put that method in the .xoml.cs file.


 


Can u help me?


Thanks a lot!

5 replies

Forum|alt.badge.img+11
  • October 8, 2008

I haven't had my second cup of coffeet yet, so maybe I am just not awake.  I have no idea what you are talking about.


Could you provide some more details of what you are trying to do?


Forum|alt.badge.img+2
  • Author
  • October 9, 2008
:-D

Forum|alt.badge.img+2
  • Author
  • October 9, 2008

:-)


Right...right...i'll explain with more accuracy my problem...follow me, i'm a newbie!


I've modified the "Default Client Event" adding 2 more pages: Activity Metadata and Process Status.


I've created 2 properties:


private

K2Field _activityMetadata;


public K2Field ActivityMetadata


{

get {


if (_activityMetadata == null)


{


this.ActivityMetadata = new K2Field(this);


}


return _activityMetadata;


}


set { base.OnNotifyPropertyChanged<K2Field>("ActivityMetadata", ref _activityMetadata, value); }


}


 


private

K2Field _processStatus;


public K2Field ProcessStatus


{

get { if (_processStatus == null)


{


this.ProcessStatus = new K2Field(this);


}


return _processStatus;


}


set { base.OnNotifyPropertyChanged<K2Field>("ProcessStatus", ref _processStatus, value); }


}


Then i've created my Workflow (called ExtendedClientTest) with Start Activity, myModifiedClientEvent and a "Finish Server Event".


In "myModifiedClientEvent" Wizard, i've added 2 Datafields under ExtendedClientTest activity, called "Description" (start value: MetadataTest) and "Status" (start value: Attivissimo).


I've builded and deployed it: it runs.


I've open K2 Workspace and started an Istance of that Process.


In the .xoml.cs file i've added this Initialize method:


K2.ActivityInstanceDestination.ActivityInstance.DataFields[

"Metadata"].Value = K2.Configuration.ActivityMetadata;


K2.ActivityInstanceDestination.ActivityInstance.DataFields[

"ProcessStatus"].Value = K2.Configuration.ProcessStatus;


 


Here is the problem: when i check the Datafield in the Management Console here is the result:


http://img353.imageshack.us/my.php?image=datafieldsdl6.jpg


I would that values ("TestMetadata" and "Attivissimo") in Activity Instance values...how to do that?


:-(


Forum|alt.badge.img+11
  • October 9, 2008

What you're doing is certainly...interesting. 


In looking at your code sample and your description, it appears to me the result you are seeing is exactly what you have coded.  You are setting your activity datafields to the value that was stored in the configuration by the wizard and that appears to be the value you are seeing in the management console.  If you want the datafield to retain the initial start value then don't assign a value to them in code.


 Apologies if I am missing the point.


David


Forum|alt.badge.img+2
  • Author
  • October 9, 2008
So, you're telling me i've to delete that "initialize" method?