Customization > Action Customization > Windchill Action Framework > Defining a New Custom Action Model
Defining a New Custom Action Model
Action models are defined in an XML file that follows the structure based on <WT_HOME>/codebase/config/actions/customActionmodels.dtd.
Here is a simple example of an action model definition used for the folder browser toolbar:
<!-- default toolbar for the Folder page -->
<model name="folder_list_toolbar">
<action name="list_cut" type="object"/>
<action name="list_copy" type="object"/>
<action name="fbpaste" type="object"/>
<action name="pasteAsCopy" type="saveas"/>
<action name="list_paste_sharing" type="folder"/>
<action name="list_delete" type="object"/>
<action name="CONTAINERMOVE" type="pdmObject"/>
<action name="PAGERELOADINGMULTICHECKOUT" type="folder"/>
<action name="WFADDTOWORKSPACE" type="folder"/>
<action name="separator" type="separator"/>
<action name="create" type="folder"/>
<action name="create" type="document"/>
<action name="createMulti" type="document"/>
<action name="createPartWizard" type="part"/>
<action name="createMultiPart" type="part"/>
<action name="add_link" type="bookmark"/>
<action name="create" type="problemReport"/>
<action name="create" type="changeRequest"/>
<action name="create" type="changeNotice"/>
<action name="separator" type="separator"/>
</model>
The type is a way to create a name space as well as packaging for actions related to a specific object or functional area. In the above example, the type “document” creates a unique name space for actions that apply to wt.doc.WTDocument.
It is also possible to create an action model which itself references another action model. The folder browser Actions menu contains a submodel for the New group of actions. For example, the action model for the New group of actions might be defined as follows:
<model name="folder_file_new" resourceBundle="com.ptc.core.ui.tableRB">
<action name="create" type="document" resourceBundle="com.ptc.core.ui.tableRB" />
<!-- More actions here --!>
</model>
Then, in the action model for the Actions menu, include the submodel “folder_file_new”:
<model name="folder_file">
<submodel name="folder_file_new"/>
<action name="create" type="document"/>
<!-- More actions here --!>
</model>
See the figure below for how this appears in the user interface:
Model Attributes
Details about these parameters can also be found in the <WT_HOME>/codebase/config/actions/customActionmodels.dtd.
Parameter
Default Value
Possible values
Req?
Description
name
Yes
This is the name by which the action model is referenced. This can be any combination of alpha-numeric characters. Most action model names include the component that they are used in. Your action models should have a prefix specific to your company to prevent collisions with other action models delivered with the product.
menufor
Any valid class name.
No
Specifies which action should be highlighted by default. This is only applicable if the model is used as a third-level navigation menu.
defaultActionName
First action in the model is used by default
Action name for one of the actions in the model.
Specifies which action should be highlighted by default. This is only applicable if the model is used as a third-level navigation menu.
defaultActionType
First action in the model is used by default
Object type of one of the actions in the model.
resourceBundle
Class name for the resource bundle to use for the properties of the action models that are to be localized.
incremental
The presence of this parameter is interpreted as incremental=true
No
This parameter is applicable only for customizing an OOTB action model. It is used to indicate that this action model definition is to be merged with an existing action model. For example: <model name="relatedDocPartDescribesToolBar" incremental="">
* 
When you use the incremental attribute in the action model element, no other attribute other than name is allowed. An incremental attribute is mandatory when you want to update an OOTB action model definition. Do not use the incremental attribute with new action model definitions.
Action Attributes in an Action Model definition
Details about these parameters can also be found in <WT_HOME>/codebase/config/actions/customActionmodels.dtd.
Parameter
Possible Values
Req?
Description
name
Name of any action defined in an custom-actions.xml file
Yes
This is the name of an action defined in an custom-actions.xml file.
type
Name of any objecttype defined in an acustom-actions.xml file
Yes
This is the name of an object type defined in an custom-actions.xml file.
shortcut
true
false
No
This determines whether an action is displayed as a shortcut icon in the toolbar.
insertAt
number
No
This is the position where the new custom action should be inserted in the existing list of actions or submodels.
insertAfterActionName
Name of an action
No
This is the position after the action or submodel, where the new custom action should be inserted in the existing list of actions or submodels.
insertAfterObjectType
Name of the object type of the above action
No
This is the name of the object type associated with the above action.
insertBeforeActionName
Name of an action
No
This is the position before the action or submodel, where the new custom action should be inserted in the existing list of actions or submodels.
insertBeforeObjectType
Name of the object type of the above action
No
This is the name of the object type associated with the above action.
* 
Icons in the actions menu (or menu bar menus) for any icon which is not contained in a toolbar somewhere else in the system will be hidden.
The name of the model is used by the actions framework to determine whether it is a toolbar. Therefore, the name of a model used as a toolbar must contain “toolbar.”
If the toolbar model naming convention is not followed, the icons will not be displayed as expected. However, the functionality will not break.
Commonly used shortcut actions (recommended maximum up to five) can be configured to appear on a toolbar shortcut area using a shortcut attribute. Example configuration for folder browser table:
<model name="folder_list_toolbar">
………………………………………..
<action name="CONTAINERMOVE"
type="pdmObject" shortcut = "true"/>
<action name="PAGERELOADINGMULTICHECKOUT"
type="folder" shortcut = "true"/>
<action name="WFADDTOWORKSPACE"
type="folder" shortcut = "true"/>
…………………………….
<action name="create"
type="folder" shortcut = "true"/>
<action name="create"
type="document" shortcut = "true"/>
…………………………………
</model>
An action is a shortcut action only in the context of that specific model. Note that icons for actions in the menus are be displayed for actions that also display in the toolbar.
SubModel Attributes
Details about these parameters can also be found in <WT_HOME>/codebase/config/actions/customActionmodels.dtd.
Parameter
Possible Values
Req?
Description
name
Name of any action model.
Yes
This is the name of an action model defined in an custom-actionModels.xml file. An example of where an action model with submodels is used is for the Actions > New menu on the Folder Contents table.
insertAt
number
No
This is the position where the new custom action should be inserted in the existing list of actions or submodels.
insertAfterActionName
Name of an action
No
This is the position after the action or submodel, where the new custom action should be inserted in the existing list of actions or submodels.
insertAfterObjectType
Name of the object type of the above action
No
This is the name of the object type associated with the above action.
insertBeforeActionName
Name of an action
No
This is the position before the action or submodel, where the new custom action should be inserted in the existing list of actions or submodels.
insertBeforeObjectType
Name of the object type of the above action
No
This is the name of the object type associated with the above action.
Sample Code
The following is sample code for an action model that configures a subtype:
<!-- Copied from ChangeManagement-actionModels.xml -->
<!-- Originally copied from menu for wt.change2.WTChangeRequest2 -->
<model name="sample change request actions" menufor="WCTYPE|
wt.change2.WTChangeRequest2|org.default.www.SampleChangeRequest">
<action name="view" type="object"/>
<action name="SETLIFECYCLESTATE" type="pdmObject"/>
<action name="createSubscription" type="subscription"/>
<action name="separator" type="separator"/>
<action name="reviseChangeItems" type="change"/>
<action name="editCapabilityPackage" type="capabilityPackage"/>
<action name="create" type="approach" />
<action name="create" type="capabilityImplementationProject" />
<action name="separator" type="separator"/>
<action name="sandboxAddToProject" type="object"/>
<action name="SBAddToPrj" type="sandbox"/>
<action name="removeShare" type="object"/>
<action name="separator" type="separator"/>
<action name="ManageSecurity" type="accessPermission"/>
<action name="renameObjectWizard" type="object"/>
<action name="delete" type="object"/>
<action name="separator" type="separator"/>
<action name="separator" type="separator"/>
<action name="discuss" type="forum"/>
<action name="copy" type="object"/>
</model>
Where org.default.www.SampleChangeRequest is the name of the subtype entered in the Type and Attribute Management utility.
Sample Change Request
Was this helpful?