Skip to end of metadata
Go to start of metadata

Description

A component that displays all the available work orders in a table and calculates the units produced, scheduled and remaining for each work order. All work orders are automatically displayed from the "WorkOrder" database table within the date range of From Date and To Date properties without the need for custom SQL statements or script. 

Work Order Table


The users can click on a checkbox in the Closed column to close out a work order. After it is closed out, it will no longer show in the Work Order Table component and it will not be available in any other work order selector components. This feature is provided because some production runs may finish before the target number of units are produced due to lack of raw materials, change in production priorities, etc.


Component Palette

See Work Order Management page for various MES Work Order Table settings.

Info

The materials actually do not need to be in the material root class, it is just that work orders will currently not appear in the table unless there exists a material property that references the Work Order material and there exists an equipment property with the same parent as the material property. Essentially what this means is that a Work Order will not appear unless there is a segment defined that refers to the Work Order material. If you create materials and work orders through scripting and set up operations for them using Track and Trace, you should see the work orders appear in the table. You should also be able to update the quantities and schedule runs just with Track and Trace.

 

Non-OEE materials can be selected using Work Order component and the table will be updated such that the material/equipment property restrictions are not enforced unless the user is explicitly trying to filter on the equipment path. By default, the work order has a material set in order to be displayed in the table. This will be compatible with all types of filtering on the Work Order table except equipment path. Once you add in a non-blank "Equipment Path Filter", the work orders will only appear if there exists a segment which maps the Work Order material to a piece of equipment that matches the equipment path filter.


Features

Drag & Drop Scheduling

You can drag rows from a power table or this component to simplify work order scheduling. In order to perform drag and drop, you must enable the Row Dragging Enabled property of the power table.

StepDescription
1

Set the Row Dragging Enabled property of the MES Work Order Table to True in the designer.

2

Select the desired row in the work order table or power table and drag it onto the equipment item you wish to schedule it for on the MES Schedule View component.

In this example Line 1 production item is configured for Cane Sugar. A scheduling window will appear as shown.


3
Provide the duration or the production count of the schedule. Select the Schedule tab to view the new schedule. Click Save.
4

The schedule entry you just created will be displayed as shown.



Component Properties

Properties are provided that can be set to affect the operation and look of the component. They can be set through the Property Editor in the Designer or through scripting.

Example
event.source.parent.getComponent('MES Work Order Table').rowDragEnabled = True

 Behavior
NameScriptingProperty TypeDescription
User Menu ItemsuserMenuItemsDatasetDataset that stores user menu items.
Enable AddEnableAddbooleanIf true, allows the user to add work orders.
Enable EditEnableEditbooleanIf true, allows the user edit work orders.
Enable ExportEnableExportbooleanIf true, allows the user export work orders 
Row Dragging EnabledrowDragEnabledbooleanIf true, allows a row to dragged from this component to others.
 Data
NameScriptingProperty TypeDescription
Material Name FiltermaterialNameFilterStringMaterial name filter, that can include * and ? wildcard characters, to filter the work orders by.
Work Order Name FilterworkOrderNameFilterStringWork order name filter, that can include * and ? wildcard characters, to filter the work orders by.
Equipment Path FilterequipmentPathFilterStringEquipment path filter, that can include * and ? wildcard characters, to filter the work orders by.
Closed Start DateclosedStartDateDateStart date to get work orders for if Show Closed Work Order property is true.
Closed End DateclosedEndDateDateEnd date to get work orders for if Show Closed Work Order property is true.
Show Closed Work OrdershowClosedWorkOrderbooleanIf true, show closed work orders.
Column Attribute DatacolumnAttributesDataDatasetDataset describing the data attributes.
DatadataDatasetData for this table.
Selected RowselectedRowintIndex of the first selected row, or -1 if none.
 Appearance
NameScriptingProperty Type

Description

FontfontFontFont of text of this component.
Foreground Colorforeground ColorColorForeground color of the component.
Background ColorbackgroundColorColorBackground color of the component.
Title FonttitleFontFontFont to use for the title.
Title Foreground ColortitleForegroundColorForeground color of the title bar.
Title Background ColortitleBackgroundColorBackground color of the title bar.
Header FontheaderFontFontFont to use for the table header.
Header Background ColorheaderBackgroundColorBackground color of the table header.
Table Background ColortableBackgroundColorBackground color of the table body.
Header Foreground ColorheaderForegroundColorForeground color of the table header.
Row FontrowFontFontFont to use for the elements in the row.
Row Foreground ColorrowForegroundColorForeground color of rows in the table.
Row Background ColorrowBackgroundColorBackground color of rows in the table.
Row Selection Foreground ColorselectionForegroundColorForeground color of a selected row in the table.
Row Selection Background ColorselectionBackgroundColorBackground color of a selected row in the table.
Auto Row Height EnabledautoRowHeightEnabledbooleanIf true, the row height of the table will be adjusted automatically.
Row HeightrowHeightintHeight of each row of the table.
Grid Line ColorgridColorColorColor of grid lines in the table.
Show Horizontal Grid LinesshowHorizontalLinesbooleanDetermines whether horizontal grid lines are shown in the table.
Show Vertical Grid LinesshowVerticalLinesbooleanDetermines whether vertical grid lines are shown in the table.


Event Handlers

Event handlers provide the ability to add custom script when a user interacts with a component such as by selecting a menu item or when a component property changes.

 propertyChange
 propertyChange

Fires whenever a bindable property of the source component changes. This works for standard and custom (dynamic) properties.

PropertyDescription
.sourceThe component that fired this event.
.newValueThe new value that this property changed to.
.oldValueThe value that this property was before it changed. Note that not all components include an accurate oldValue in their events.
.propertyNameThe name of the property that changed. NOTE: Remember to always filter out these events for the property that you are looking for! Components often have many properties that change.
 userMenu
 userMenuItemClicked

When the user right clicks on the schedule component, a popup menu is displayed. Custom user menu items can be added to this popup menu by adding rows to the User Menu Items dataset.

The UserMenuItemClicked event is fired when the menu item is clicked, or if the user selects the menu item using the keyboard and presses the Enter key. It can also occur if an access key or shortcut key is pressed that is associated with the MenuItem.

For various methods associated with this event, see Work Order User Menu Event.

PropertyDescription
sourceThe component that fired this event.
 getMenuItemName()
Description

Returns the name of the selected menu item.

Syntax

 getMenuItemName()


  • Parameters

None

  • Returns

String itemName - The name of the selected menu item.

Returns the name of the selected menu item.


 getWorkOrder()
Description

Return the MESWorkOrder object.

Syntax

getWorkOrder()


  • Parameters

None

  • Returns

MES Work Order -  The work order associated with this event.

Returns the MES Work Order object containing details about the quantity, due date, etc.

Add custom menu items in the Dataset viewer for the Work Order Table's User Menu Items property.


Code Example 1
Code Snippet
if event.getMenuItemName() == "Details":
 wo = event.getWorkOrder()
 print wo
 print wo.getWorkOrderQuantity()
 print wo.getDueDate()
 print wo.getMaterialRef()
 print wo.getMaterialRefName() 
WorkOrder (c70b6c34-8f19-440c-b166-c33a1a5f98dc, N3344 (2), 0 parents, 0 children, 0 custom properties, 0 complex properties)
50.0
2017-04-12 10:49:49.0
(type: Material Definition,  uuid: e6daa5f1-07cc-4863-b3b3-0d560c514c63)
Salt
Code Example 2
Code Snippet
if event.getMenuItemName() == 'Associate Material Lots':
	 woObj = event.getWorkOrder()
	 #Add Material lots to be used for this Work Order as a custom property
	 parentPath = 'Required Material Lots' 
	 dataType = 'String'
	 description = ''
	 units = ''
	 productionVisible = True
	 required = False
	 
	 #Add Required Material Lots custom property directly to the MES object
	 woObj.addCustomProperty(parentPath, dataType, 'Lots To Be Used', '', productionVisible, required)
	 
	 name = 'First Lot'
	 value = 'A1000'	
	 woObj.addCustomProperty(parentPath, name, dataType, description, units, productionVisible, required, value)
	 
	 name = 'Second Lot'
	 value = 'B1000'	
	 woObj.addCustomProperty(parentPath, name, dataType, description, units, productionVisible, required, value)
	 
	 print woObj.getCustomPropertiesFull()
	 system.mes.saveMESObject(woObj)
elif event.getMenuItemName() == 'Get Material Lots':
	 woObj = event.getWorkOrder()
	 print woObj.getCustomPropertiesFull()
	 print wObj
	 print wObj.getWorkOrderQuantity()
	 print wObj.getDueDate()
	 print wObj.getMaterialRef()
	 print wObj.getMaterialRefName()  

{u'Required Material Lots.First Lot': [u'String', u'A1000', u'', u'', True, False], u'Required Material Lots.Second Lot': [u'String', u'B1000', u'', u'', True, False], u'Required Material Lots': [u'String', u'', u'Lots To Be Used', u'', True, False]}




Extension Functions

 initialize
  • Description

Called when the window containing this table is opened, or the template containing it is loaded. Provides a chance to initialize the table further, for example, selecting a specific row.

  • Parameters

self - A reference to the component that is invoking this function.

  • Return

Nothing

  • Scope

Client

 configureHeaderStyle
  • Description

Provides a chance to configure the style of each column header. Return a dictionary of name-value pairs with the desired attributes. Available attributes include: 'font', 'foreground', 'background', 'border', 'toolTipText'.

  • Parameters

self - A reference to the component that is invoking this function.

colIndex - The index of the column in the underlying dataset.

colName - Name of the column in the underlying dataset.

  • Return

Nothing

  • Scope

Client

Code Example
from java.awt import Font
from java.awt import Color
from javax.swing.border import MatteBorder
return { 'font': Font('Dialog', Font.PLAIN, 12), 
	'foreground': Color.BLUE, 
	'background': Color.YELLOW, 
	'border': MatteBorder(1, 1, 1, 1, Color(238, 236, 232)), 
	'toolTipText': colName } 
 isRowEditable
  • Description

Returns a boolean that determines whether or not the current row is editable.

  • Parameters

self - A reference to the component that is invoking this function.

mesWorkOrder - The MESWorkOrder object itself.

  • Return

True

  • Scope

Client

 isRowDeletable
  • Description

Returns a boolean that determines whether or not the current row is deletable.

  • Parameters

self - A reference to the component that is invoking this function.

mesWorkOrder - The MESWorkOrder object itself.

  • Return

True

  • Scope

Client

 onRowEdited
  • Description

Called when the user has edited a row in the table.

  • Parameters

self - A reference to the component that is invoking this function.

mesWorkOrder - The MESWorkOrder object itself.

  • Return

None

  • Scope

Client

 onRowDeleted
  • Description

Called when the user has deleted a row in the table.

  • Parameters

self - A reference to the component that is invoking this function.

mesWorkOrder - The MESWorkOrder object itself.

  • Return

None

  • Scope

Client

 onColumnsCreate
  • Description

Called when columns are created in the table. Provides a chance to add custom columns to the table.

  • Parameters

self - A reference to the component that is invoking this function.

  • Return

Returns a dictionary of custom column name-type pairs.

  • Scope

Client

 onRowAdd
  • Description

Called when a row is added in the table. Provides a chance to insert values to custom columns in the table.

  • Parameters

self - A reference to the component that is invoking this function.

mesWorkOrder - The MESWorkOrder object itself.

  • Return

Returns a dictionary of custom column name-value pairs.

  • Scope

Client

 onMousePress
  • Description

Called when the user clicks on a table cell.

  • Parameters

self - A reference to the component that is invoking this function.

rowIndex - Index of the row, starting at 0, relative to the underlying dataset.

colIndex - Index of the column starting at 0, relative to the underlying dataset.

colName - Name of the column in the underlying dataset.

value - The value at the location clicked on.

event - The MouseEvent object that caused this press event.

  • Return

Nothing

  • Scope

Client

 onDoubleClick
  • Description

Called when the user double-clicks on a table cell.

  • Parameters

self - A reference to the component that is invoking this function.

rowIndex - Index of the row, starting at 0, relative to the underlying dataset.

colIndex - Index of the column starting at 0, relative to the underlying dataset.

colName - Name of the column in the underlying dataset.

value - The value at the location clicked on.

event - The MouseEvent object that caused this double-click event.

  • Return

Nothing

  • Scope

Client

 onPopupTrigger
  • Description

Called when the user right-clicks on a table cell. This would be the appropriate time to create and display a popup menu.

  • Parameters

self - A reference to the component that is invoking this function.

rowIndex - Index of the row, starting at 0, relative to the underlying dataset.

colIndex - Index of the column starting at 0, relative to the underlying dataset.

colName - Name of the column in the underlying dataset.

value - The value at the location clicked on.

event - The MouseEvent object that caused this popup trigger event.

  • Return

Nothing

  • Scope

Client

 onRowsDropped
  • Description

Called when the user has dropped rows on this table. Note that the rows may have come from this table or another table. The source table must have dragging enabled.

  • Parameters

self - A reference to the component that is invoking this function.

sourceTable - A reference to the table that the rows were dragged from. Will be equal to 'self' if the rows were dragged and dropped in the same table.

rows - An array of the row indices that were dragged, in the order they were selected.

rowData - A dataset containing the rows that were dragged.

dropIndexLocation - Row index where the rows were dropped.

  • Return

Nothing

  • Scope

Client

Code Example
	if sourceTable.getName() == 'ERP Work Order Table':	#Name of the Power table that the Work Orders come from
 
 		for row in range(rowData.rowCount):
 			#Assuming this is the order of data in the ERP Power Table
			woName = rowData.getValueAt(row,0)
			prodCode = rowData.getValueAt(row,1)
			qty = rowData.getValueAt(row,2)
			dueDate = rowData.getValueAt(row,3)
			
			#Check if Work order already exists before we create it again
			woFilter = system.mes.workorder.createMESWorkOrderFilter()
			woFilter.setWorkOrderNameFilter(woName)
			results = system.mes.workorder.getMESWorkOrders(woFilter)
			if len(results) == 0:
				#Given a work order name, create the work order and then save the work order to manifest the change.
				matLink = system.mes.getMESObjectLinkByName('MaterialDef', prodCode)
				woObj=system.mes.workorder.createMESWorkOrder(woName, matLink)
				
				#Set some production related properties
				woObj.setWorkOrderQuantity(qty)
				
				woObj.setDueDate(dueDate)
				
				system.mes.saveMESObject(woObj)
			else:
				system.gui.messageBox(woName + " already exists") 
 configureCell
  • Description

Provides a chance to configure the contents of each cell. Returns a dictionary of name-value pairs with the desired attributes. Available attributes include 'background', 'border', 'font', 'foreground', 'horizontalAlignment', 'iconPath', 'text', 'toolTipText' and 'verticalAlignment'.

You may also specify the attribute 'rendered' which is expected to be a javax.swing.JComponent that will be used to render the cell.

  • Parameters

self - A reference to the component that is invoking this function.

value - The value in the dataset at this cell.

textValue - The text the table expects to display at this cell (may be overridden by including 'text' attribute in returned dictionary).

selected - A boolean indicating whether this cell is currently selected.

rowIndex - The index of the row in the underlying dataset.

colIndex - The index of the column in the underlying dataset.

colName - Name of the column in the underlying dataset.

rowView - The index of the row, as it appears in the table view (affected by sorting).

colView - The index of the column, as it appears in the table view (affected by column re-arranging and hiding).

  • Return

Nothing

  • Scope

Client

Code Example
# This example adds alternating background color:
if selected:
	return {'background': self.selectionBackground}
elif rowView % 2 == 0:
	return {'background': 'white'}
else:
	return {'background': '#DDDDDD'}




Custom Methods

Custom methods allow you to add your own component functions to a component that can be called through scripting. This is a useful and clean method of re-using script that is specific to the component (say you want to update a visual aspect of the component in the same way whether a user clicks on the component or a window property value changes). See Component Custom Methods in the Ignition Help Manual for more information.




Customizers

Table Customizer

Table Customizer manages the data entered into the MES Work Order Table. It will allow you to modify the data which is stored inside the MES Work Order Table. Thus the formatting and alignments are made easy.

Column Configuration

Header - Provide a custom name to the column header.

Hide? - Hides the column.

Editable - Allows the editing of the cell pertaining to the column.

Sortable - To make a column filter the data on user's demand.

Sortable - Allows the user to sort the table according to the selected column.

Horiz Align - Aligns the contents of the column.

Vert Align - Aligns the contents of the column.

Wrap Text? - Data in the cell wraps to fit the column width. When you change the column width, data wrapping adjusts automatically.

Prefix - A custom text that proceeds the contents of each cell.

Suffix - A custom text that follows the contents of each cell.

Number Format - A format of the cell is the contents of the cell are number types.

Date Format -  Used if the contents of the cell are date types.

Boolean? - Changes the contents of the cell to reflect a 'check box' look and feel.

Custom Properties

The custom properties can be used to add user defined properties.





Component Functions

This component does not have functions associated with it.



Component Objects

 Work Order User Menu Event

Description

This object is used with userMenuItemClicked event handler for MES Work Order Table component.

Methods:


 getMenuItemName()
Description

Returns the name of the selected menu item.

Syntax

 getMenuItemName()


  • Parameters

None

  • Returns

String itemName - The name of the selected menu item.

 getWorkOrder()
Description

Return the MESWorkOrder object.

Syntax

getWorkOrder()


  • Parameters

None

  • Returns

MES Work Order -  The work order associated with this event.

  • No labels