1

AppFabric v1.1 / WF4

テキストと Tracelevel の両方を指定して CodeActivity 内に CustomTrackingRecord を作成すると、AppFabric ダッシュボードの TraceLevel が常に「情報」として表示されます。

    // Text Argument
    [DefaultValue(null)]
    public InArgument<string> Text { get; set; }

    // TraceLevel Property
    public TraceLevel TraceLevel { get; set; }

    /// <summary>
    /// Tracks the text message contained in the Text argument.
    /// </summary>
    /// <param name="context">The execution context under which the activity executes.</param>
    protected override void Execute(CodeActivityContext context)
    {
        // Obtain the runtime value of the Text and TraceLevel input arguments
        string text = context.GetValue(this.Text);

        // Create and initialize a custom tracking record 
        CustomTrackingRecord record = new CustomTrackingRecord(text, this.TraceLevel);

        // Sends the specified custom tracking record to any registered tracking providers
        context.Track(record);
    }

ところで、[ASStagingTable] および [ASWfEventsTable] テーブルを確認しましたが、CustomTrackingRecords の TraceLevelId は常に 4 です。

ありがとう!

4

1 に答える 1

0

TrackLevel で InArgument を使用する必要があります

// TraceLevel Property
public InArgument<TraceLevel> TraceLevel { get; set; }

次に、コンテキストを使用して、ワークフローの実行時に値を取得します

// Create and initialize a custom tracking record 
CustomTrackingRecord record = new CustomTrackingRecord(text, context.GetValue(this.TraceLevel));
于 2015-03-06T06:57:26.160 に答える