Create and Update Discrete Work Definitions

You can use work definitions REST API to consistently define a manufacturing process for a product that includes operations, materials, and resources.

You can also use the work definition REST API to:

  • Create a work definition that defines the process for rework of a product

  • Create a work definition that defines the process for the transformation of a product

You can't use the work definition REST API to:

  • Delete an entire work definition. You can delete only child resources such as operations, resources, and items

  • Upload attachments

  • Initiate the process to capture e-signatures and generate e-record

Let's discuss these scenarios:

  • Create a New Discrete Work Definition for a Standard Item

  • Create a New Discrete Work Definition for an Assemble to Order Item

  • Update a Work Definition

Create a New Discrete Work Definition for a Standard Item

Let's say James is a manufacturing engineer who needs to create a new discrete work definition for a standard item. In order to do this, James needs to provide information for the work definition header and at least one operation. In this scenario, James creates a work definition with two operations, two resources, and two materials using the POST operation.

Example URL

Use this resource URL format.

POST

curl -u username:password -X POST -H 'Content-Type:application/vnd.oracle.adf.resourceitem+json' -d 'request payload' 
'https://servername/fscmRestApi/resources/version/workDefinitionRequests'

Example Request

Here's an example of the request body in JSON format.

{
	'SourceSystemType': 'EXTERNAL',
	'workDefinitionHeaders': [{
		'ActionCode' : 'CREATE',
		'ItemNumber' : 'AS54888',
		'OrganizationCode' : 'V1',
		'VersionNumber' : 1,
		'WorkMethodCode' : 'DISCRETE_MANUFACTURING',
		'WorkDefinitionCode' : 'Primary',
		'ProductionPriority' : 1,
		'StartDate':'2018-11-24T02:48:41.275+00:00',
		'operations': [{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber': 10,
			'OperationName': 'Op1',
			'OperationType': 'IN_HOUSE',
			'CountPointOperationFlag': 'Y',
			'AutoTransactFlag': 'N',
			'WorkCenterCode': 'MFGPACKING1'
		},
		{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber': 20,
			'OperationName': 'Op20',
			'OperationType': 'IN_HOUSE',
			'CountPointOperationFlag': 'Y',
			'AutoTransactFlag': 'N',
			'WorkCenterCode': 'MFGPACKING1'
		}],
		'resources': [{
			'ActionCode': 'CREATE',
			'ResourceSequenceNumber':10,
			'OperationSequenceNumber':10,
			'ResourceCode':'MFGPACKINGLABOUR-C'
		},
		{
			'ActionCode': 'CREATE',
			'ResourceSequenceNumber':10,
			'OperationSequenceNumber':20,
			'ResourceCode':'MFGPACKINGLABOUR-NC'
		}],
		'materials': [{
			'ActionCode': 'CREATE',
			'MaterialSequenceNumber':10,
			'OperationSequenceNumber':10,
			'ItemNumber':'SB32982',
			'AdhocItemFlag':'Y'
		},
		{
			'ActionCode': 'CREATE',
			'MaterialSequenceNumber':20,
			'OperationSequenceNumber':10,
			'ItemNumber':'MFG-WD-OPTION-ITEM1',
			'AdhocItemFlag':'Y'
		}]
	}]
}

Example Response

Here's an example of the response body in JSON format.

{
	'SourceSystemCode': null,
	'SourceSystemType': 'EXTERNAL',
	'ErrorsExistFlag': 'false',
	'workDefinitionHeaders': [
	{
		'ActionCode': 'CREATE',
		'ErrorMessages': '',
		'ErrorMessageNames': '',
		'OrganizationCode': 'V1',
		'ItemNumber': 'AS54888',
		'ItemStructureName': null,
		'WorkDefinitionCode': 'Primary',
		'VersionNumber': '1',
		'StartDate': '2018-11-24T02:48:41.275+00:00',
		'ProductionPriority': 1,
		'CostingPriority': null,
		'CostingBatchOutputSize': null,
		'SerialTrackingFlag': null,
		'TransformFromItemNumber': null,
		'CompletionSubinventoryCode': null,
		'CompletionLocator': null,
		'WorkMethodCode': 'DISCRETE_MANUFACTURING',
		'WorkDefinitionId': 14004,
		'BatchQuantity': null,
		'BatchUOMCode': null,
		'ProcessName': null,
		'StatusCode': null,
		'MaintenanceCode': null,
		'MaintenanceName': null,
		'MaintenanceDescription': null,
		'resources': [
		{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber': 10,
			'ResourceSequenceNumber': 10,
			'ResourceCode': 'MFGPACKINGLABOUR-C',
			'AssignedUnits': null,
			'BasisType': null,
			'UsageRate': null,
			'InverseUsageRate': null,
			'ScheduledIndicator': 'NO',
			'PrincipalFlag': null,
			'ChargeType': 'AUTOMATIC',
			'ResourceActivityCode': null,
			'ErrorMessages': '',
			'ErrorMessageNames': '',
			'links': [
			{
				...
				]
			},
			{
				'ActionCode': 'CREATE',
				'OperationSequenceNumber': 20,
				'ResourceSequenceNumber': 10,
				'ResourceCode': 'MFGPACKINGLABOUR-NC',
				'AssignedUnits': null,
				'BasisType': null,
				'UsageRate': null,
				'InverseUsageRate': null,
				'ScheduledIndicator': 'NO',
				'PrincipalFlag': null,
				'ChargeType': 'AUTOMATIC',
				'ResourceActivityCode': null,
				'ErrorMessages': '',
				'ErrorMessageNames': '',
				'links': [
				{
					...
					]
				}
				],
				'materials': [
				{
					'ActionCode': 'CREATE',
					'ErrorMessages': '',
					'ErrorMessageNames': '',
					'OperationSequenceNumber': 10,
					'MaterialSequenceNumber': 10,
					'ItemNumber': 'SB32982',
					'BasisType': null,
					'Quantity': null,
					'InverseQuantity': null,
					'UOMCode': null,
					'YieldFactor': null,
					'SupplyType': null,
					'SupplySubinventory': null,
					'StartDate': null,
					'AdhocItemFlag': true,
					'SupplyLocator': null,
					'links': [
					...
					]
				},
				{
					'ActionCode': 'CREATE',
					'ErrorMessages': '',
					'ErrorMessageNames': '',
					'OperationSequenceNumber': 10,
					'MaterialSequenceNumber': 20,
					'ItemNumber': 'MFG-WD-OPTION-ITEM1',
					'BasisType': null,
					'Quantity': null,
					'InverseQuantity': null,
					'UOMCode': null,
					'YieldFactor': null,
					'SupplyType': null,
					'SupplySubinventory': null,
					'StartDate': null,
					'AdhocItemFlag': true,
					'SupplyLocator': null,
					'links': [
					...
					],
					'operations': [
					{
						'ActionCode': 'CREATE',
						'ErrorMessages': '',
						'ErrorMessageNames': '',
						'OperationSequenceNumber': 10,
						'StandardOperationCode': null,
						'ReferencedFlag': null,
						'OperationType': 'IN_HOUSE',
						'OperationName': 'Op1',
						'OperationDescription': null,
						'WorkCenterCode': 'MFGPACKING1',
						'CountPointOperationFlag': true,
						'AutoTransactFlag': false,
						'SerialTrackingFlag': null,
						'OSPItemNumber': null,
						'SupplierName': null,
						'SupplierSiteCode': null,
						'ShippingDocumentsFlag': null,
						'LeadTimeUnitOfMeasure': null,
						'FixedLeadTime': null,
						'VariableLeadTime': null,
						'OptionDependentFlag': null,
						'PlanningPercent': null,
						'LeadTimePercent': null,
						'AddlMtlAtManualIssue': null,
						'OperationComplWithUnderIssue': null,
						'OperationComplWithOpenExceptions': null,
						'links': [
						...
						]}
					]
				}
			}
		}
	}
}

Create a New Discrete Work Definition for an Assemble to Order Item

If James wants to create a new discrete work definition for an assemble to order (ATO) item, then he needs to provide basic information for the work definition header and at least one operation. In this scenario, James creates a work definition with three operations, two resources, and four ATOMaterials using the POST operation.

Example URL

Use this resource URL format.

POST

curl -u username:password -X POST -H 'Content-Type:application/vnd.oracle.adf.resourceitem+json' -d 'request payload' 
'https://servername/fscmRestApi/resources/version/workDefinitionRequests'

Example Request

Here's an example of the request body in JSON format.

Specify the component hierarchy for ATOMaterials. To provide the component hierarchy, you must provide the relative path of the item node to the top-level ATO model node using '>' as the delimiter. For example, to assign OPTION 11, which is under OPTION CLASS 1 under ATO MODEL 1, specify component hierarchy as ATO MODEL 1> OPTION CLASS 1.

{
	'SourceSystemType': 'EXTERNAL',
	'workDefinitionHeaders': [ {
		'ActionCode' : 'CREATE',
		'ItemNumber' : 'YK_ATO10',
		'OrganizationCode' : 'M1',
		'ProductionPriority' : '1',
		'VersionNumber' : 1,
		'WorkMethodCode' : 'DISCRETE_MANUFACTURING',
		'ItemStructureName' : 'Primary',
		'WorkDefinitionCode' : 'KB_REST_001',
		'operations': [{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber': 10,
			'OperationType': 'IN_HOUSE',
			'OperationName': 'Assembly',
			'OperationDescription': 'Assembly',
			'WorkCenterCode': 'MFGASSY1',
			'CountPointOperationFlag': 'N',
			'AutoTransactFlag': 'Y'
		},
		{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber': 20,
			'OperationType': 'IN_HOUSE',
			'OperationName': 'Inspection',
			'WorkCenterCode': 'Line1',
			'StandardOperationCode': 'Inspection',
			'CountPointOperationFlag': 'Y',
			'AutoTransactFlag': 'N'
		},
		{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber': 30,
			'OperationType': 'SUPPLIER',
			'OperationName': 'Pack',
			'WorkCenterCode': 'MFGASSY1',
			'StandardOperationCode': 'MFG-SO1',
			'CountPointOperationFlag': 'Y',
			'AutoTransactFlag': 'N'
		}],
		'resources': [{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber':10,
			'ResourceSequenceNumber':10,
			'ChargeType' : 'AUTOMATIC',
			'ResourceCode':'MFGLABOUR-C'
		},
		{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber':10,
			'ResourceSequenceNumber':20,
			'ChargeType' : 'AUTOMATIC',
			'ResourceCode':'MFGLABOUR-NC'
		}],
		'ATOMaterials': [{
			'ActionCode': 'CREATE',
			'MaterialSequenceNumber':10,
			'ComponentHierarchy': 'YK_ATO10',
			'OperationSequenceNumber':10,
			'ItemNumber': 'YK_TMC1',
			'StartDate' : '2019-03-12T15:46:10'
		},
		{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber':20,
			'MaterialSequenceNumber':10,
			'ItemNumber': 'YK_ODMC3',
			'ComponentHierarchy': 'YK_ATO10> YK_OC2',
			'StartDate' : '2019-03-12T15:46:10'
		},
		{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber':20,
			'MaterialSequenceNumber':20,
			'ItemNumber': 'YK_C13',
			'ComponentHierarchy': 'YK_ATO10> YK_OC2> YK_OP22> YK_Ph22> YK_Ph1',
			'StartDate' : '2019-03-12T15:46:10'
		},
		{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber':30,
			'MaterialSequenceNumber':10,
			'ItemNumber': 'YK_C4',
			'ComponentHierarchy': 'YK_ATO10> YK_OC2> YK_OP22> YK_Ph22> YK_Ph2',
			'StartDate' : '2019-03-12T15:46:10'
		}]
	}]
}

Example Response

Here's an example of the response body in JSON format.

{
	'SourceSystemCode': null,
	'SourceSystemType': 'EXTERNAL',
	'ErrorsExistFlag': 'false',
	'workDefinitionHeaders': [
	{
		'ActionCode': 'CREATE',
		'ErrorMessages': '',
		'ErrorMessageNames': '',
		'OrganizationCode': 'V1',
		'ItemNumber': 'AS54888',
		'ItemStructureName': null,
		'WorkDefinitionCode': 'Primary',
		'VersionNumber': '1',
		'StartDate': '2018-11-24T02:48:41.275+00:00',
		'ProductionPriority': 1,
		'CostingPriority': null,
		'CostingBatchOutputSize': null,
		'SerialTrackingFlag': null,
		'TransformFromItemNumber': null,
		'CompletionSubinventoryCode': null,
		'CompletionLocator': null,
		'WorkMethodCode': 'DISCRETE_MANUFACTURING',
		'WorkDefinitionId': 14004,
		'BatchQuantity': null,
		'BatchUOMCode': null,
		'ProcessName': null,
		'StatusCode': null,
		'MaintenanceCode': null,
		'MaintenanceName': null,
		'MaintenanceDescription': null,
		'resources': [
		{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber': 10,
			'ResourceSequenceNumber': 10,
			'ResourceCode': 'MFGPACKINGLABOUR-C',
			'AssignedUnits': null,
			'BasisType': null,
			'UsageRate': null,
			'InverseUsageRate': null,
			'ScheduledIndicator': 'NO',
			'PrincipalFlag': null,
			'ChargeType': 'AUTOMATIC',
			'ResourceActivityCode': null,
			'ErrorMessages': '',
			'ErrorMessageNames': '',
			'links': [
			{
				...
				]
			},
			{
				'ActionCode': 'CREATE',
				'OperationSequenceNumber': 20,
				'ResourceSequenceNumber': 10,
				'ResourceCode': 'MFGPACKINGLABOUR-NC',
				'AssignedUnits': null,
				'BasisType': null,
				'UsageRate': null,
				'InverseUsageRate': null,
				'ScheduledIndicator': 'NO',
				'PrincipalFlag': null,
				'ChargeType': 'AUTOMATIC',
				'ResourceActivityCode': null,
				'ErrorMessages': '',
				'ErrorMessageNames': '',
				'links': [
				{
					...
					]
				}
				],
				'materials': [
				{
					'ActionCode': 'CREATE',
					'ErrorMessages': '',
					'ErrorMessageNames': '',
					'OperationSequenceNumber': 10,
					'MaterialSequenceNumber': 10,
					'ItemNumber': 'SB32982',
					'BasisType': null,
					'Quantity': null,
					'InverseQuantity': null,
					'UOMCode': null,
					'YieldFactor': null,
					'SupplyType': null,
					'SupplySubinventory': null,
					'StartDate': null,
					'AdhocItemFlag': true,
					'SupplyLocator': null,
					'links': [
					...
					]
				},
				{
					'ActionCode': 'CREATE',
					'ErrorMessages': '',
					'ErrorMessageNames': '',
					'OperationSequenceNumber': 10,
					'MaterialSequenceNumber': 20,
					'ItemNumber': 'MFG-WD-OPTION-ITEM1',
					'BasisType': null,
					'Quantity': null,
					'InverseQuantity': null,
					'UOMCode': null,
					'YieldFactor': null,
					'SupplyType': null,
					'SupplySubinventory': null,
					'StartDate': null,
					'AdhocItemFlag': true,
					'SupplyLocator': null,
					'links': [
					...
					],
					'operations': [
					{
						'ActionCode': 'CREATE',
						'ErrorMessages': '',
						'ErrorMessageNames': '',
						'OperationSequenceNumber': 10,
						'StandardOperationCode': null,
						'ReferencedFlag': null,
						'OperationType': 'IN_HOUSE',
						'OperationName': 'Op1',
						'OperationDescription': null,
						'WorkCenterCode': 'MFGPACKING1',
						'CountPointOperationFlag': true,
						'AutoTransactFlag': false,
						'SerialTrackingFlag': null,
						'OSPItemNumber': null,
						'SupplierName': null,
						'SupplierSiteCode': null,
						'ShippingDocumentsFlag': null,
						'LeadTimeUnitOfMeasure': null,
						'FixedLeadTime': null,
						'VariableLeadTime': null,
						'OptionDependentFlag': null,
						'PlanningPercent': null,
						'LeadTimePercent': null,
						'AddlMtlAtManualIssue': null,
						'OperationComplWithUnderIssue': null,
						'OperationComplWithOpenExceptions': null,
						'links': [
						...
						]}
					]
				}
			}
		}
	}
}

Update a Work Definition

When James wants to update an existing work definition, he can use the POST operation in the workDefinitionRequests service. In this scenario, James updates the work definition by changing the start date and adding an additional operation and resource using the POST operation.

Note:

The POST operation is also used to update because the POST operation adds the data to the interface tables for processing. The ActionCode included in the payload indicates whether the work definition should be created or updated.

Example URL

Use this resource URL format.

POST

curl -u username:password -X POST -H 'Content-Type:application/vnd.oracle.adf.resourceitem+json' -d 'request payload' 
'https://servername/fscmRestApi/resources/version/workDefinitionRequests'

Example Request

Here's an example of the request body in JSON format.

{
	'SourceSystemType': 'EXTERNAL',
	'workDefinitionHeaders': [{
		'ActionCode' : 'UPDATE',
		'ItemNumber' : 'MFG PRODUCT',
		'OrganizationCode' : 'M1',
		'CompletionSubinventoryCode' : 'Stores',
		'VersionNumber' : 1001,
		'WorkMethodCode' : 'DISCRETE_MANUFACTURING',
		'WorkDefinitionCode' : 'Primary',
		'ProductionPriority' : 1,
		'StartDate':'2019-07-24T02:48:41.275+00:00',
		'operations': [{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber': 30,
			'OperationName': 'Op3',
			'OperationType': 'IN_HOUSE',
			'CountPointOperationFlag': 'Y',
			'AutoTransactFlag': 'N',
			'WorkCenterCode': 'MFGQA1' 
		}],
		'resources': [{
			'ActionCode': 'CREATE',
			'ResourceSequenceNumber':10,
			'OperationSequenceNumber':30,
			'ResourceCode':'MFGADHOCLAB-C'
		}]
	}]
}

Example Response

Here's an example of the response body in JSON format.

{
	'SourceSystemCode': null,
	'SourceSystemType': 'EXTERNAL',
	'ErrorsExistFlag': 'false',
	'workDefinitionHeaders': [
	{
		'ActionCode': 'UPDATE',
		'ErrorMessages': '',
		'ErrorMessageNames': '',
		'OrganizationCode': 'M1',
		'ItemNumber': 'MFG PRODUCT',
		'ItemStructureName': null,
		'WorkDefinitionCode': 'Primary',
		'VersionNumber': '1001',
		'StartDate': '2019-07-24T02:48:41.275+00:00',
		'ProductionPriority': 1,
		'CostingPriority': null,
		'CostingBatchOutputSize': null,
		'SerialTrackingFlag': null,
		'TransformFromItemNumber': null,
		'CompletionSubinventoryCode': 'Stores',
		'CompletionLocator': null,
		'WorkMethodCode': 'DISCRETE_MANUFACTURING',
		'WorkDefinitionId': 2002,
		'BatchQuantity': null,
		'BatchUOMCode': null,
		'ProcessName': null,
		'StatusCode': null,
		'MaintenanceCode': null,
		'MaintenanceName': null,
		'MaintenanceDescription': null,
		'resources': [
		{
			'ActionCode': 'CREATE',
			'OperationSequenceNumber': 30,
			'ResourceSequenceNumber': 10,
			'ResourceCode': 'MFGADHOCLAB-C',
			'AssignedUnits': null,
			'BasisType': null,
			'UsageRate': null,
			'InverseUsageRate': null,
			'ScheduledIndicator': 'NO',
			'PrincipalFlag': null,
			'ChargeType': 'AUTOMATIC',
			'ResourceActivityCode': null,
			'ErrorMessages': '',
			'ErrorMessageNames': '',
			'links': [
			{
				...
			}
			]
		}
		],
		'operations': [
		{
			'ActionCode': 'CREATE',
			'ErrorMessages': '',
			'ErrorMessageNames': '',
			'OperationSequenceNumber': 30,
			'StandardOperationCode': null,
			'ReferencedFlag': null,
			'OperationType': 'IN_HOUSE',
			'OperationName': 'Op3',
			'OperationDescription': null,
			'WorkCenterCode': 'MFGQA1',
			'CountPointOperationFlag': true,
			'AutoTransactFlag': false,
			'SerialTrackingFlag': null,
			'OSPItemNumber': null,
			'SupplierName': null,
			'SupplierSiteCode': null,
			'ShippingDocumentsFlag': null,
			'LeadTimeUnitOfMeasure': null,
			'FixedLeadTime': null,
			'VariableLeadTime': null,
			'OptionDependentFlag': null,
			'PlanningPercent': null,
			'LeadTimePercent': null,
			'AddlMtlAtManualIssue': null,
			'OperationComplWithUnderIssue': null,
			'OperationComplWithOpenExceptions': null,
			'links': [
			{
				...
			}
			]
		}
		],
		'links': [
		{
			...
		}
		]
	}
	],
	'links': [
	{
		...
	}
	]
}