Question

We're creating rather large workflow services so, to make things more clean, we've decided to "split them" into sub-activities.

This, on it's own, works quite well.

However, we've noticed that events aren't being tracked any more - only events from the actual workflow are tracked, while events from the part activities are omitted (unless something throws an exception and crashes).

I've read up here and I see I was missing the implementationVisibility property - by default it's set to the root scope of the workflow.

So I've created a custom tracking profile, defined as such:

<trackingProfile name="CRM Game HealthMonitoring Tracking Profile" implementationVisibility="All">
  <workflow activityDefinitionId="*">
    <workflowInstanceQueries>
      <workflowInstanceQuery>
        <states>
          <state name="Started" />
          <state name="UnhandledException" />
          <state name="Persisted" />
          <state name="Unsuspended" />
          <state name="Aborted" />
          <state name="Canceled" />
          <state name="Completed" />
          <state name="Terminated" />
        </states>
      </workflowInstanceQuery>
    </workflowInstanceQueries>
    <activityStateQueries>
      <activityStateQuery activityName="*">
        <states>
          <state name="Closed" />
        </states>
      </activityStateQuery>
    </activityStateQueries>
    <customTrackingQueries>
      <customTrackingQuery name="*" activityName="*" />
    </customTrackingQueries>
    <faultPropagationQueries>
      <faultPropagationQuery faultSourceActivityName="*" faultHandlerActivityName="*" />
    </faultPropagationQueries>
    <bookmarkResumptionQueries>
      <bookmarkResumptionQuery name="*" />
    </bookmarkResumptionQueries>
  </workflow>
</trackingProfile>

I've then opened the AppFabric configuration for the specific workflow and added this profile to the configuration.

Sadly, the end-result is that tracking works exactly as before, as if the tracking profile wasn't being used at all.

EDIT: The new tracking profile IS being used because bookmark resumption events are now tracked. However, the events are still only tracked for workflow root activities.

What am I doing wrong?

PS. Is there a way to set a default tracking profile for all workflows?

EDIT 2: According to this link there's no implementationVisibility parameter in the <trackingProfile> definition at all... What's going on?

Était-ce utile?

La solution

While I don't know WHY this has failed, I found out that loading and setting the tracking profile via the IIS Management screen didn't work.

When I placed the entire configuration in the web.config file (tracking profile definition and selecting it as the default tracking profile for our workflows) then it started to work as expected.

Here's the important part of the final web.config if anyone's interested. :)

  <system.serviceModel>
    <tracking>
      <profiles>
        <trackingProfile name="My Tracking Profile" implementationVisibility="All">
          <workflow activityDefinitionId="*">
            <workflowInstanceQueries>
              <workflowInstanceQuery>
                <states>
                  <state name="Started" />
                  <state name="UnhandledException" />
                  <state name="Persisted" />
                  <state name="Unsuspended" />
                  <state name="Aborted" />
                  <state name="Canceled" />
                  <state name="Completed" />
                  <state name="Terminated" />
                </states>
              </workflowInstanceQuery>
            </workflowInstanceQueries>
            <activityStateQueries>
              <activityStateQuery activityName="*">
                <states>
                  <state name="Closed" />
                </states>
              </activityStateQuery>
            </activityStateQueries>
            <customTrackingQueries>
              <customTrackingQuery name="*" activityName="*" />
            </customTrackingQueries>
            <faultPropagationQueries>
              <faultPropagationQuery faultSourceActivityName="*" faultHandlerActivityName="*" />
            </faultPropagationQueries>
          </workflow>
        </trackingProfile>
      </profiles>
    </tracking>
    <bindings />
    <client />
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <etwTracking profileName="My Tracking Profile"/>
          (...)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top