Prepare Raise Job on Contract Message
This workflow is included in the Contracts module.
Description
Prepares standard data on designInterfaces_raiseJobOnContract from jobs.
Properties
This workflow has the following properties.
| Property | Value |
|---|---|
| Name | Prepare Raise Job on Contract Message |
| Code | workflows_prepareStandardRaiseJobOnContract |
| Type | Workflow |
| Context | Module |
| Enabled | Yes |
Trigger
A user triggers this workflow on demand, or another workflow runs it (via an MWR). It works on the items of the design below.
| Property | Value |
|---|---|
| Workflow type | Manual workflow |
| Applies to | Jobs with Contracts |
| Output mode | ManyItems (Runs once for all items) |
| Parameters design | MTP Prepare Raise Job on Contract Message |
| Output action | The Output action highlighted in the diagram below |
Actions
This workflow runs 8 actions, in the order shown in this simplified diagram. Every action's full settings are in the configuration below.
Configuration
The full configuration of this workflow, including every action's parameters.
Show configuration (378 lines)
{
"trigger": {
"dodiCode": "designInterfaces_jobsWithContracts",
"outputMode": "ManyItems",
"parametersDesignCode": "designs_MTPPrepareRaiseJobOnContractMessage",
"outputActionId": "685ad340de0bf8df53a01100"
},
"actions": [
{
"actionId": "685ad340de0bf8df53a01100",
"designCode": "designs_workflowOutputAction",
"description": "Outputs the standard raise job on contract message",
"parameters": [
{
"attributeCode": "attributes_workflowOutputActionData",
"value": {
"script": "var allJwiId=Variables.jwiId.AllValues.Values.Select(x=>x.SingleValue).ToArray();var allJwiTitle=Variables.jwiTitle.AllValues.Values.Select(x=>x.SingleValue).ToArray();var allJwiSubtitle=Variables.jwiSubtitle.AllValues.Values.Select(x=>x.SingleValue).ToArray();var allJwiEstimatedValue=Variables.jwiEstimatedValue.AllValues.Values.Select(x=>x.SingleValue).ToArray();var allJwiWorkItem=Variables.jwiWorkItem.AllValues.Values.Select(x=>x.SingleValue).ToArray();var allJwiWorkItemId=Variables.jwiWorkItemId.AllValues.Values.Select(x=>x.SingleValue).ToArray();var allJwiWorkItemCode=Variables.jwiWorkItemCode.AllValues.Values.Select(x=>x.SingleValue).ToArray();var allJwiWorkItemName=Variables.jwiWorkItemName.AllValues.Values.Select(x=>x.SingleValue).ToArray();var indexOrder=allJwiId.Select((id,index)=>new{Id=id[0],Index=index}).OrderBy(x=>x.Id).Select(x=>x.Index).ToArray();var workItemLookup=Enumerable.Range(0,allJwiWorkItemId.Length).ToDictionary(i=>allJwiWorkItemId[i][0],i=>new{ItemId=allJwiWorkItemId[i][0],Code=allJwiWorkItemCode[i],Name=allJwiWorkItemName[i]});AId[] allAttachments=Variables.jwiAttachmentFileIds.AllValues.Values.SelectMany(x=>x.SingleValue).ToArray();var signedUrls=FileSignedUrlsJson(allAttachments);return Json(new{items=new[]{new{attributes_raiseContractJobId=jobId.First(),attributes_raiseContractJobTitle=title,attributes_raiseContractJobSubtitle=subtitle,attributes_raiseContractJobNumber=jobnumber,attributes_raiseContractJobDescription=description,attributes_raiseContractGeometry=geometry,attributes_raiseContractRaisedTime=raisedTime,attributes_raiseContractIssuedTime=issuedTime,attributes_raiseContractTargetDate=targetTime,attributes_raiseContractContractId=contractId,attributes_raiseContractCompanyCode=companyCode,attributes_raiseContractSiteCode=siteCode,attributes_raiseContractContractorId=contractorId,attributes_raiseContractJobPriority=priority,attributes_raiseContractUsrn=usrn,attributes_raiseContractJobWorkItems=new{workItems=indexOrder.Select(i=>new{title=allJwiTitle[i],subtitle=allJwiSubtitle[i],estimatedValue=allJwiEstimatedValue[i],workItemId=allJwiId[i].First(),workItemCode=workItemLookup[allJwiWorkItem[i][0]].Code,workItemName=workItemLookup[allJwiWorkItem[i][0]].Name}).ToArray()},attributes_raiseContractAttachments=signedUrls}}});"
},
"attributeType": "Json"
},
{
"attribute": {
"attributeCode": "attributes_workflowOutputActionDodiCode",
"value": "designInterfaces_raiseJobOnContract",
"attributeType": "String"
}
},
{
"attribute": {
"attributeCode": "attributes_workflowOutputActionSingleInstance",
"value": false,
"attributeType": "Boolean"
}
}
],
"variables": [
{
"name": "jobId",
"value": {
"inputParent": 0,
"itemValue": {
"property": "ItemId"
}
}
},
{
"name": "title",
"value": {
"inputParent": 0,
"itemValue": {
"attributeCode": "attributes_itemsTitle"
}
}
},
{
"name": "subtitle",
"value": {
"inputParent": 0,
"itemValue": {
"attributeCode": "attributes_itemsSubtitle"
}
}
},
{
"name": "jobnumber",
"value": {
"inputParent": 0,
"itemValue": {
"attributeCode": "attributes_jobsJobNumber"
}
}
},
{
"name": "description",
"value": {
"inputParent": 0,
"itemValue": {
"attributeCode": "attributes_tasksDescription"
}
}
},
{
"name": "geometry",
"value": {
"outputAction": "685ad340de0bf8df53a01111",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_itemsGeometry"
}
}
},
{
"name": "raisedTime",
"value": {
"inputParent": 0,
"itemValue": {
"attributeCode": "attributes_tasksRaisedTime"
}
}
},
{
"name": "issuedTime",
"value": {
"inputParent": 0,
"itemValue": {
"attributeCode": "attributes_tasksIssuedTime"
}
}
},
{
"name": "targetTime",
"value": {
"inputParent": 0,
"itemValue": {
"attributeCode": "attributes_tasksTargetTime"
}
}
},
{
"name": "contractId",
"value": {
"outputAction": "685ad340de0bf8df53a01101",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_causewayOneProjectsUuid"
}
}
},
{
"name": "contractorId",
"value": {
"outputAction": "685ad340de0bf8df53a01101",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_contractsContractorId"
}
}
},
{
"name": "siteCode",
"value": {
"outputAction": "685ad340de0bf8df53a01101",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_contractsSiteCode"
}
}
},
{
"name": "companyCode",
"value": {
"outputAction": "685ad340de0bf8df53a01101",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_contractsCompanyCode"
}
}
},
{
"name": "priority",
"value": {
"outputAction": "685ad340de0bf8df53a01102",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_taskPrioritiesPriority"
}
}
},
{
"name": "usrn",
"value": {
"outputAction": "685ad340de0bf8df53a01103",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_nsgType11StreetRecordsUsrn"
}
}
},
{
"name": "jwiId",
"value": {
"outputAction": "685ad340de0bf8df53a01104",
"outputMode": "Input",
"itemValue": {
"property": "ItemId"
}
}
},
{
"name": "jwiTitle",
"value": {
"outputAction": "685ad340de0bf8df53a01104",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_itemsTitle"
}
}
},
{
"name": "jwiSubtitle",
"value": {
"outputAction": "685ad340de0bf8df53a01104",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_itemsSubtitle"
}
}
},
{
"name": "jwiEstimatedValue",
"value": {
"outputAction": "685ad340de0bf8df53a01104",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_jobWorkItemsEstimatedValue"
}
}
},
{
"name": "jwiWorkItem",
"value": {
"outputAction": "685ad340de0bf8df53a01104",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_jobWorkItemsWorkItem"
}
}
},
{
"name": "jwiAttachmentFileIds",
"value": {
"outputAction": "693827acbb522560a2663e13",
"outputMode": "Input",
"itemValue": {
"property": "ItemId"
}
}
},
{
"name": "jwiWorkItemId",
"value": {
"outputAction": "685ad340de0bf8df53a01105",
"outputMode": "Input",
"itemValue": {
"property": "ItemId"
}
}
},
{
"name": "jwiWorkItemCode",
"value": {
"outputAction": "685ad340de0bf8df53a01105",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_workItemsCode"
}
}
},
{
"name": "jwiWorkItemName",
"value": {
"outputAction": "685ad340de0bf8df53a01105",
"outputMode": "Input",
"itemValue": {
"attributeCode": "attributes_workItemsName"
}
}
}
],
"actions": []
},
{
"actionId": "685ad340de0bf8df53a01101",
"designCode": "designs_workflowRelationAction",
"description": "Get Contract (From the Supplier Account Item)",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsAqsPath",
"value": "root.attributes_tasksTeam.attributes_assignedSupplierAccountsSupplierAccount.attributes_financialAccountsWithContractsContract"
}
}
],
"variables": [],
"actions": []
},
{
"actionId": "685ad340de0bf8df53a01111",
"designCode": "designs_workflowRelationAction",
"description": "Asset",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsAqsPath",
"value": "root^attributes_tasksAssignableTasks"
}
}
],
"variables": [],
"actions": []
},
{
"actionId": "685ad340de0bf8df53a01102",
"designCode": "designs_workflowRelationAction",
"description": "Priority",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsAqsPath",
"value": "root.attributes_tasksPriority"
}
}
],
"variables": [],
"actions": []
},
{
"actionId": "685ad340de0bf8df53a01103",
"designCode": "designs_workflowRelationAction",
"description": "USRN",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsAqsPath",
"value": "root^attributes_tasksAssignableTasks<designInterfaces_assetHeads>.attributes_networkReferenceableNetworkReferences^attributes_networksNetworkReferences<designInterfaces_nsgType11StreetRecords>"
}
}
],
"variables": [],
"actions": []
},
{
"actionId": "685ad340de0bf8df53a01104",
"designCode": "designs_workflowRelationAction",
"description": "Job Work Items",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsAqsPath",
"value": "root.attributes_jobsJobWorkItems"
}
}
],
"variables": [],
"actions": []
},
{
"actionId": "693827acbb522560a2663e13",
"designCode": "designs_workflowRelationAction",
"description": "Job Attachments",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsAqsPath",
"value": "root.attributes_filesAttachableAttachments"
}
}
],
"variables": [],
"actions": []
},
{
"actionId": "685ad340de0bf8df53a01105",
"designCode": "designs_workflowRelationAction",
"description": "Job Work Items",
"parameters": [
{
"attribute": {
"attributeCode": "attributes_workflowRelationActionsAqsPath",
"value": "root.attributes_jobsJobWorkItems.attributes_jobWorkItemsWorkItem"
}
}
],
"variables": [],
"actions": []
}
]
}