0

ユーザーに割り当てられたロールごとにタスクを作成します。すべてのロールには複数のリソースがあります。すべてのリソースのワークフロー カスタム タスク フォームにコンボボックスを動的に追加する必要があります。コンボボックスにはすべてのアカウントが含まれます。これは、カスタムの InfoPath タスク フォームで可能ですか?

コード ビハインドを infopath タスク フォームに追加することはできますか (管理者の承認が必要ですか)?

4

1 に答える 1

0

カスタム InfoPath タスク フォームにコードを追加できます。dll がフォームと一緒に展開されていることを確認する必要があります。

また、繰り返しテーブル内にコンボボックスを追加することもできます (すべてのコンボボックスは同じデータ ソースを持ちます)。繰り返しテーブルの行は PageLoad で作成され、そのデータは Form フィールドに XML として埋め込まれて Workflow から提供されます。

    public void InternalStartup()
    {
        EventManager.FormEvents.Loading += new LoadingEventHandler(FormEvents_Loading);
    }

    public void FormEvents_Loading(object sender, LoadingEventArgs e)
    {
        string myNamespace = NamespaceManager.LookupNamespace("my");

        XPathNavigator repTable = MainDataSource.CreateNavigator().SelectSingleNode("/my:RoleAssigmentExecution/my:Resources", NamespaceManager);
        if (repTable == null)
        {
            XPathNavigator node = MainDataSource.CreateNavigator().SelectSingleNode("/my:RoleAssigmentExecution", NamespaceManager);
            using (XmlWriter writer = node.AppendChild())
            {
                writer.WriteStartElement("Resources", myNamespace);
                writer.WriteEndElement();
                writer.Close();
            }

        }
        repTable = MainDataSource.CreateNavigator().SelectSingleNode("/my:RoleAssigmentExecution/my:Resources", NamespaceManager);
        if (repTable != null)
        {
            using (XmlWriter writer = repTable.AppendChild())
            {

                XPathNavigator inst = MainDataSource.CreateNavigator().SelectSingleNode("/my:RoleAssigmentExecution/my:Instructions", NamespaceManager);
                writer.WriteStartElement("ResorceAccounts", myNamespace);
                writer.WriteElementString("resource", myNamespace, inst.Value);
                writer.WriteElementString("accountCombo", myNamespace, "");
                writer.WriteEndElement();

                writer.Close();
            }
        }
        else 
        {
            string path = "/my:RoleAssigmentExecution/my:Remarks";
            XPathNavigator node = MainDataSource.CreateNavigator().SelectSingleNode(path, NamespaceManager);
            node.SetValue("can not access Repeating Table");
        }
    }
于 2013-01-08T07:53:12.210 に答える