任務
「任務」是「項目清單」元件的預先定義組態,可在 Windchill 中顯示使用者任務的清單。針對每個任務,「任務」都會顯示您可以透過組態來設定的屬性。每個屬性都會在「任務」中顯示為一欄。顯示的預設屬性為「名稱」、「主旨名稱」、「到期日」、「狀況」、「前後關聯名稱」與「任務進度」。「任務進度」屬性對於「任務」預先定義的組態具唯一性,並顯示已回應與任務相關之變更請求的成員數。
如需有關配置「任務」以顯示特定類型任務的資訊,請參閱主題。如需詳細資訊,請參閱主題配置項目清單以顯示特定任務類型的任務
您可以配置任務,使其中一個欄中的屬性連結至指定混搭。
任務有與項目清單相同的搜尋、排序、篩選、匯出及還原預設值功能。除「匯出」動作以外,內嵌的動作列還包括「重新指派」動作。按一下時,「重新指派」動作會開啟一個快顯視窗,可讓您將一或多個任務重新指派給不同的使用者。
以下是顯示任務預先定義組態的範例圖像:
繫結內容 
如需有關繫結任務的資訊,請參閱項目清單元件。
* 
對於任務,selectedItems 繫結內容的輸出包含具有 PTC.Workflow.WorkItem 物件類型的項目。
預設情況下,「任務」會擷取具有 PTC.Workflow.WorkItem 物件類型的任務項目。因此,它不需要將任何輸入資料繫結至輸入繫結內容。
組態內容 
如需有關配置任務的資訊,請參閱項目清單元件。此外,下列 JSON 內容為「任務」所特有。
如需有關組態結構的詳細資訊,請參閱元件組態結構
如需有關子內容的詳細資訊,請參閱子內容與容器金鑰
內容名稱
描述
內容類型
預設值
必要或選用
taskTypeFilter
根據 activityNameworkItemProcessTemplate 名稱的組合決定在任務中擷取及顯示的任務類型,定義唯一的任務集。用來篩選要顯示的任務。若保留空白,則會顯示具有 PTC.Workflow.WorkItem 物件類型的所有任務。
格式:字串化 JSON 物件陣列,其中每個 JSON 物件都表示一種任務類型,其由 activityNameworkItemProcessTemplate 欄位的組合構成。
此組態內容放置在元件組態中的 implementationConfiguration 內容下。
範例:
"taskTypeFilter": {
"value": "[{\"activityName\": \"Conduct Online CRB Review\",
\"workItemProcessTemplate\": \"Change Request Workflow\"}]"
}
如需詳細資訊,請參閱配置項目清單以顯示特定任務類型的任務主題。
N/A
選用
linkToMashup
可將指定屬性轉換為超連結,並定義按一下屬性時要開啟的目標混搭。可用於開啟任務的詳細檢視。
這是 attributes 組態內容的子內容。指定混搭會透過混搭參數與對應任務的任務 ID 一起傳遞。所產生 URL 中的查詢參數為 TaskID=<任務 Id>。
此內容的容器金鑰為 implementationAttributesDefinition
範例:
{
"implementationAttributesDefinition":{
"linkToMashup":{
"mashupName":"PTC.CRDetailedReviewAppMashup"
}
}
}
產生的混搭 URL:/Thingworx/Runtime/index.html?mashup=PTC.CRDetailedReviewAppMashup&TaskID=<任務 Id>
N/A
選用
attributes
如需詳細資訊,請參閱項目清單
接受 PTC.Workflow.WorkItem 物件類型的屬性。
此外,還會接受具有 PTC.Workflow.WorkItem.Custom.Implementation 物件類型的 TaskProgress 屬性。TaskProgress 屬性會顯示已回應變更請求的成員數。
N/A
必要
defaultSortField
如需詳細資訊,請參閱項目清單
接受 PTC.Workflow.WorkItem 物件類型的屬性。
N/A
選用
filterFields
如需詳細資訊,請參閱項目清單
接受 PTC.Workflow.WorkItem 物件類型的屬性。
N/A
選用
範例組態 
{
"actionBarConfiguration":{
"value":{
"actionBarConfigurationJSON":{
"value":"{\"maxItemsToShow\": {\"value\": 2},\"modelThingName\": {\"entityName\": \"PTC.ActionBarModel.Thing\"},\"actions\": {\"selectedValues\": {\"data\": [{\"itemListsData\": [{\"items\": [{\"id\": \"Reassign\",\"additionalData\": {\"actionConfiguration\": {\"iconWhenDisabled\": {\"entityName\": \"PTC.ActionBar.ReassignDisabledIcon\"},\"iconWhenHovered\": {\"entityName\": \"PTC.ActionBar.ReassignHoverIcon\"},\"overrideLabel\": {\"value\": \"[[PTC.Nav.TaskList.TaskReassignLabel]]\"},\"popupHeight\": {\"value\": 579},\"inputConstraints\": {\"selectedKey\": \"InputRequired\"},\"actionButtonVisibility\": {\"selectedKey\": \"AlwaysShown\"},\"buttonStyle\": {\"selectedKey\": \"transparent\"},\"mashupName\": {\"mashupName\": \"PTC.AccessApp.WindchillServices.ReassignActionMashup\"},\"fireEventOnFinish\": {\"value\": false},\"activityType\": {\"selectedKey\": \"popup\"},\"iconWhenEnabled\": {\"entityName\": \"PTC.ActionBar.ReassignIcon\"},\"popupWidth\": {\"value\": 600}}},\"ordinal\": 0}],\"objectType\": \"WT.WorkItem.Actions\"}],\"adapter\": {\"instanceName\": \"windchill\",\"thingName\": \"PTC.WCAdapter\"}}]}}}"
}
}
},
"attributes":{
"inTailoring":true,
"selectedValues":{
"data":[
{
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
},
"itemListsData":[
{
"items":[
{
"additionalData":{
"implementationAttributesDefinition":{
"linkToMashup":{
"mashupName":""
}
},
"itemListAttributesDefinition":{
"fieldTitleOverride":{
"value":""
}
}
},
"id":"Activity|Name",
"ordinal":0
},
{
"additionalData":{
"itemListAttributesDefinition":{
"fieldTitleOverride":{
"value":""
}
}
},
"id":"Subject|SubjectName",
"ordinal":1
},
{
"additionalData":{
"itemListAttributesDefinition":{
"fieldTitleOverride":{
"value":""
}
}
},
"id":"Activity|Deadline",
"ordinal":2
},
{
"additionalData":{
"itemListAttributesDefinition":{
"fieldTitleOverride":{
"value":""
}
}
},
"id":"Status#Display",
"ordinal":3
},
{
"additionalData":{
"itemListAttributesDefinition":{
"fieldTitleOverride":{
"value":""
}
}
},
"id":"Activity|Context|Name",
"ordinal":4
}
],
"objectType":"PTC.Workflow.WorkItem"
},
{
"items":[
{
"additionalData":{
"itemListAttributesDefinition":{
"fieldTitleOverride":{
"value":"[[PTC.Nav.TaskList.TaskProgress]]"
}
}
},
"id":"TaskProgress",
"ordinal":5
}
],
"objectType":"PTC.Workflow.WorkItem.Custom.Implementation"
}
]
}
]
}
},
"defaultSortFields":{
"selectedValues":{
"data":[
{
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
},
"itemListsData":[
{
"items":[
{
"additionalData":{
"itemListDefaultSortFieldDefinition":{
"defaultSortDirection":{
"selectedKey":"asc"
}
}
},
"id":"Activity|Deadline"
}
],
"objectType":"PTC.Workflow.WorkItem"
}
]
}
]
}
},
"enableSearch":{
"additionalData":{
"itemListSearchDefinition":{
"searchHintText":{
"value":"[[PTC.Nav.TaskList.FindHintText]]"
}
}
},
"value":true
},
"filterFields":{
"selectedValues":{
"data":[
{
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
},
"itemListsData":[
{
"items":[
{
"additionalData":{
"itemListFilterFieldDefinition":{
"defaultSelectedFilterValues":{
"filters":{
"filters":[
{
"fieldName":"",
"type":"EQ",
"value":"POTENTIAL"
},
{
"fieldName":"",
"type":"EQ",
"value":"ACCEPTED"
}
],
"type":"Or"
}
},
"filterLabelOverride":{
"value":"[[PTC.Nav.TaskList.Status]]"
}
}
},
"id":"Status#Display",
"ordinal":0
}
],
"objectType":"PTC.Workflow.WorkItem"
}
]
}
]
}
},
"implementationConfiguration":{
"value":{
"taskTypeFilter":{
"value":"[{\"activityName\": \"Conduct Online CRB Review\",\"workItemProcessTemplate\": \"Change Request Workflow\"}]"
}
}
},
"label":{
"value":"[[PTC.Nav.TaskList.Label]]"
},
"maxNumberOfRowsInGrid":{
"inTailoring":true,
"value":50
},
"selectionType":{
"selectedKey":"multi"
},
"showExportAction":{
"inTailoring":true,
"value":true
},
"waitForInput":{
"value":false
},
"baseConfigurationVersion":{
"value":"nav.2"
},
"implementationConfigurationVersion":{
"value":"nav.1"
}
}
自訂服務 
除組態以外,每個元件還支援延伸其企業邏輯以自訂元件。每個元件的企業邏輯包括物範本中可以進行延伸與取代的置換服務。此元件的置換服務會在下表中詳細說明:
如需每個服務的傳回結果與參數範例,請參閱自訂服務的輸入/輸出範例
名稱
描述
GetConfigurations
傳回任務的可用組態。
參數:
傳回:JSON
GetImplementationLabel
傳回元件的當地語系化名稱或可用於取得當地語系化名稱的權杖。此當地語系化名稱會顯示在 Mashup Builder 使用者介面中。
參數:
傳回:字串
GetItems
傳回來自後端系統的使用者任務清單及其屬性與值。
參數:
input (選用) - CCO 格式的 JSON,其中包括要從後端系統擷取之資料的輸入 ID,以及後端系統的轉接器資訊。
configuration (必要) - 包含從「調整管理員」資源取得之最終合併組態的 JSON。
傳回:CCO 格式的 JSON
InitializeFilters
傳回組態中篩選器欄位的篩選器類型定義。初始化組態的 enum 金鑰下第一個篩選器欄位項目的篩選器 filterFields 選項資料。它會從轉接器 API 中擷取篩選器欄位的 enum 選項。
參數:
input (選用) - CCO 格式的 JSON,其中包括要從後端系統擷取之資料的輸入 ID,以及後端系統的轉接器資訊。
configuration (必要) - 包含從「調整管理員」資源取得之最終合併組態的 JSON。
傳回:CCO 格式的 JSON
DefHookImplementationConfigurationDefinitionGroup
傳回具有可用自訂組態的任務實行定義。包括 taskTypeFilter 組態內容的定義。
參數:
傳回:JSON:Array
DefHookImplementationAttributesDefinition
傳回所選屬性的任務實行定義。包括 linkToMashup 組態內容的定義。
參數:
傳回:JSON:Array
實行定義 
[
...
// Tasks injections to the Definition:
{
"property": {},
"value": {
"initializationData": {
"constraints": {},
"properties": {
"directDefinition": [ // Tasks specific:
{
"property": {},
"value": {
"initializationData": {
"constraints": {},
"properties": {
"hintText": null
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Textbox"
},
"mandatory": false,
"key": "taskTypeFilter"
}
]
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.DefinitionGroup"
},
"mandatory": true,
"key": "implementationConfiguration"
},
{
"property": {},
"value": {
"initializationData": {
"constraints": {},
"properties": {
"supportedTypes": {
"data": [ // Tasks specific:
{
"adapter": {
"thingName": "PTC.WCAdapter",
"instanceName": "windchill"
},
"itemListsData": [
{
"objectType": "PTC.Workflow.WorkItem",
"selectionGroupIds": ["1"]
}
]
}
],
"allowSubsetForTailoring": false
},
"additionalDefinition": [
{
"key": "itemListAttributesDefinition",
"directDefinition": [
{
"property": {},
"value": {
"initializationData": {
"constraints": {},
"properties": {
"hintText": null
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Textbox"
},
"mandatory": false,
"key": "fieldTitleOverride"
}
]
},
{
"key": "implementationAttributesDefinition",
"directDefinition": [ // Tasks specific:
{
"property": {},
"value": {
"initializationData": {
"constraints": {},
"properties": {}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.MashupSelector"
},
"mandatory": false,
"key": "linkToMashup"
}
]
}
],
"updateServiceName": "UpdateAvailableAttributes",
"addServiceName": "GetCustomAttributes",
"maximumSelectedAttributes": null,
"minimumSelectedAttributes": null
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.AttributesSelector"
},
"mandatory": true,
"key": "attributes"
},
{
"property": {},
"value": {
"initializationData": {
"constraints": {},
"properties": {
"supportedTypes": {
"data": [ // Tasks specific:
{
"adapter": {
"thingName": "PTC.WCAdapter",
"instanceName": "windchill"
},
"itemListsData": [
{
"objectType": "PTC.Workflow.WorkItem",
"selectionGroupIds": ["1"]
}
]
}
],
"allowSubsetForTailoring": false
},
"additionalDefinition": [
{
"key": "itemListFilterFieldDefinition",
"directDefinition": [
{
"property": {},
"value": {
"initializationData": {
"constraints": {},
"properties": {
"type": {},
"dynamiclySetTypeServiceName": "GetFilterTypeDefinitionForFilterField"
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.FieldFilter"
},
"mandatory": false,
"key": "defaultSelectedFilterValues"
},
{
"property": {},
"value": {
"initializationData": {
"constraints": {},
"properties": {}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Textbox"
},
"mandatory": false,
"key": "filterLabelOverride"
}
]
}
],
"updateServiceName": "",
"addServiceName": "",
"maximumSelectedAttributes": 1,
"minimumSelectedAttributes": 0
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.AttributesSelector"
},
"mandatory": false,
"key": "filterFields"
},
{
"property": {},
"value": {
"initializationData": {
"constraints": {},
"properties": {
"supportedTypes": {
"data": [ // Tasks specific:
{
"adapter": {
"thingName": "PTC.WCAdapter",
"instanceName": "windchill"
},
"itemListsData": [
{
"objectType": "PTC.Workflow.WorkItem",
"selectionGroupIds": ["1"]
}
]
}
],
"allowSubsetForTailoring": false
},
"additionalDefinition": [
{
"key": "itemListDefaultSortFieldDefinition",
"directDefinition": [
{
"property": {},
"value": {
"initializationData": {
"constraints": {},
"properties": {
"options": [
{
"key": "asc",
"label": "[[PTC.Nav.ItemList.SortOrder.Asc]]",
"description": "",
"additionalDefinition": []
},
{
"key": "dsc",
"label": "[[PTC.Nav.ItemList.SortOrder.Dsc]]",
"description": "",
"additionalDefinition": []
}
],
"updateServiceName": "",
"addServiceName": ""
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.RadioButton"
},
"mandatory": false,
"key": "defaultSortDirection"
}
]
}
],
"updateServiceName": "",
"addServiceName": "",
"maximumSelectedAttributes": null,
"minimumSelectedAttributes": null
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.AttributesSelector"
},
"mandatory": false,
"key": "defaultSortFields"
}

...
]
這是否有幫助?