locked
IAsyncResult event problem on wf tracking data RRS feed

  • Question

  • hi there,i'm tryin to create a wf sample like the one in the wf-wcf examples (Hiring Request Process)..

    In custom tracking data codes, i am not able to save tracked data on db,because my code doesn't call IAsyncResult event.

    protected override void Track(TrackingRecord record, TimeSpan timeout)
            {
                // get the custom record       
                CustomTrackingRecord customRecord = (CustomTrackingRecord)record;
                string wfInstanceId = customRecord.Data["WorkflowInstanceId"].ToString();
                //VacationRequestId
                // create the request history record
                historyRecord = new Q2F_RECORD_HISTORY();
                historyRecord.WorkflowInstanceId = wfInstanceId;
                historyRecord.WorkflowId = GetStringFromTrackingRecord("WorkflowId", customRecord.Data);
                historyRecord.RecordNumber = (int)(record.RecordNumber);
                historyRecord.Action = GetStringFromTrackingRecord("Action", customRecord.Data);
                historyRecord.SourceState = GetStringFromTrackingRecord("State", customRecord.Data);
                historyRecord.Comment = GetStringFromTrackingRecord("Comment", customRecord.Data);
                historyRecord.EmployeeId = GetStringFromTrackingRecord("ActionerId", customRecord.Data);
                historyRecord.EmployeeName = GetStringFromTrackingRecord("ActionerName", customRecord.Data);
                historyRecord.Date = GetDateFromTrackingRecord(customRecord.Data);
            }
    after these tags it  continues to flow acording to flowchart.

    but in hiring process example it passes to the

      protected override IAsyncResult BeginOnSave(IDictionary<System.Xml.Linq.XName, object> readWriteValues, IDictionary<System.Xml.Linq.XName, object> writeOnlyValues, TimeSpan timeout, AsyncCallback callback, object state)
                {
                    this.Participant.Save();
                    return base.BeginOnSave(readWriteValues, writeOnlyValues, timeout, callback, state);
                }

    what might i be doing wrong,why is not my code calling iasyncResult,thanks !!!

    btw web.config params are all the same as on the hiring process.
    Thursday, February 18, 2010 10:14 AM

Answers

  • Hi there.
    The first method, Track, is from a TrackingParticipant which will get called upon a tracking event.
    The second method, BeginOnSave, looks like it belongs in a PersistanceIOParticipant class which will get call upon a Persistance event.

    I'm not sure what you're trying to track but if it's the custom Record then the PIOP is not what you want.  I would suggest looking at the WF_WCF_Samples\WF\Basic\Tracking\SqlTracking sample in the SDK

    Thanks!
    Scott
    MS Developer Support
    Friday, February 19, 2010 4:29 AM

All replies

  • Hi there.
    The first method, Track, is from a TrackingParticipant which will get called upon a tracking event.
    The second method, BeginOnSave, looks like it belongs in a PersistanceIOParticipant class which will get call upon a Persistance event.

    I'm not sure what you're trying to track but if it's the custom Record then the PIOP is not what you want.  I would suggest looking at the WF_WCF_Samples\WF\Basic\Tracking\SqlTracking sample in the SDK

    Thanks!
    Scott
    MS Developer Support
    Friday, February 19, 2010 4:29 AM
  • Thanks Scott.
    It is a custom record data. I was trying to use savetrackinginfo code activity which is included in hiring request sample.Track is called upon a tracking event but after track method,it doesn't jump into a save method of that tracked data...

    I'll look at sqltracking sample so,if i have any problem ,i'll come back again. 
    Thanks :)
    Friday, February 19, 2010 6:14 AM