How to get Data Object (Properties) define in workflow from my Host?

Hello,

I have a problem for get information in my workflow instance.
For example I had created in my workflow define a public property (Client) the question is: How can I do to get this value in run time with sql tracking

I had added sqltrackingservice, sqlpersistenceservice
and a create a profile with tracking profile designer.



Answer this question

How to get Data Object (Properties) define in workflow from my Host?

  • Koelho

    Hi Tom,

    I found in msdn library a SqlTrackingQueryOptions's property named TrackingDataItems(for data extract values), if I understand good this property return a list of TrackingDataItemValue. And each one is a object that I must cast. In this case to Documento a class define for me.

    is it alright, isn't it

    Best Regards



  • fnacer

    < xml version="1.0" encoding="utf-16" standalone="yes" >
    <TrackingProfile xmlns="http://schemas.microsoft.com/winfx/2006/workflow/trackingprofile" version="1.0.0">
        <TrackPoints>
            <WorkflowTrackPoint>
                <MatchingLocation>
                    <WorkflowTrackingLocation>
                        <TrackingWorkflowEvents>
                            <TrackingWorkflowEvent>Created</TrackingWorkflowEvent>
                            <TrackingWorkflowEvent>Completed</TrackingWorkflowEvent>
                            <TrackingWorkflowEvent>Idle</TrackingWorkflowEvent>
                            <TrackingWorkflowEvent>Suspended</TrackingWorkflowEvent>
                            <TrackingWorkflowEvent>Resumed</TrackingWorkflowEvent>
                            <TrackingWorkflowEvent>Persisted</TrackingWorkflowEvent>
                            <TrackingWorkflowEvent>Unloaded</TrackingWorkflowEvent>
                            <TrackingWorkflowEvent>Loaded</TrackingWorkflowEvent>
                            <TrackingWorkflowEvent>Exception</TrackingWorkflowEvent>
                            <TrackingWorkflowEvent>Terminated</TrackingWorkflowEvent>
                            <TrackingWorkflowEvent>Aborted</TrackingWorkflowEvent>
                            <TrackingWorkflowEvent>Changed</TrackingWorkflowEvent>
                            <TrackingWorkflowEvent>Started</TrackingWorkflowEvent>
                        </TrackingWorkflowEvents>
                    </WorkflowTrackingLocation>
                </MatchingLocation>
            </WorkflowTrackPoint>
            <ActivityTrackPoint>
                <MatchingLocations>
                    <ActivityTrackingLocation>
                        <Activity>
                            <Type>Proceso.VentasAFacturacion, Proceso, Version=1.0.0.3, Culture=neutral, PublicKeyToken=null</Type>
                            <MatchDerivedTypes>false</MatchDerivedTypes>
                        </Activity>
                        <ExecutionStatusEvents>
                            <ExecutionStatus>Initialized</ExecutionStatus>
                            <ExecutionStatus>Executing</ExecutionStatus>
                            <ExecutionStatus>Canceling</ExecutionStatus>
                            <ExecutionStatus>Closed</ExecutionStatus>
                            <ExecutionStatus>Compensating</ExecutionStatus>
                            <ExecutionStatus>Faulting</ExecutionStatus>
                        </ExecutionStatusEvents>
                    </ActivityTrackingLocation>
                </MatchingLocations>
                <Extracts>
                    <ActivityDataTrackingExtract>
                        <Member>documentO</Member>
                    </ActivityDataTrackingExtract>
                    <ActivityDataTrackingExtract>
                        <Member>documentO</Member>   
                    </ActivityDataTrackingExtract>
                </Extracts>
            </ActivityTrackPoint>
        </TrackPoints>
    </TrackingProfile>

  • CityBird

    Please post your tracking profile. Samples for how to do this can be found here or here.

  • riti

    Silly question, did you save it to your tracking database The same one you used for the SqlTrackingService which was added to your workflow runtime What is document0 Is it a property or variable on workflow that is typeof(VentasAFacturacion) Using a similar workflow and tracking profile I found a tracking record for the Execute and Closed events for the variable I was tracking. Please send me your project if you are still unable to resolve this problem, my address can be found on my profile.



  • John Dunn

    Hi Tom,

    Yes, I did. I saved this profile to my tracking database.
    What is documentO It's a variable typeof(Documento) a class define for me.
    documentO is a instance of Documento's class.
    I'd like know value of "documentO" but I don't know how can I do get data in my host application.

    which is the method or class that you do used to obtain documentO




  • regthesk8r

    Correct, once you get the TrackingDataItem you are looking need to get the Data property and cast it to your type. Below is an example that assumes that the item you are looking for is the first item in the list:

    Documento document0 = (Documento)record.Body[0].Data;

    Take a look at the GetOrderNumber method in either of the samples I suggested previously.



  • How to get Data Object (Properties) define in workflow from my Host?