Customizing Operator Advisor > Setting and Using Work Definition Execution Statuses
Setting and Using Work Definition Execution Statuses
Execution statuses provide insight into the progress status of a work definition that is being executed as part of a job order. Operator Advisor provides a basic set of execution statuses for work definitions which you can customize for your business needs:
Planned
Running
Held
Canceled
Completed
Services are available on the default production order manager Thing (PTC.SCA.SCO.DefaultProductionOrderManager) to create new statuses, update or delete existing statuses, retrieve individual statuses, or retrieve the list of all statuses. Operator Advisor also provides services to retrieve the change log of execution statuses for a work definition, and provide a summary of the time spent in each status.
* 
Three additional execution statuses are used by the work definition converter services to allow the progress of process plan conversion to be monitored:
Building—The process plan conversion is still in process.
BuildingSuccess—The process plan conversion has completed successfully.
BuildingFailure—Errors were encountered in the process plan conversion.
Do not delete or update these three statuses.
For long running conversion processes, you can query for the root work definition to see its execution status, using either the GetWorkDefinition service or the PostgresDatabase Query service.
Creating Work Definition Execution Statuses
Using the CreateWorkDefinitionExecutionStatuses service, you can create multiple work definition execution statuses by adding them to the WorkDefinitionExecutionStatuses input parameter table.
* 
When creating work definition execution statuses (or any object that is part of the Operator Advisor 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 CreateWorkDefinitionExecutionStatuses service, it returns the list of work definition execution statuses that were created, along with their UIDs.
Retrieving Work Definition Execution Statuses
Using the GetWorkDefinitionExecutionStatus service, individual work definition execution statuses can be retrieved for viewing by entering the UID of the status in the UID input parameter.
Alternatively, you can use the GetWorkDefinitionExecutionStatuses service to retrieve all work definition execution statuses in the database, including their UIDs.
Updating Work Definition Execution Statuses
The names of existing work definition execution statuses can be updated using the UpdateWorkDefinitionExecutionStatuses service. In the WorkDefinitionExecutionStatuses input parameter table, enter the UID for the work definition execution status to be updated, and then enter the new Name value for the status. Executing the service returns the list of work definition execution statuses that were updated, along with their UIDs.
Deleting Work Definition Execution Statuses
You can delete any previously created work definition execution status using the DeleteWorkDefinitionExecutionStatus service, and providing the UID of the work definition execution status to be deleted. Attempting to retrieve a deleted (or non-existent) work definition status yields an empty result table.
* 
Exercise caution when deleting work definition execution statuses. The system does not prevent you from deleting a work definition execution status that is already in use or has been used.
Viewing the Execution Status Change Log
You can view the execution status change log for a work definition using the GetWorkDefinitionExecutionLog service. Enter the UID of the work definition for the WorkDefinitionUID input parameter. The results returned provide the UID and name of the execution status, timestamp of the status change, and the name of the user who made the change.
Viewing the Execution Summary
You can view a summary of the total time spent in each execution status for a work definition using the GetWorkDefinitionExecutionSummary service. Enter the UID of the work definition for the WorkDefinitionUID input parameter. To include a calculation of the time spent in the current status, select True for IncludeCurrentStatus.
The results returned provide the UID and name of the execution status, and the total time (in seconds) spent in that status.
Validating Work Definition Execution Statuses
If you specify an execution status when creating or updating a work definition, Operator Advisor validates that the specified status exists before allowing the create or update action to complete. For more information, see Pre- and Post-Action Event Dispatching and Validation.
Was this helpful?