Lab 2.2: Configuring Actions to Create Tasks (Job Schedules)
Time Estimates for Completion
Add actions to the Action menu.
Description:
5 minutes
Lab exercise:
15 minutes
Description
Add Action menu items to create tasks for the simple model geometry check.
Lab Exercise
In this lab you will create the Simple Model Geometry Check menu item, then put it in the Model Checks group.
Prerequisites
You need the SimpleModelGeometryCheckJob.xml and SimpleModelGeometryCheckTemplate.lsp files from Lab 2.1.
Add the Simple Model Geometry Check menu item
Actions to create tasks (job schedules) can be configured in a job configuration's UI section. The resulting xml file defines the name of the action menu as well as the action class.
You may include a Description element to the Action definition to provide more detailed information.
1. Add the <UI> definition to SimpleModelGeometryCheckJob.xml.
<?xml version="1.0" encoding="UTF-8"?>
<Job type="modeling.simplegeometrycheck" has_result_data="true">

<DisplayName>Simple Model Geometry Check</DisplayName>

<UI>
<ActionMenu wm_java_class="com.osm.datamgmt.biz.Model" include_derived="true">
<Name>Simple Model Geometry Check</Name>
<Action java_class="com.osm.automation.action.MultiSelectCreateJobScheduleAction">
<Description>Checks a model's geometry</Description>
</Action>
</ActionMenu>
</UI>
<Exporter java_class="com.osm.automation.ModelingJobExporter">
<StartScriptTemplate>SimpleModelGeometryCheckTemplate.lsp</StartScriptTemplate>
<ModelLoadRule catalog="model" msg_num="728">Highest Revisions</ModelLoadRule>
</Exporter>
<ResultHandler java_class="com.osm.automation.SaveToFileSystemJobResultHandler">
</ResultHandler>
</Job>
The action's description appears in the status line when the mouse hovers over the action.
Put the Simple Model Geometry Check menu item into the new Model Checks group
Actions to create job schedules can be grouped together in job groups. Specify the job group to which an action belongs as a JobGroup child element of the ActionMenu entry in the XML configuration:
<?xml version="1.0" encoding="UTF-8"?>
<Job type="modeling.simplegeometrycheck" has_result_data="true">

<DisplayName>Simple Model Geometry Check</DisplayName>

<UI>
<ActionMenu wm_java_class="com.osm.datamgmt.biz.Model" include_derived="true">
<Name>Simple Model Geometry Check</Name>
<JobGroup>Model Checks</JobGroup>
<Action java_class="com.osm.automation.action.MultiSelectCreateJobScheduleAction">
<Description>Checks a model's geometry</Description>
</Action>
</ActionMenu>
</UI>
<Exporter java_class="com.osm.automation.ModelingJobExporter">
<StartScriptTemplate>SimpleModelGeometryCheckTemplate.lsp</StartScriptTemplate>
<ModelLoadRule catalog="model" msg_num="728">Highest Revisions</ModelLoadRule>
</Exporter>
<ResultHandler java_class="com.osm.automation.SaveToFileSystemJobResultHandler">
</ResultHandler>
</Job>
The job group Model Checks appears in the Action menu and all actions assigned to this job group appear as submenu entries.
Localization
Some elements of a job's XML configuration provide localization support by specifying the message catalog name and message number. Typical elements supporting localization are DisplayName, Name, Description, and JobGroup.
<?xml version="1.0" encoding="UTF-8"?>
<Job type="modeling.simplegeometrycheck" has_result_data="true">

<DisplayName catalog="mycatalog" msg_num="1">Simple Model Geometry Check</DisplayName>

<UI>
<ActionMenu wm_java_class="com.osm.datamgmt.biz.Model" include_derived="true">
<Name catalog="mycatalog" msg_num="2">Simple Model Geometry Check</Name>
<JobGroup catalog="mycatalog" msg_num="3">Model Checks</JobGroup>
<Action java_class="com.osm.automation.action.MultiSelectCreateJobScheduleAction">
<Description catalog="mycatalog" msg_num="4">Checks a model's geometry</Description>
</Action>
</UI>

<Exporter java_class="com.osm.automation.ModelingJobExporter">
<StartScriptTemplate>SimpleModelGeometryCheckTemplate.lsp</StartScriptTemplate>
<ModelLoadRule catalog="model" msg_num="728">Highest Revisions</ModelLoadRule>
</Exporter>

<ResultHandler java_class="com.osm.automation.SaveToFileSystemJobResultHandler">
</ResultHandler>

</Job>
Was this helpful?