1

リリース スクリプトのメソッドを実行するときOpenScriptに、インデックスフィールド、バッチフィールド、および変数をリストに保存したいと考えています。このためのスニペットを作成しました

Dictionary<string, string> indexFields = new Dictionary<string, string>();
Dictionary<string, string> batchFields = new Dictionary<string, string>();
Dictionary<string, string> kofaxValues = new Dictionary<string, string>();

foreach (Value val in documentData.Values)
{
    if (val.TableName.IsEmpty())
    {
        string sourceName = val.SourceName;
        string sourceValue = val.Value;

        switch (val.SourceType)
        {
            case KfxLinkSourceType.KFX_REL_INDEXFIELD:
                indexFields.Add(sourceName, sourceValue);
                break;

            case KfxLinkSourceType.KFX_REL_VARIABLE:
                kofaxValues.Add(sourceName, sourceValue);
                break;

            case KfxLinkSourceType.KFX_REL_BATCHFIELD:
                batchFields.Add(sourceName, sourceValue);
                break;
        }
    }
}

フィールド値が必要なので、これを行いたいです。各フィールド名は一意であるため、キーとして使用できます。

カスタム プロパティを に保存すると、ReleaseSetupDataから読み取ることができますReleaseData。2 つのカスタム プロパティがフィールド名とフィールド タイプを返すとします。そのため、フィールドが であり、そのIndexField名前が「MyIndexField」であることがわかります。

これらの情報を使用して にアクセスし、Dictionary<string, string> indexFieldsそこから値を取得できますIndexfield

現在ReleaseSetupData、このコードでセットアップしています

releaseSetupData.CustomProperties.RemoveAll();

// Save all custom properties here

releaseSetupData.CustomProperties.Add("myCustomProperty", "fooBar");

releaseSetupData.Links.RemoveAll();

foreach (IndexField indexField in releaseSetupData.IndexFields) // Save all IndexFields
{
    releaseSetupData.Links.Add(indexField.Name, KfxLinkSourceType.KFX_REL_INDEXFIELD, indexField.Name);
}

foreach (BatchField batchField in releaseSetupData.BatchFields) // Save all BatchFields
{
    releaseSetupData.Links.Add(batchField.Name, KfxLinkSourceType.KFX_REL_BATCHFIELD, batchField.Name);
}

foreach (dynamic batchVariable in releaseSetupData.BatchVariableNames) // Save all Variables
{
    releaseSetupData.Links.Add(batchVariable, KfxLinkSourceType.KFX_REL_VARIABLE, batchVariable);
}

リリース スクリプトのOpenScriptメソッドが実行されると、辞書 (最初のスニペットに表示) は空のままです。documentData.Valuesが空だからです。

どうすれば記入できdocumentData.Valuesますか?

4

1 に答える 1