在 Service Manager 中設定工作流程Configure workflows in Service Manager

重要

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

在 Service Manager 中,工作流程是將商務程式自動化的一系列活動。In Service Manager, a workflow is a sequence of activities that automate a business process. 例如,工作流程可以在發生各種變更時更新事件。Workflows can, for example, update incidents when various changes occur. 當電腦不符合 Desired Configuration Management 的規範時,工作流程可以自動產生事件。A workflow can automatically generate incidents when computers fall out of compliance from desired configuration management. 您可以建立能夠定義其執行時間和環境的工作流程。You create a workflow that defines when and under what circumstances it will run. 例如,只要有關列印問題的低優先順序事件變更為較高的優先順序,工作流程就可以自動將支援階層從設定 1 變更為設定 2。For example, a workflow can automatically change the support tier from a setting of 1 to 2 whenever a low-priority incident pertaining to printing problems is changed to a higher priority. 工作流程活動是透過套用範本而運作的。Workflow activities function by the application of templates. 在此範例中,必須事先建立將支援階層變更為設定 2 的事件範本。For this example, an incident template to change the support tier to a setting of 2 must have been created previously.

您可以為每個工作流程設定建立多個工作流程。You can create multiple workflows for each workflow configuration. 您可以啟用或停用工作流程條件。You can enable or disable the workflow conditions. 如果停用特定規則,剩餘的規則仍然會使工作流程執行。If a particular rule is disabled, the remaining rules still cause the workflow to run. 如果要完全停用工作流程,您必須停用可呼叫該工作流程的所有規則。If you want to completely disable a workflow, you must disable all of the rules that call the workflow.

Service Manager 會保留工作流程的成功或失敗,並且可供您查看。The success or failure of a workflow is retained by Service Manager, and it is available for you to view. 可用的檢視有兩種。Two views are available. [所有結果 ] 包括所有成功及失敗之執行個體的檢視,而 [ 錯誤 ] 檢視則只顯示工作流程失敗時的執行個體。All Results consists of a view of all success and failure instances, and the Errors view displays only those instances when a workflow failed. 在 [ 所有結果 ] 檢視中,您可以檢視每個執行個體的記錄,以及檢視相關物件。In the All Results view, you can, for each instance, view the log and view the related object. 當您檢視記錄時,可以檢查工作流程執行時所發生的事件。When you view the log, you can examine the events that occurred when the workflow ran. 當您檢視相關物件時,可以查看此工作流程執行作業的表單。When you view the related object, you see the form that this workflow acted on. [ 錯誤 ] 檢視僅限最近 250 個執行個體。The Errors view is limited to the most recent 250 instances. 當您檢視失敗的執行個體時,[ 成功 ] 檢視中會出現相同的選項,可讓您檢視記錄及檢視相關物件。When you are viewing a failed instance, you have the same options in the Success view to view the log and view the related object. 此外,[ 錯誤 ] 檢視中會出現 [ 重試 ] 或 [ 略過] 選項供您選取。In addition, in the Errors view, you have the option to select Retry or Ignore. 選取 [ 重試 ] 會使工作流程以相同的參數再次執行,並且從檢視中移除此執行個體。Selecting Retry causes the workflow to run again with the same parameters and removes this instance from the view. 選取 [略過] **** 則會從檢視中移除該執行個體。Selecting Ignore removes the instance from the view.

設定事件工作流程Configure incident workflows

您可以使用下列程式建立及設定工作流程規則,每當與列印問題相關之事件的 [緊急] 屬性變更為 [] 時,就會將支援階層變更為 [第2層]。You can use the following procedure to create and configure a workflow rule that will change the support tier to Tier 2 whenever the Urgency property of an incident that is related to printing problems is changed to High. 此項程序假設您已經建立了一個將支援階層變更為 [ 第 2 層] 的事件範本,同時假設您已經建立優先順序計算表。This procedure assumes that you already created an incident template to change the support tier to Tier 2, and it assumes that you already created the priority calculation table. 如需詳細資訊,請參閱如何 設定事件優先順序 以及建立新的印表機相關事件範本,以 瞭解如何建立事件範本For more information, see How to Set Incident Priority and To create a new printer-related incident template in How to Create Incident Templates.

設定事件的工作流程To configure an incident workflow

  1. 在 Service Manager 主控台中,按一下 [系統管理]****。In the Service Manager console, click Administration.
  2. 依序展開 [ 系統管理 ] 窗格中的 [ 系統管理] 和 [ 工作流程],然後按一下 [ 設定]。In the Administration pane, expand Administration, expand Workflows, and then click Configuration.
  3. 按兩下 [ 設定 ] 窗格中的 [ 事件工作流程設定]。In the Configuration pane, double-click Incident Event Workflow Configuration.
  4. 按一下 [ 設定事件的工作流程 ] 對話方塊中的 [ 新增]。In the Configure Incident Event Workflows dialog box, click Add.
  5. 在 [ 新增事件工作流程 ] 對話方塊中,完成下列步驟:In the Add Incident Event Workflow dialog box, complete these steps:
    1. 在 [在您開始前]**** 頁面上,按 [下一步]****。On the Before You Begin page, click Next.
    2. 在 [ 工作流程資訊 ] 頁面上的 [ 名稱 ] 方塊中,輸入工作流程的名稱。On the Workflow Information page, in the Name box, type a name for the workflow. 例如,輸入 當急迫性內容變更為高時,向第 2 層呈報印表機問題For example, type Escalates Printer Problems to Support Tier 2 when the Urgency property is changed to High.
    3. 選取 [ 檢查事件 ] 清單中的 [ 建立物件時] 或 [更新物件時],確認已選取 [ 已啟用 ] 核取方塊,然後按 [ 下一步]。In the Check for events list, select when an object is created or when an object is updated, make sure that the Enabled check box is selected, and then click Next.
    4. 按一下 [ 指定事件準則 ] 頁面上的 [ 變更為 ] 索引標籤。在 [ 可用的屬性 ] 清單中,選取 [ 緊急],然後按一下 [ 新增]。On the Specify Event Criteria page, click the Changed to tab. In the Available Properties list, select Urgency, and then click Add. 選取 [ 準則 ] 方塊中的 [ 等於]。In the Criteria box, select equals. 在清單中選取 [ ],In the list, select High. 然後按 [下一步] ****。Then, click Next.
    5. 按一下 [ 選取事件範本 ] 頁面上的 [ 套用下列範本],然後選取您稍早建立的範本 (此範本會將支援小組設定為 [ 第 2 層])。On the Select Incident Template page, click Apply the following template, and then select the template you created earlier that will set the support group to Tier 2. 例如,請選取 [ 向第 2 層呈報印表機問題],然後按 [ 下一步]。For example, select Escalate Printer Problems to Tier 2, and then click Next.
    6. 在 [ 選取要通知的人員 ] 頁面上選擇性地選取 [ 啟用通知 ] 核取方塊、選取要通知的使用者,然後按 [ 下一步]。Optionally, in the Select People to Notify page, select the Enable notification check box, select the user to notify, and then click Next.
    7. 在 [ 摘要 ] 頁面上檢閱您的設定,然後按一下 [ 建立]。On the Summary page, review your settings, and then click Create.
    8. 在 [完成] **** 頁面中,按一下 [關閉] ****。On the Completion page, click Close.
  6. 按一下 [ 設定事件的工作流程 ] 對話方塊中的 [ 確定]。In the Configure Incident Event Workflows dialog box, click OK.

驗證事件工作流程To validate an incident workflow

  1. 在 Service Manager 主控台中,按一下 [ 工作專案]。In the Service Manager console, click Work Items.
  2. 依序展開 [ 工作項目 ] 窗格中的 [ 工作項目]、[ 事件管理],然後按一下 [ 所有事件]。In the Work Items pane, expand Work Items, expand Incident Management, and then click All Incidents.
  3. 在 [ 所有事件 ] 窗格中,按兩下目前尚未指派給第 2 層支援小組的事件。In the All Incidents pane, double-click an incident that is not currently assigned to the tier 2 support group.
  4. 在 [ 事件表單 ] 頁面上,將 [ 急迫性 ] 內容設定為 [ ],然後按一下 [ 確定]。In the Incident Form page, set the Urgency property to High, and then click OK.
  5. 數分鐘後,按一下 F5。In a few minutes, press F5. 確認 [ 支援小組 ] 方塊已變更為 [ 第 2 層]。Verify that the value in the Support Group box changed to Tier 2.

PowerShell 符號您可以使用 Windows PowerShell 命令來完成這些工作和其他相關工作,如下所示:You can use Windows PowerShell commands to complete these and other related tasks, as follows:

  • 如需如何使用 Windows PowerShell 在 Service Manager 中建立新工作流程的相關資訊,請參閱 New-SCSMWorkflowFor information about how to use Windows PowerShell to create a new workflow in Service Manager, see New-SCSMWorkflow.
  • 如需如何使用 Windows PowerShell 來取得 Service Manager 工作流程之設定和狀態資訊的相關資訊,請參閱 >get-scsmworkflowstatusFor information about how to use Windows PowerShell to retrieve configuration and status information for Service Manager workflows, see Get-SCSMWorkflowStatus.
  • 如需如何使用 Windows PowerShell 來更新工作流程內容的相關資訊,請參閱 Update-SCSMWorkflow cmdletFor information about how to use Windows PowerShell to update workflow properties, see Update-SCSMWorkflow cmdlet.
  • 如需如何使用 Windows PowerShell 從 Service Manager 移除工作流程的詳細資訊,請參閱 get-scsmworkflowFor information about how to use Windows PowerShell to remove a workflow from Service Manager, see Remove-SCSMWorkflow.

在 Service Manager 中查看工作流程成功或失敗View workflow success or failure in Service Manager

您可以使用下列程式來查看工作流程的成功或失敗實例。Use the following procedure to view the success or failure instances of the workflows.

若要查看工作流程成功或失敗To view workflow success or failure

  1. 在 Service Manager 主控台中,按一下 [系統管理]****。In the Service Manager console, click Administration.
  2. 依序展開 [系統管理]**** 窗格中的 [系統管理]**** 和 [工作流程]****,然後按一下 [狀態]****。In the Administration pane, expand Administration, expand Workflows, and then click Status.
  3. 在 [ 狀態 ] 窗格中,按一下您想要查看的工作流程。In the Status pane, click the workflow that you want to view. 例如, 當 [緊急] 屬性變更為 [高] 時,按一下 [呈報印表機問題] 以支援第2層For example, click Escalates Printer Problems to Support Tier 2 when the Urgency property is changed to High.
  4. 在 [ 狀態 結果] 窗格中,按一下 [ 需要注意 ] 以查看未成功執行的工作流程。In the Status results pane, click Need attention to view workflows that did not run successfully. 或者,按一下 [ 所有實例],然後執行下列動作:Or, click All Instances, and then do the following:
    1. 按一下 [ view log ] 以查看工作流程執行時所發生的事件清單。Click View log to view the list of events that occurred when the workflow ran.
    2. 按一下 [ view 相關物件 ] 以查看工作流程執行時所使用的表單。Click View related object to view the form that was used when the workflow ran. 每個工作流程的狀態會顯示在 [ 狀態 ] 資料行中。The status of each workflow is displayed in the Status column.

PowerShell 符號 :您可以使用 Windows PowerShell 命令來完成這項工作。PowerShell symbolYou can use a Windows PowerShell command to complete this task. 如需如何使用 Windows PowerShell 在 Service Manager 中取出工作流程狀態的詳細資訊,請參閱 >get-scsmworkflowstatusFor information about how to use Windows PowerShell to retrieve the status of workflows in Service Manager, see Get-SCSMWorkflowStatus.

後續步驟Next steps