Using the Production Order Manager — Example
The production order manager used by the work instructions building block is specified in the DefaltGlobalManagerConfiguration configuration table on Configuration page of the PTC.Base.Manager Thing. The default production order manager Thing (PTC.SCA.SCO.DefaultProductionOrderManager) inherits the job order manager Thing Template (PTC.SCA.SCO.JobOrderManagerThingTemplate). The job order manager Thing Template holds necessary functions for database manipulation, and implements all the Thing Shapes responsible for managing the services related to the object models. These services allow the user to interact with the configured database by using create, get, update, and delete services for the database, as well as for the object models.
The following example shows how job orders can be created, retrieved, updated, and deleted using services found under Services on the default production order manager Thing (PTC.SCA.SCO.DefaultProductionOrderManager).
The following steps assume that the CreateTables service has already been executed.
CreateJobOrders
Using the CreateJobOrders service, you can create multiple job orders by adding them to the JobOrders input parameter table. You can fill out as many or as few fields as needed for each job order.
|
When creating job orders (or any object that is part of the work instructions building block data model), the UID value is automatically generated by the system. Any value you enter in the UID field is ignored.
|
Once you execute the CreateJobOrders service, it returns the list of entities that were created and added to the database, along with their UIDs.
| On an SQL Server database, create and update services return only the UID of the entities that were created. |
GetJobOrder and GetJobOrders
Use the GetJobOrder service to retrieve individual job orders for viewing. Providing the UID of 1 returns the job order created in the previous section.
Alternatively, you can use the GetJobOrders service to retrieve all job orders in the database, including their UIDs. A filter can be applied with an offset and a limit to narrow the list of returned results.
UpdateJobOrders
Job orders can be updated using the UpdateJobOrders service. Enter the UID for the job order to be updated, then enter the new value for the fields to be updated. Leave other fields blank. Multiple job orders can be updated by adding them to the JobOrders input parameter table.
The service returns the list of updated job orders.
DeleteJobOrder
You can delete any previously created job order using the DeleteJobOrder service, and providing the UID of the job order to be deleted.
Attempting to retrieve a deleted (or non-existent) job order yields an empty result table.