Batch File Startups & Shortcuts

There are a number of options that you can use when starting tools. WorkBench for example can be started connecting to a specific CDS. Sometimes, specific environment variables must be set. This is where using a Windows batch file startup is useful.

Windows Batch Files

A batch file is a short script, a list of commands that are run as if you had executed them from the command line. It could be that you want to connect to a company driver, run WorkBench and then exit. You may want to run a specific query on a specific project with the UI in a particular language.

batch file content
Command Batch Files

Examples

Run WorkBench in English connecting to a particular server.

@rem starting Cradle WorkBench in English on UK_3SL_07 server
set CRADLE_UI_LANG=en_gb
start "Cradle WorkBench" "%CRADLEHOME%\bin\exe\windows\work.exe" -cds UK_3SL_07

Run WorkBench, with the company documents drive connected.

rem starting Cradle WorkBench with documents drive
echo Mapping network drive...
net use z: \\UK_3SL_07\company
if errorlevel 1 (
echo Unable to use shared folder \\UK_3SL_07\company
echo Quitting!
exit /b
)
"%CRADLEHOME%\bin\exe\windows\work.exe"
net use z: /delete

Run WorkBench, logging in and showing a query with a French UI.

@rem starting Cradle WorkBench in French and run query
set CRADLE_UI_LANG=fr
start "Cradle WorkBench" "%CRADLEHOME%\bin\exe\windows\work.exe" -action queryrun -query "Design - linked Test" -qloc project -login NISHMA,nishma,WOSY

Once you save the batch file, you can execute it from the File Manager, or a Shortcut, or as we’ve illustrated by double clicking the icons on the desktop.

Shortcuts

Windows desktop shortcuts can be created to directly run WorkBench. You’ll be able to set all the command line options, but won’t be able to do anything like connecting a drive.

Simply drag the WorkBench icon from the WindowsStart menu‘ onto your desktop. Right click and select Properties then add any options to the command line in the Target field. This example shows how we log into the DEMO project really quickly.

running WorkBench from a shortcut
WorkBench shortcut

Command Line Options for WorkBench

If you run WorkBench from the command line with a -help option,

C:\”%CRADLEHOME%\bin\exe\windows\work.exe” -help

you’ll be shown all the values that can be entered into a command line call.

list of command line options for WorkBench
WorkBench Command Line Options
usage: work.exe [options]
options are:
   [-cds]
   [-display ]
   [-login ,,]
   [-noldap]
   [-nobanner]
   [-ro]
   [-action {itemview | queryrun}]
   for itemview:
      -pduid [-version ] [-draft ]
      [-form -floc ]
   for queryrun:
      -query -qloc
      [-view -vloc ]
   where loc is one of:
      system automatic project usertype team user personal
   [-errorstack]
   [-ver]
   [-help]

These values can be used in a direct shortcut (see this related shortcut article) , or in the command entered into he batch file.

Related Articles

Desktop Login Shortcut

Batch File Reporting in Cradle

URL to Launch WorkBench/Web Access Open Item/Query

Tree Style

You can find items in a Cradle database by running a query. For example, you can use the pre-defined queries in the Quick Access Bar at the bottom of the UI. Once the query has run, the results are shown in a display style. Tree style is one of the four styles available:

A view is used to specify which parts (attributes) of the items will be shown. A display style controls how these attributes will be displayed, and the facilities that are available to you.

Tree Style

This is the second most frequently-used of the display styles after table style. It displays each item as a node in a tree, with a set of columns for the other attributes:

display items using tree style in 3SL Cradle RM SE Tool
Items Shown in Tree Style

There are two views used to display trees:

  • A view that specifies the contents of the node shown in the tree. You specify this view in the schema for the item type.
  • A view that specifies the attributes shown in columns to the right of the tree

To have items displayed in this style:

  • Specify it in the query to be run:
choose tree style in a query in 3SL Cradle RM SE Tool
Specify Tree Style in a Query
  • Also, select it from the Context group in the Home tab:
choose tree style in the UI in 3SL Cradle RM SE Tool
Choose Tree Style in the UI Ribbon
  • Or, right click and choose Style -> Tree from the context-sensitive menu
  • Finally, press <CTRL> and 4

Facilities

  • Use the left mouse button to select individual items
  • You can select a groups of items by selecting the first and then pressing <SHIFT> and the left mouse button to select the end of the group
  • Press <CTRL> and the left mouse button to select or de-select individual items
  • You can shrink and widen the display columns. Move your cursor to the edge of a column heading and the cursor will become a pair of arrows. Press, drag and release the left mouse button to change the column’s width.
  • You can follow cross references by expanding the tree node for the item. Cradle will find all cross references to and from the item, select which cross references to use, and display the items at the other end of these cross references as new nodes in the tree.
  • Use drag-and-drop items between trees to create cross references between the items
  • Drag-and-drop items inside a hierarchy of the same type of items to reorder that hierarchy and automatically rebuild the hierarchical numbering within it

You can expand a tree node by:

  • Click its + button
  • Select the text of the tree node and press: +
  • Select the text of the tree node, right click, and choose Expand from the menu
  • Double click on the text of the tree node

You can collapse a tree node by:

  • Click its button
  • Double-click on the text of the tree node
  • Select the text of the tree node and press:
  • Select the text of the tree node, right click, and choose Collapse from the menu

Advantages

The advantages of tree style are that it is:

  • The simplest way to explore items and their relationships
  • A convenient method to create cross references
  • The easiest way to reorganise a hierarchy of items

If you want to do anything with cross references between items, or to work in a hierarchy of items, then this is the best display style to use.

Disadvantages

The disadvantages of tree style are that:

  • It provides a limited ability to display information
  • You cannot edit information directly

Summary

Tree style is the most convenient method to work with cross references within a set of items and between one set of items and other sets of information.

Therefore, we recommend this style whenever you need to work with cross references between items and inside hierarchies.

Document Style

You can find items in a Cradle database by running a query. For example, you can use the pre-defined queries in the Quick Access Bar at the bottom of the UI. Once the query has run, the results are shown in a display style. Document style is one of the four styles available:

A view is used to specify which parts (attributes) of the items will be shown. A display style controls how these attributes will be displayed, and the facilities that are available to you.

Document Style

This is the second most flexible of all the display styles. It displays each item as a set of one or more rows and one or more columns (as controlled by the view), with invisible borders around each of the cells. You can edit items directly in this display style.

display items using document style in 3SL Cradle RM SE Tool
Items Shown in Document Style

This display style is similar to table style, except that:

  • The height of each item’s row is set by the information to be shown. So some rows are shallow and other rows are deep. If an attribute contains no data, its height will be close to zero.
  • Different sized fonts are used to display the first row in the view. The size of the font is based on the level of the item being shown. This level is based on the number of dots (periods) in the first attribute shown in the row. This is typically the Key, or whatever attribute you may have specified to hold the item’s hierarchical number.
  • The borders around the rows and columns are invisible

For document style, you should use views that show attributes in successive rows, rather than successive columns. For example:

view to items using document style in 3SL Cradle RM SE Tool
Arrangement of Attributes in a View for Document Style

The result is that items are displayed in a style that looks like a document, with large font for section headings and smaller fonts used for subsection headings.

To have items displayed in this style:

  • Specify it in the query to be run:
choose document style in a query in 3SL Cradle RM SE Tool
Specify Document Style in a Query
  • Also, select it from the Context group in the Home tab:
choose document style in the UI in 3SL Cradle RM SE Tool
Choose Document Style in the UI Ribbon
  • Or, right click and choose Style -> Document from the context-sensitive menu
  • Finally, press CTRL and 3

Facilities

Document style provides a wide range of faciltiies.

Selecting Items

  • Use the left mouse button to select individual items
  • You can select a groups of items by selecting the first and then pressing SHIFT and the left mouse button to select the end of the group
  • Press <CTRL> and the left mouse button to select or de-select individual items

Changing the Display

  • You can shrink and widen the display columns. Move your cursor to the edge of a column heading and the cursor will become a pair of arrows. Press, drag and release the left mouse button to change the column’s width.
  • You can move any row or column in the view. Move your cursor onto any cell border and the cursor will become a pair of arrows. Press, drag and release the left mouse button to move that border.
  • By default, all rows are displayed with different heights, you can increase or decrease the height of any row
  • You can sort the data in any column. Click the column heading and choose a sort order, either ascending or descending, in either a case-sensitive or case-insensitve manner (this only applies to languages that have upper-case and lower-case characters)
  • Tooltips are displayed for each column. Move your cursor into a column heading and after a second, a description of that attribute will be shown. You can enter these descriptions in the schema.
  • You can see tooltips for some attribute values. Move your cursor into a cell that displays a category with a pick-list of possible values. A tooltip appears containing a description of that category and category value. You can enter these descriptions in the schema.

Exploring Data

  • You can expand rows to follow cross references. Double-click the heading for an item’s row and that row will expand to show one new row for each item linked to the original item. Repeat this as many times as you like.
  • You will see the level of any expanded row as the number of dots in its row heading
  • You can collapse rows by double-clicking the row heading.

Editing Data

  • You can edit items directly Click inside any cell. If you have RW access to the item, Cradle locks the item so you can edit it.

Advantages

The advantages of document style are that it is:

  • Flexible. You can adjust the display and sort information.
  • Navigable. You can explore the database by expanding rows to follow cross references.
  • Editable. You can edit information through the display style.
  • Readable. All items are shown with a display height to display their entire contents.

Disadvantages

The disadvantages of document style are that:

  • It takes much longer to display than list style or tree style
  • The rows displaying information are of different heights, so you may not see many items at the same time. You may need to scroll more than in other display styles.

Summary

Document style is the second most flexible of Cradle’s four display styles, after table style. It is not the quickest style to generate, but it does provide a familiar document-like view of information and a lot of capability.

Therefore, we recommend document style whenever you want to display items in a document format. This can be very helpful for users who are more familiar with using documents, rather than data-orientated tools.

Table Style

You can find items in a Cradle database by running a query. For example, you can use the pre-defined queries in the Quick Access Bar at the bottom of the UI. Once the query has run, the results are shown in a display style. Table style is one of the four styles available:

A view is used to specify which parts (attributes) of the items will be shown. A display style controls how these attributes will be displayed, and the facilities that are available to you.

Table Style

This is the most flexible of all the display styles. It displays each item as a set of one or more rows and one or more columns (as controlled by the view), with borders around each of the cells. You can edit items directly in this display style.

display items using table style in 3SL Cradle RM SE Tool
Items Shown in Table Style

To have items displayed in this style:

  • Specify it in the query to be run:
choose table style in a query in 3SL Cradle RM SE Tool
Specify Table Style in a Query
  • Also, select it from the Context group in the Home tab:
choose table style in the UI in 3SL Cradle RM SE Tool
Choose Table Style in the UI Ribbon
  • Or, right click and choose Style -> Table from the context-sensitive menu
  • Finally, press <CTRL> and 2

Facilities

Table style provides a wide range of facilities.

Selecting Items

  • Use the left mouse button to select individual items
  • You can select a groups of items by selecting the first and then pressing SHIFT and the left mouse button to select the end of the group
  • Press <CTRL> and the left mouse button to select or de-select individual items

Changing the Display

  • You can shrink and widen the display columns. Move your cursor to the edge of a column heading and the cursor will become a pair of arrows. Press, drag and release the left mouse button to change the column’s width.
  • You can move any row or column in the view. Move your cursor onto any cell border and the cursor will become a pair of arrows. Press, drag and release the left mouse button to move that border.
  • By default, all rows are displayed the same height, but you can increase the height of any row
  • You can sort the data in any column. Click the column heading and choose a sort order, either ascending or descending, in either a case-sensitive or case-insensitve manner (this only applies to languages that have upper-case and lower-case characters)
  • Tooltips are displayed for each column. Move your cursor into a column heading and after a second, a description of that attribute will be shown. You can enter these descriptions in the schema.
  • You can see tooltips for some attribute values. Move your cursor into a cell that displays a category with a pick-list of possible values. A tooltip appears containing a description of that category and category value. You can enter these descriptions in the schema.

Exploring Data

  • You can expand rows to follow cross references. Double-click the heading for an item’s row and that row will expand to show one new row for each item linked to the original item. Repeat this as many times as you like.
  • You will see the level of any expanded row as the number of dots in its row heading
  • You can collapse rows by double-clicking the row heading.

Editing Data

  • You can edit items in a table. Click inside any cell in the table. If you have RW access to the item, Cradle locks the item so you can edit it.

Advantages

The advantages of table style are that it is:

  • Flexible. You can adjust the display and sort information.
  • Navigable. You can explore the database by expanding rows to follow cross references.
  • Editable. You can edit information through the display style.
  • Compact. All items are shown with the same display height.

Disadvantages

The disadvantages of table style are that:

  • It takes longer to display than list style or tree style
  • The rows displaying information are all the same height, so you may have to click in a cell or expand a row border to see all of the information in some attributes

Summary

Table style is the most flexible of Cradle’s four display styles. It is not the quickest to generate, but it provides the most capability.

Therefore, we recommend table style as the best general purpose display style in Cradle. Unless you need something provided by a different display style, use table style.

Using Sessions in the Cradle UI

The Cradle UI displays information inside tabs. These tabs are grouped into panes. You can design your Cradle UI with a set of panes grouped in nested rows and columns in your preferred layout. This layout is called a session. Using sessions is the easiest way to maximise your productivity with Cradle.

You can save your current layout of panes, and the tabs inside them, in a session. You can then restore this session when you login to Cradle. When you do this, Cradle will restore the panes, organise them in your preferred layout, and where possible, automatically recreate all of the tabs inside each pane by re-running queries and so on.

The result is that when you login to Cradle and specify a session, your Cradle UI will look the same as it did when you last logged-out.

This will save you a lot of time and help you to complete your work more quickly and effectively!

Working With Sessions

Using sessions is very easy:

  • You can save a session at any time
  • You can specify a session when you login.

Saving a Session

You can save your current WorkBench layout as a session by clicking Save As in the Session group in the Window tab in the UI’s ribbon:

Using Sessions in 3SL Cradle WorkBench
Save a Session

You will be asked to enter a name for the session. When you are working in WorkBench with a session, you can update the saved session to match your current layout of panes and tabs by clicking Save,

Using Sessions

When you next login to Cradle WorkBench, you can choose your session from the drop-down list in the Login dialog:

Using Sessions in 3SL Cradle WorkBench
Specify a Session at Login

and your layout of panes and tabs in the session will be restored, re-running queries and so on as necessary.

You can also reload the session that you chose at login by selecting Reload. from the Session group in the Window tab in the UI’s ribbon.

Related Articles

WorkBench Screen Panes and Tabs

Using Tabs in the Cradle UI

The Cradle WorkBench UI is divided into panes. Each pane is a region that can contain one or more tabs. A tab is a container with a selectable name and a rectangular area that contains the results of running a query, report, metric or graph, or a single item that is being edited. Using tabs is a way to maximise your productivity with the Cradle UI by helping you to arrange queries, items and other information, either so you can see everything at the same time, or so the information is presented in a layout that you find convenient.

Layout of a Tab

A tab is a rectangular region in the Cradle UI that has a name, a close control and a rectangular region containing the result of a query, a report, a metric, a matrix, a pivot table, or a dashboard:

Using Tabs in 3SL Cradle WorkBench
Tabs in a Pane in the Cradle UI

Tabs exist inside panes. See this blog entry for a discussion of panes:

Using Panes in the Cradle UI

Each pane can contain up to 16 tabs. You can have many panes open in the UI at the same time.

When you create a new tab, it will open in the currently-selected pane. So, if you run a query, that query will open in a new tab in the current pane. If you open an item, it will open in a tab in the current pane.

Tab Names

Each tab has a name, shown above it, that is name of the query, report, metric, graph or pivot table shown in the tab, or some details of the item shown in a form.

Using Tabs

Next to a tab‘s name is a button, you can click this button to close the tab.

You can also press CTRL-W to close a tab, or choose Close Tab from the context-sensitive menu that will appear if you right-click inside a tab.

You can move a tab between panes by:

  • Put your cursor in the name of the tab to be moved
  • Press the left mouse button
  • Drag into the new pane
  • Release the mouse button

Horizontal or vertical scrollbars will appear if a tab’s contents are larger than the screen area available. You can increase the area used to display a tab by either:

  • Use the sash control to increase the size of the pane that contains the tab
  • Maximise the pane containing the tab using its pane control menu, or simply double-clicking the pane’s legend
Related Articles

WorkBench Screen Panes and Tabs

Using Panes in the Cradle UI

The Cradle WorkBench UI is divided into panes. Each pane is a region that can contain one or more tabs. A tab is a container with a selectable name and a rectangular area that contains the results of running a query, report, metric or graph, or a single item that is being edited. Using panes is a way to maximise your productivity with the Cradle UI by helping you to arrange queries, items and other information, either so you can see everything at the same time, or so the information is presented in a layout that you find convenient.

Layout of a Pane

A pane is a rectangular region in the Cradle UI that has a legend and a set of controls:

Using Panes in 3SL Cradle WorkBench
A Pane in the Cradle UI

The pane’s contents are one or more tabs. Each tab contains the results of a query, report, matrix, metric, graph or pivot table, or an item in a form.

Each pane can contain up to 16 tabs. You can have many panes open in the UI at the same time.

When you create a new tab, it will open in the currently-selected pane. So, if you run a query, that query will open in a new tab in the current pane. If you open an item, it will open in a tab in the current pane.

Pane Legend

The pane’s legend appears when you select a tab inside it. The legend will be the name of the tab that you have selected.

You can double-click the legend to maximise the pane. This will maximise the pane to fill the WorkBench UI, overlaying all other panes. When a pane is maximised, double-click the legend again to minimise the pane. This will restore the pane to its original size.

Pane Controls

Each pane has a set of controls. These controls are the most important part of using panes to control the Cradle UI:

Using Panes in 3SL Cradle WorkBench
Pane Controls and How to Access Them

You can use these controls to:

  • Maximise the current pane, an alternative to double-clicking its legend
  • Close the current tab, if any
  • Empty the pane by closing all of its tabs
  • Close the pane, and all tabs inside it
  • Close all panes

More usefully, you can also:

  • Split the pane horizontally into two panes
  • Split the pane vertically into two panes

Using Panes

You can split panes any number of times. This divides the UI into an arrangement so you can see several queries at the same time, or so you can see many items at the same time.

As an example:

Using Panes in 3SL Cradle WorkBench
Creating New Panes by Splitting

A large screen will be helpful!

There are sash controls between panes. Move your cursor between two panes and it will change to a pair of arrows. If you press, drag and release the left mouse button, you can adjust the relative sizes of adjacent panes. This will proportionately adjust the sizes of all tabs inside these panes. For example:

Using Panes in 3SL Cradle WorkBench
Adjust Pane Sizes with Sash Controls
Related Articles

WorkBench Screen Panes and Tabs

Forms – Collapsible Panels

WorkBench Forms

A form is a layout template that is used to display information about items within Cradle. There are multiple attributes of an item that may be displayed, from the name, to categories, to frames.  Forms can soon get complicated, this is where collapsible panels can help.

Collapsible Panels

A feature new in Cradle 7.4

Collapsible panels are placed as a row, or a column on a form definition. These can be barked to display as a normal row/column when opened or to “Show collapsed by default”

Form expanding panels
Expand Panel

The bar at the top of the panel toggles its open state.

Q&A

Some of the questions often asked regarding forms.

Q: What if a user does not have a skill required to see an attribute?

A: The form will not display this particular aspect of the item. There is no need to create a separate form.

Q: I’ve just added some new frames and categories. Do I have to design a new form?

A: No, the Automatic scope forms will generate a basic form with the new elements included.

Q: Do I have to start from scratch designing a form?

A: No, you can choose any existing form (including the automatically generated ones) suitable  for that item type, make your changes and then ‘Save As‘ to store the newly altered definition.

Q : Do you have to show everything that every user needs on a form?

A: No, forms can have a scope of System, Automatic, Project User type, Team User, or Personal. This allows different users to show different aspects of an item most relevant to them.

Q: Can I show related items?

A: Absolutely, linked items can be shown within a form.

Q: Can I convert existing forms?

A: Yes, just select an existing Row or Column and change the Syle from Basic to Panel. then Save or Save As

Increase the UI Object Limit

The UI of the WorkBench tool in 3SL’s Cradle is very flexible. It allows you to display the items and the results of running queries in individual tabs. You can split the display into panes and have many of these tabs in each pane. You may need to increase the UI Object limit if you want to have a very complex WorkBench UI.

UI Object Limit

Each part of the UI uses Windows resources called User interface objects. There is a limit on the number of these UI Objects that each WorkBench process can allocate.

The default is a maximum of 10,000 UI Objects per process. This can be increased to a maximum of 18,000 UI Objects per process by changing a setting in the Windows registry.

If you open so many tabs that WorkBench exhausts the UI Objects that it can allocate, then the WorkBench UI will hang.

Increase the UI Object Limit

To increase the UI Objects Limit you must edit the Windows registry value:

HKEY_LOCAL_MACHINE\SOFTWARE
    \Microsoft\Windows NT\CurrentVersion
    \Windows\USERProcessHandleQuota

The steps are:

Set the UI Object Limit
Set the UI Object Limit
  1. Press Windows+R and enter regedit and click OK
  2. Navigate to the above registry entry
  3. Double click the entry for USERProcessHandleQuota, and set Decimal
  4. Enter the new value 18000 and click OK:

    DWORD USERProcessHandleQuota edit dialog
    USERProcessHandleQuota
  5. Exit the registry editor

This change takes effect on any processes created from now on.

Do I Need to Do This?

In general, no you do not need to make this change.

We have only seen one case where this change was necessary. In this case, a customer had a form with 75 frames display in it. The WorkBench UI hung when a user tried to open the 6th item concurrently when using this form.

Increasing this limit allowed the user to open 10 items concurrently using this (very!) large form.

Of course, if you want to increase the UI Object limit as a precaution, then it will not do any harm!

Controlling Your Initial View

Query with a View

Each query can have an initial View associated with it. Each time this query is run, it will apply the view. This is the best way of controlling your initial view for a particular query.

Shown in the screen shot below the project viewresults‘ has been set in the queryMy Results‘ each time this query is run the columns specified in the View Details are shown. There’s nothing to stop a user selecting a different view in the ribbon later.

showing the query, view setup and results
Initial View Settings

Remember that View

WorkBench is designed to remember the last view you used for a particular item type.  It’s likely that next time you run a query for the same item type, you’ll want the same view. Even if you close all your tabs, within the same session you are controlling your initial view of each query by the last choice you selected.

Initial Influence

You can control the initial view selected for a query in a project by associating a view with an item type in the project’s schema. Open Project Setup and select the item type and an appropriate view. When starting Cradle, this will be the view selected for this item type, the first time it it is queried. Thereafter, WorkBench will switch to  “Remember that View”.

setting an initial view in the schema
Initial View – Schema

QAB Queries and Views

The Quick Access Bar at the bottom of WorkBench as some auto generated queries and auto generated views for speed. If one of these is selected then the the view that is ‘remembered’ will be the last one of the Automatic views.