Configuring Methods

This chapter describes how to configure methods that the users can run within worksheets or within a Members Browser content pane.bp

This chapter covers the following topics:

Configuring a New Level Method

Note: For information on setting the Security Threshold for a method, see the section Custom Methods in the chapter Levels.

To configure a level method

  1. Define a workflow schema to use as the method. See “Creating or Editing Workflow Schemas.”

    Note: If you are configuring a method that changes attribute values, the workflow must include an Edit Member Step as its first step. Otherwise, the changed values will not be saved to the database.

  2. If the workflow includes a Custom Step, create the Java class that the step should invoke.

  3. If this method should be available only within a specific worksheet, define that worksheet. See the Oracle Demantra Demand Management User's Guide or other user manual.

    If the method applies to all worksheets, this step is not necessary.

  4. Log into the Business Modeler.

  5. Click Configuration > Configure Methods.

    The system displays a screen showing the existing methods, including all the predefined methods.

  6. Optionally click the Detail Style icon to re-display this screen with the full method names:

    the picture is described in the document text

  7. Optionally click a level name in the drop down list at the top of the screen. The screen is re-displayed with only the methods associated with that level.

  8. Click the New Method icon and then click OK. Or double-click New Method.

    The first screen is General Properties.

    the picture is described in the document text

  9. Complete the fields in this screen as follows:

    Constructor Prompts the user for values of the attributes of the new member and then adds the member in the database.
    Destructor Removes the member from the database.
    Edit Prompts the user for new values of the attributes for this member and then saves the changes.
    View Displays the values of the attributes for this member.
    Custom Optionally prompts the user for new values of the attributes for this member and then runs a workflow.
    Name Name of this method, to display in the right-click menu of the worksheet. The method will be visible only in the Web-based worksheets.
    Level Level at which this method will be available.
    Enabled at Specifies where this method will be available.
    All to make this method available in all worksheets.
    Worksheet to make this method available in a single worksheet.
    No to make this method unavailable.
    Worksheet Worksheet where this method will be available.
    Workflow The workflow that will be executed when users run this method. This field is required for methods of type Custom.
    Display in menu Deselect this check box if you want to hide this method or leave it selected to have it displayed in the right-click menu, as specified.
    Synchronous WF Specifies whether this workflow should be run synchronously or asynchronously.
    If the workflow runs synchronously, that means that before doing anything else, the user must wait until the workflow has completed.
    Refresh Cache Specifies whether this method should refresh the local members cache.
    Dialog invoke button label When the user selects this method from the right-click menu, the worksheet displays a dialog box that asks the user to confirm whether to proceed or not.
    This option specifies the text on the “OK” option.
    Action when initiated Specifies what Demantra will do when the method is initiated. The choices are as follows:
    Do nothing (typically setting)
    Save Data (immediately saves the worksheet data, automatically)
    Ask to Save (displays a dialog box to ask if the user wants to save the worksheet data immediately)
    Explanation: Level methods operate on the server. If you create a level method that does something based on client expressions in the worksheet, it is necessary to save the worksheet data before launching that method. The Save Data setting is useful in such a case.
    In other cases, you may want to give users the option of saving data before running the method. For these cases, use the Ask to Save setting.
    Action when complete Specifies what Demantra will do when the method has completed its execution. The choices are as follows:
    Reload (reruns the worksheet)
    Reload and Message (reruns the worksheet and displays the output dialog box)
    Message and Ask (displays the output dialog box and asks if the user wants to rerun the worksheet)
    None (displays the output dialog box)
    The output dialog box is not displayed unless you have specified a message or at least one attribute to display on it.
    Method type For a list of Method Types see the Methods and Workflows chapter.
    Constructor, Destructor, and Edit type methods can also run workflows. The workflow is run after the level member is created, removed, or edited.
    Destructor type Applies to destructor methods. This option specifies the type of deletion:
    Delete member only. This deletes the member from the level table but does not delete data related to that member. Note that when parent members are deleted, their child members will be deleted as well.
    Delete member and data. This deletes the member from the level table and all related history/forecast data. Specifically, it deletes associated data in the MDP_MATRIX and SALES_DATA tables.
    Execute client class Indicates the Java class that Demantra runs when a user executes this method.
    Display population Controls the style of user interface to use for the population attribute, if the member has a population attribute. See “Presentation Styles for Population Attributes”.
  10. Click Next.

    The next screen is Input.

    the picture is described in the document text

    Here you specify the appearance of the input screen of the method.

    1. Optionally specify a message to display at the top of the input screen.

    2. For each attribute that the user should be able to edit, double-click that attribute to move it from the Available Attributes column to the Selected Attributes column.

    3. If the attribute should be editable, make sure the Editable check box is selected.

      Note: If you are configuring a method that changes attribute values, the workflow must include an Edit Member Step as its first step. Otherwise, the changed values will not be saved to the database.

    4. If the attribute should also be mandatory, make sure the Mandatory check box is selected.

    5. To change the order in which these attributes are displayed, use the up and down buttons on the right of the screen.

    6. Click Next.

      Note: If you do not specify a message or at least one attribute, the method input dialog box is not displayed when the user runs the method.

  11. The next screen is Output.

    the picture is described in the document text

    Here you specify the appearance of the output screen of the method.

    1. Optionally specify a message to display at the top of the output screen.

    2. For each attribute to display, double-click that attribute to move it from the Available Attributes column to the Selected Attributes column.

    3. To change the order in which these attributes are displayed, use the up and down buttons on the right of the screen.

      Note: If you do not specify a message or at least one attribute, the method output dialog box is not displayed when the user runs the method.

  12. Click Finish.

    See also

    “Making Changes Available to Users”

Presentation Styles for Population Attributes

You can choose the presentation style for the population attribute of any level that has this kind of attribute. A population attribute is a set of item-location combinations and a range of dates. Promotions, for example, have population attributes. Other general levels could also have population attributes.

Detail Style

With this style, part of the method input dialog box summarizes the item-location combinations and shows the range of dates, as follows:

the picture is described in the document text

Here, when the user clicks Edit, Demantra displays a screen where the user can select the levels and the members of those levels.

Simple Style

With this style, the method input dialog box does not summarize the population attribute; instead it displays just the Define (or Edit) button:

the picture is described in the document text

When the user clicks this button, Demantra displays a screen with two tabs. On one tab, the user can select the levels and the members of those levels. On the other tab, the user can specify the range of dates.

Passing Arguments to a Method

Demantra can pass arguments in memory to the method. Considered as a group, these arguments are the context dictionary. For each argument, Demantra passes a variable name and its associated value.

Available Arguments

The available arguments are as follows.

Variable * Value Data Type
ws_id Identifier of the worksheet from which the method was launched. Java.util.String
_filter The filter population of the worksheet from which the method was launched. Represented as a list of pairs of level_id and member_id. java.util.String level_id,member_id;
pairs separated by comas and semicolons.
view_name The name of the active view from which the method was called. java.util.String
level_id Identifier of the level from which the method was launched. java.util.String
member_id Identifier of the member from which the method was launched. java.util.String
Combination_path The context of the selected member for themethod. Will be represented as a list of pairs of level_id and member_id. java.util.String level_id,member_id
population.filters
(example)
Applies only to promotion levels. The population attribute of the selected member. The name of this variable is based on the name of the population attribute as follows:
population_attribute_name.filters
Array of: com.demantra.applicationServer.metaDataObjects.level.levelFilters.LevelFilterGetters
population.from_date
(example)
Applies only to promotion levels. The from_date attribute of the selected member. The name of this variable is based on the name of the population attribute as follows:
population_attribute_name.from_date
java.util.Date
population.to_date
(example)
Applies only to promotion levels. The to_date attribute of the selected member. The name of this variable is based on the name of the population attribute as follows:
population_attribute_name.to_date
java.util.Date
Attribute_column_name Values of the attributes of the selected member that are specified as inputs to the method (all attributes on the Select Input Arguments screen). The name of each variable is the same as the name of the column in which the attribute is stored. java.util.Object

Passing Arguments

In order to pass arguments to the method, you must explicitly configure the variables that each workflow step should receive. To do so, you type the parameter names on the Parameters list for that step; see “Properties Used as Arguments for a Method”.

Note: The parameter names are case-sensitive.

For the input variables, you also specify which variables to pass when you configure the method. Specifically you select the desired attributes on the Select Input Arguments screen.

Modifying a Level Method

To modify a level method

  1. If necessary, redefine the workflow schema that you are using within the method. See “Creating or Editing Workflow Schemas”.

  2. Log into the Business Modeler.

  3. Click Configuration > Configure Methods.

    The system displays a screen showing the existing methods, including all the predefined methods.

  4. Optionally click a level name in the drop-down list at the top of the screen. The screen is re-displayed with only the methods associated with that level.

  5. Click the method icon and then click OK. Or double-click the method name.

  6. Make changes as needed and click Finish.

Deleting a Level Method

To delete a level method

  1. Click Configuration > Configure Methods.

    The system displays a screen showing the existing methods, including all the predefined methods.

  2. Optionally click a level name in the drop-down list at the top of the screen. The screen is re-displayed with only the methods associated with that level.

  3. Click the method icon and then click Delete.

  4. Click OK.

  5. If the workflow schema is not used elsewhere, delete it. See “Deleting Workflow Schemas”.