Specifying the segments

  1. Click the Code Segments tab in the Create Rule form.
  2. When you select Auto Code, you must specify the segment types. For each segment, or piece of the name, select a segment type that achieves your requirements. The value choices are shown in the table.
    Segment Type Description
    Date A list of check boxes that enable the Date selected from a date control in the New/Save As/Create From dialog. You can use it in the copy method.

    Specify TODAY in the Default/Custom Config. column. Then, today’s date is displayed in the Date field in the New dialog.

    When you leave the Default/Custom Config. column blank, no date is displayed in the New dialog. Specify YES in the Required column to force the user to specify a date.

    Fixed Non-editable segment of the formula name. For example, the Lab segment can be Fixed. You must specify the segment in the Default/Custom Config column.
    Lookup Lookup list selection of one choice by the user. Go to Configure > Lookup Set for existing lookups or to create a new Lookup Set, enter in the Enum Query/Seq. Name/Lookup column. See Enum Query/Seq. Name/Lookup.
    Next Key Evaluates earlier segment entries. Searches the database for the formula with that code and the largest Next Key segment. Returns the next character in the sequence.

    Suppose you are copying formula PJ-004-03; PJ is Fixed, 004 is Sequence, and 03 is Next Key. Optiva searches the database for all formulas that begin with PJ-004-Next Key.

    Optiva identifies the formula with the largest Next Key segment. Optiva returns a formula name where the Next Key segment is incremented by one from the largest. If 03 is the largest Next Key, then the formula PJ-004-04 is returned.

    If 36 is the largest Next Key, then the formula PJ-004-37 is returned. For alphabetic sequencing, specify ALPHA_ENGLISH in the Default/Custom Config column. To prevent editing, specify LOCKED in that column.

    Do not specify Next Key as the first segment. There must be a segment before Next Key.

    Prompt User specifies information. In the example, the User Initials segment is specified by the user. Because it is a required segment, the user must specify the information.

    Use "FMT=" # entries and a decimal (e.g., FMT=##.## ) to force a numeric entry with decimal points.

    To force a segment to uppercase, select the Force to Uppercase check box.

    Script Used by a Visual Basic .NET function to obtain a value from the context of the object that is to be created. _MODELOBJECTSYMBOL, _TASKUSER or _TASKGROUP are used as part of the new code.

    In the copy method, the return variable must be Context.returnValue. It cannot be rc, or anything else.

    See Script segment example.

    The Default/Custom Config column requires the name of the copy method that uses the VB.NET script function.

    Selection Drop-list selection of one choice by the user. The choices are established in an enumerated list or query.

    See Specifying the segments.

    See Enumerated lists.

    You can indicate a default value in the Default/Custom Config column. Otherwise, the first value in the enumerated list is the default value. See below for entering the list name in the Enum Query/Seq. Name/Lookup column.

    Sequence Returns the next number in a sequence. The sequence must be in the Enum Query/Seq. Name/Lookup column. Use a different name for different sequences. You can use the same sequence name in more than one rule; this carries the sequence of numbers through multiple rules. In the example, each new formula number is incremented by one. The numbering is based on the last formula that was created by the rule.

    See Using the Sequence Editor form.

    Specify FILLGAPS in the Default/Custom Config column to make Optiva apply the lowest unused number in the sequence.

    Specify FILLGAPS_ITEM for a formula create rule; or specify FILLGAPS_FORMULA for an item create rule to coordinate formula and item numbers. This works only for object codes that are entirely numeric.

    If rules are used frequently, then do not use FILLGAPS with Sequence. Otherwise, you can create duplicate keys and get a concurrency error. If rules are used infrequently, then the chance of creating a duplicate key is remote.

    Template Copies a record other than the default record during the New, Create From As New, and Save As events. Specify the record that serves as the default value in the Default/Custom Config column.

    You can configure the Template segment to be selectable instead of hard-coding a specific template name. That way, you can use any object or a set-based template as the basis for a new object.

    Add the appropriate Query to the Enum Query/Seq.Name/Lookup column. See Enum Query/Seq. Name/Lookup.

    This segment is displayed in the Create Object dialog. When users create a new object using this rule, they can select any existing object or set-based template as a default for the new object.

    See Configuring rules for assigning set templates for more details how to configure the template segments..

    Specify LOCKED in the Default/Custom Config column to prevent users from editing the value after it is selected.

    Ver.Subver Applies only to Save As and Create From As Copy events because a version number must already exist. Evaluates earlier segment entries. Searches the database for the object with that code and version. Returns the next number in the sequence to a subversion. Works like Next Key, but only for objects that have version control.

    Ver.Subver or Version must be the last segment defined in this table for versioned objects.

    See Length of version and subversion.

    The backslash (\) is always the delimiter for versions. The period (.) is always the delimiter for subversions.

    The previous segment should be Fixed with a copy mask to determine the object code.

    Specify UNIQUE in the Default/Custom Config column to allow users to manually enter the object's version. The user specifies the version only; the subversion is calculated. The calculation for the subversion is one greater than the greatest subversion of all subversions for that object code, regardless of the version.

    Suppose you have the formula B-003\0001.001, B-003\0001.002, B-003\0002.008 and B-003\0003.007. UNIQUE is defined for a Save As on B-003\0001.002. In this case, the subversion that is returned is 009.

    Version Evaluates earlier segment entries. Searches the database for the formula with that code. Returns the next number in the sequence to a version number. Works like Next Key, but only for objects that have version control.

    Version or Ver.Subver must be included for objects with version control. They must be the last segment that is defined in this table.

    See Length of version and subversion.

    The backslash (\) is always the delimiter for versions.

    If this segment is used in a rule code for a non-versioned object, then it is not displayed in the object code.

  3. Specify the rest of the criteria in the Code Segments tab of the Create Rule form.
    Segment Name/Prompt
    Name of the segment that is displayed to the user in the Create Object dialog. You can make this descriptive. For example, Fill in your initials here or You may not edit this field. If you have more than one language pack installed, you can specify the segment name in different languages. See How does Optiva determine which language to use for segment description?. Use the Language Translation button to open the Language Translation dialog, which provides a way to enter segment captions in other supported languages.
    Include
    Include as part of the object name. Some segments are necessary, but should not be part of the code name. If the segment prompts the user to answer a yes or no question, you can exclude the answer from the name. In the example, the user specifies a Class that is used in the Copy Method, but it does not display in the name.
    Required
    Required segment. This segment must be filled in by the user.
    Delimiter
    Prefix segment separator. Indicator to divide segments. Ignored in the first segment. S=space.
    Length
    Number of characters.
    Fill Character
    A fill character to complete the length, if the segment is shorter than the length. Otherwise, the segment length shortens. Use S to fill with blank spaces. In the example, if the formula number is less than 100, then zeros fill in the remaining characters. If the user enters two initials instead of three, then the segment shortens to two characters.
    Alignment
    Aligns the segment left (0) or right (1). If the formula number is aligned left, then the first number is 100; the second is 200... A formula number that is right-aligned begins with 001, 002...
    Sequence Start Value
    Optionally, specify a numeric value in this field if you want your sequence to start with a value other than the default of 0. This value is used to set the initial value for the Sequence Number for a Create Rule. If a Sequence segment is created and the start value is blank, the default value is 1. If you are working with Oracle and the start value is specified as blank or less than 1, an error message is displayed and the Create Rule cannot be saved.
    Copy From
    Copy From is used with the Save As and Create From As Copy (copying an object) events to indicate the object type that a portion of the name is copied from. You must indicate the portion of the object code to copy in the Copy Mask column. A segment for a formula code can be copied from another object, such as a program or specification code.

    You can add a suffix to a segment by specifying SUFFIX=suffix in the Default/Custom Config. column for any segment that uses the Copy From and Copy Mask columns. The suffix is added to the end of the segment for the new object.

    Ensure that the length of the segment includes the length of the suffix. For example, to add a two-character suffix of -P to a four-digit version of a formula, specify:

    • Length: 6
    • Copy From: FORMULA
    • Copy Mask: *\CCCC
    • Default/Custom Config: SUFFIX= -P
    Copy Mask
    Portion of the object name to copy. This segment is used with
    • Save As event
    • Create From As Copy events
    • Copy From column

    Use these conventions. Examples are shown for AC-10.01-S02\0001.

    Character Description Format Example
    c include CC AC
    X ignore CCXXXCC AC.01
    * ignore (left) *.CCCCCC 01-S02
    @ ignore (right) @.CC 10
    # include up to #.

    #\

    AC-10

    AC-10.01-S02

    Both the * and @ characters can be used in multiples, if necessary, to capture the correct characters. For this example, use AC-10.01-S02\0001.

    Character Description Example
    **-CCC Ignore characters up to the second hyphen from the left; then include the next three characters. S02
    @@-CC Ignore characters up to the second hyphen from the right; then include the next two characters in left to right order. AC
    Enum Query/Seq. Name/Lookup

    Type = Selection: Enter the enumerated list or query code. Use an existing enumerated list or create your own. See Enumerated lists. For Enum Queries, create your own or use an existing query from the QUERY object in the Configure menu. The QUERY_CODE must begin with ENUM, but specify the name without the "ENUM" portion. For example, to use the ENUMUOM list, specify "UOM".

    Type = Sequence: Sequence name (existing or new). When users select the Create Rule method, the Sequence number is assigned automatically.

    Type = Lookup: Enter the lookup set code.

    Type = Template: The entry will be a query code (not starting with ENUM) that provides a list of valid template records. You can supply your own Enum query in the Enum Query/Seq. Name/Lookup column, or use one already provided (see table below). Your query must return two columns: TEMPLATE_CODE (object code or code\version) and DESCRIPTION.

    Default template queries are provided for these symbols:

    Symbol Template Query
    Analysis ANALYSISTEMPLATEGET1
    Formula FORMULATEMPLATEGET1
    Item ITEMTEMPLATEGET1
    Project PROJECTTEMPLATEGET1
    Specification SPECTEMPLATEGET1
    Default/Custom Config.
    Default segment value. Required for these segment types: Fixed, Script, and Template (for a specific object to serve as the template). Optional for Prompt, Selection, Sequence, Next Key, Ver.Subver, Lookup.

    Make entries in the Copy From and Copy Mask columns.

    For Sequence, specify FILLGAPS to make Optiva use the lowest unused number in the sequence. Specify FILLGAPS_ITEM for formula create rules or FILLGAPS_FORMULA for item create rules to find the corresponding gap for manufactured items and formulas. Used when gaps exist in a sequence. Logically deleted objects are considered to be gaps. This works only for entirely numeric object codes.

    For Next Key, specify ALPHA_ENGLISH for alphabetic sequencing. Specify LOCKED to prevent the NextKey segment from being edited.

    For Script, specify the name of the copy method that uses the VB.NET script function.

    Exclude Pattern
    Not used in the web client.
    Section Caption
    Specify text labels that explain to users what kind of information is required for the next group of segment controls. The Section Caption label supports the use of multiple languages. See Example of section captions. Use the Language Translation button to open the Language Translation dialog, which provides a way to enter sections captions in other supported languages.
    Column
    The column in which a segment is displayed. You can put multiple Segment Names on the same row. Valid column values are 1, 2, 3.
    Key Check
    When you specify a symbol, manually entered values are validated.
    Force to Uppercase
    To force a segment to uppercase, select the Force to Uppercase check box.
    Sort Order
    Displays the number corresponding to the order of fields seen by the user executing the Create Rule. The value in the Sort Order column is changed when you reorder, delete or insert a new row in the Code Segments tab. Copy methods use the GetSegData() function to read the Sort Order field, but use of that function has always been problematic because if the order of fields is changed, GetSegData() will read the wrong field unless updated. In older versions of Infor PLM for Process, this column was labeled Line #.
    Row ID
    Displays the Row ID value. Unlike Sort Order, the Row ID value is not changed when you reorder, delete or insert a new row into the Code Segments tab. A new scripting function has been created to use the Row ID instead of Sort Order in copy methods so a change to segment order will not necessarily require a copy method change. Existing copy methods and create rules will still use the Row ID and will still work after upgrade. See GetSegData and GetSegDataByLineID in the Infor PLM for Process Scripting Administration Guide for more information.
    Note: When you delete a code segment or insert a new code segment in the middle of an existing Create Rule, you must update the copy method to replace GetSegData with GetSegDataByLineID correct all segment details. Copy Method scripts have a find/replace function to simplify this.