設定活動在 Service Manager 撰寫中管理和傳遞資訊的方式Configure the way activities manage and pass information in Service Manager authoring

重要

此版本的 Service Manager 已達到終止支援,建議您 升級至 Service Manager 2019This version of Service Manager has reached the end of support, we recommend you to upgrade to Service Manager 2019.

活動內容提供了傳輸資料的管道。The activity properties provide ways to transfer data. 在 Woodgrove Bank 的自訂案例中,電腦的名稱和群組的名稱必須從自動化佈建活動傳送到實際執行工作的工作流程活動。For the Woodgrove Bank customization scenario, the name of the computer and the name of the group must be transferred from the automated provisioning activity to the workflow activity that does the actual work. 下圖顯示電腦和組名如何從 Service Manager 自動化活動傳遞到工作流程中的 Windows Workflow Foundation (WF) 活動。The following illustration shows how the computer and group names pass from the Service Manager automated activity to the Windows Workflow Foundation (WF) activities in the workflow.

程序: 將電腦加入群組中

您可以使用下列步驟設定內容來傳遞值:You can use the following steps to configure properties to pass the values:

  • 如何將活動內容設定為常數值-將 [新增 AD DS 電腦Active Directory Server ] 屬性設定為 [群組] 活動設定為常數值。How to Set an Activity Property to a Constant Value - Sets the Active Directory Server property of the Add AD DS Computer To Group activity to a constant value.

  • 如何將活動內容設定為使用觸發類別的值-將先前定義的ComputerName和群組屬性與 [將 AD DS 電腦新增至群組] 活動的 [電腦名稱稱] 和 [組名 ] 屬性產生關聯。How to Set an Activity Property to Use a Value from the Trigger Class - Associates the ComputerName and GroupName properties defined previously with the Computer name and Group name properties of the Add AD DS Computer To Group activity.

若工作流程規模較大且較為複雜,您還有另外一種選擇。For larger, more complex workflows, you have an additional option. 若要將值從某個活動傳遞到另一個活動,請完成如何設定活動屬性以使用另一個活動的值的步驟。To pass values from one activity to another, complete the steps in How to Set an Activity Property to Use a Value from Another Activity.

將活動屬性設定為常數值Set an activity property to a constant value

在 Woodgrove Bank 自訂案例中,Ken 使用這個程式,將 [新增 AD DS 電腦] 的 [ Active Directory 名稱] 屬性設定為 [群組] 活動。In the Woodgrove Bank customization scenario, Ken uses this procedure to set the Active Directory name property of the Add AD DS Computer to Group activity.

請在 Service Manager Authoring Tool 中使用此程序將屬性設定為常數值 (也稱為常值)。Use this procedure in the Service Manager Authoring Tool to set a property to a constant value (also referred to as a literal value). 每次這個工作流程啟動時,都會套用這個值。This value applies anytime this workflow starts.

若要將活動內容設定為常數值To set an activity property to a constant value

  1. 在撰寫窗格中,按一下所需的活動。In the authoring pane, click the activity you want. 詳細資料窗格會變成作用中狀態,並顯示此活動的屬性。The Details pane becomes active, and it displays the properties for this activity.

    例如,在 AddComputertoADGroupWF 工作流程中,按一下 [ 將 AD DS 電腦新增至群組 ] 活動。For example, in the AddComputertoADGroupWF workflow, click the Add AD DS Computer to Group activity.

  2. 詳細資料 窗格中,按一下您要設定的屬性,然後在文字方塊中輸入一個值。In the Details pane, click the property you want to set, and in the text box, type a value.

    例如,針對 [ 將 AD DS 電腦新增至群組 ] 活動,按一下 [ 電腦功能變數名稱],然後在文字方塊中輸入 woodgrove.comFor example, for the Add AD DS Computer to Group activity, click Computer Domain name, and in the text box, type woodgrove.com.

設定活動屬性以使用另一個活動的值Set an activity property to use a value from another activity

請在 Service Manager Authoring Tool 中使用此程序,將活動設定成從工作流程中的另一個活動取得其內容值。Use this procedure in the Service Manager Authoring Tool to configure an activity to obtain its property values from another activity in the workflow. 這個程序稱為將某個內容「繫結」到另一個內容。This process is referred to as "binding" one property to another.

若要設定活動內容使用其他活動的值To set an activity property to use a value from another activity

  1. 在撰寫窗格中,按一下所需的活動。In the authoring pane, click the activity you want. 詳細資料窗格會變成作用中狀態,並顯示此活動的屬性。The Details pane becomes active, and it displays the properties for this activity.

  2. 按一下您要設定的屬性,然後按一下出現在該屬性中的省略號 (]) 按鈕。Click the property you want to set, and then click the ellipsis (...) button that appears for that property.

  3. 在對話方塊中的活動清單裡,展開所需的活動,然後選取您要使用的內容。In the list of activities in the dialog box, expand the activity you want, and then select the property you want to use.

  4. 按一下 [確定] ,關閉對話方塊。Click OK to close the dialog box.

將活動屬性設定為使用觸發類別的值Set an activity property to use a value from the trigger class

在 Service Manager Authoring Tool 中使用此程式來設定屬性,以從用來觸發工作流程的 Service Manager 類別取出其值。Use this procedure in the Service Manager Authoring Tool to set a property to retrieve its value from the Service Manager class used to trigger the workflow. 您不能將這個方法用於具有計時器觸發程序的工作流程。You cannot use this method with a workflow that has a Timer trigger.

在 Woodgrove Bank 自訂案例中,Ken 使用這個程式來設定 [將 AD DS 電腦新增至群組] 活動的 [電腦名稱稱] 和 [組名] 內容,以便從變更要求中取出 [自動化活動:新增電腦至 AD 群組內容]電腦名稱稱、[組名] 和 [活動識別碼] 的值。In the Woodgrove Bank customization scenario, Ken uses this procedure to set the Computer Name and Group Name properties of the Add AD DS Computer to Group activity to retrieve the values of the Automated Activity: Add Computer To AD Group properties Computer Name, Group Name, and Activity ID from the change request.

若要設定活動內容以從觸發類別擷取資料To configure activity properties to retrieve data from a trigger class

  1. 在撰寫窗格中,按一下所需的活動。In the authoring pane, click the activity you want. 詳細資料窗格會變成作用中狀態,並顯示此活動的屬性。The Details pane becomes active and displays the properties for this activity. 例如,按一下 [ 將 AD DS 電腦新增至群組 ] 活動或 [ 將活動狀態設定為已完成 ] 活動。For example, click the Add AD DS Computer to Group activity or the Set Activity Status to Completed activity.

  2. 詳細資料 窗格中,按一下您要設定的屬性,然後按一下出現在屬性旁的省略號 (...) 按鈕。In the Details pane, click the property you want to set, and then click the ellipsis (...) button that appears next to the property.

    例如,針對 [ 將 AD DS 電腦新增至群組 ] 活動,按一下 [ 組名],然後按一下省略號 (...) 按鈕。For example, for the Add AD DS Computer to Group activity, click Group Name, and then click the ellipsis (...) button.

  3. 在 [ 定義活動 addaddscomputertogroup1] 的輸入 ] 對話方塊的左側,按一下 [ 使用類別屬性]。On the left side of the Define input for the activity addADDSComputerToGroup1 dialog box, click Use a class property. 選取此選項會產生一份清單,列出觸發類別中可用的內容。Selecting this option produces a list of the properties that are available in the trigger class.

  4. 選取您要用來當作此活動內容的類別內容。Select the class property that you want to use for this activity property.

    例如,針對 [ 將 AD DS 電腦新增至群組 ] 活動,請執行下列動作:For example, for the Add AD DS Computer to Group activity, do the following:

    1. 在 [將 AD DS 電腦新增至群組] 活動的 [詳細資料] 窗格中,按一下 [組名],按一下省略號 (...) 按鈕,按一下 [使用類別內容],按一下 [組名] ,然後按一下 [確定]In the Details pane for the Add AD DS Computer to Group activity, click Group Name, click the ellipsis (...) button, click Use a class property, click GroupName, and then click OK.

    2. 詳細資料 窗格中,按一下 [ 電腦名稱稱],按一下省略號 (...) 按鈕,按一下 [ 使用類別內容],按一下 [ ComputerName],然後按一下 [確定]In the Details pane, click Computer Name, click the ellipsis (...) button, click Use a class property, click ComputerName, and then click OK.

      在 [ 將活動狀態設定為已完成 ] 活動中,按一下 [ 活動識別碼],然後按一下出現在屬性旁邊的省略號 (...) 按鈕。For the Set Activity Status to Completed activity, click Activity ID, and then click the ellipsis (...) button that appears next to the property. 在 [ 定義活動 setactivitystatustocompleted1] 的輸入 ] 對話方塊中,按一下 [ 使用類別內容],然後在 [屬性] 清單中,按一下 [ **ID (內部) **。In the Define input for the activity setActivityStatusToCompleted1 dialog box, click Use a class property, and then in the property list, click ID (Internal). 按一下 [確定]。Click OK.

後續步驟Next steps