Applications need to construct Accounting Flexfield combinations automatically for various purposes. The Account Generator feature uses Oracle Workflow technology to provide applications with the ability to construct key flexfield combinations automatically using customized construction criteria. Each site can customize how they want to build key flexfield combinations.
For information on implementing and using Oracle Workflow, see the Oracle Workflow documentation.
Automatic construction of key flexfield combinations speeds users' data entry.
Automatic construction of key flexfield combinations improves accuracy of data entry because users do not need to determine what key flexfield combination to enter.
Each site can customize rules for the construction of key flexfield combinations to match the existing way of doing business.
By using Oracle Workflow features, the Account Generator provides greater flexibility for creating customized rules to create account combinations.
Important: Before using or customizing the Account Generator, you should familiarize yourself with the basic concepts of Oracle Workflow. For more information, see the Oracle Workflow documentation.
The following are some of the Oracle Workflow terms for objects used in the Account Generator feature, along with descriptions of how they relate to the Account Generator. You should read about these terms in the Oracle Workflow documentation first.
An item type represents a grouping of a particular set of processes and components. Within an item type there can be up to six types of components: Attributes, Processes, Notifications, Functions, Messages, and Lookup Types. In an Account Generator, the most relevant components are Attributes, Processes, and Functions.
There are two kinds of attributes, item attributes and activity attributes. Item attributes are properties of the item type, and activity attributes are properties of a function or activity. An item attribute value can be assigned to an activity attribute, but not vice versa.
A function is a PL/SQL stored procedure which accepts standard arguments and returns a completion result. For example, a function can retrieve a value for a particular segment for a code combination.
A process is a set of activities in a specific relationship. In the Account Generator, the process specifies the sequence of activities that are performed to create a code combination. A process activity can be part of a larger process, in which case it is called a sub-process. For example, the Oracle Assets FA Account Generator item type could contain a Generate Default Account process, which in turn contains three sub-processes: Generate Book Level Accounts, Generate Category Level Accounts, and Generate Asset Level Accounts.
A lookup type is a static list of values. This list can be referenced by activities and by item type, message or activity attributes. For example, an activity can reference a lookup type for its possible result values.
A basic Account Generator process contains the following function activities, in the order:
Start Generating Code Combination function
Functions to generate the code combination, for example, Assign Value to Segment, as well as functions to check if the code combination is complete. Some of these functions may be product-specific
Validate Code Combination function
End Generating Code Combination function
Oracle provides standard Account Generator process function activities that are described later in this chapter, in addition to standard Workflow activities described in the Oracle Workflow documentation. Each product's Account Generator process may also include additional product-specific functions. See the product-specific documentation for details on a particular process.
Note: A top-level runnable Account Generator process is represented by an icon called "flexproc.ico", which has the image of two gears on a yellow background with a representation of a flexfield combination at the bottom. A subprocess is shown by the "process.ico" icon, which has two gears in a yellow background. You can differentiate between the two types of processes using these icons.
Related Topics
Below is a description of the Account Generator flow:
A server-side PL/SQL function calls the Account Generator process to create an account. This function can be called from a form or from C or PL/SQL programs. This function takes several input arguments: the structure number of the key flexfield structure for which the combination is to be generated, and the values for all the item attributes that must be set before starting the workflow process.
Tip: See the product-specific documentation for information on how the Account Generator is called within that product.
The Account Generator process creates a combination using the values of the attributes and the function activities.
The function returns a value of TRUE if the Account Generator ends in success, and a value of FALSE otherwise. If the function ends in success, the function also returns the code combination ID, concatenated segments, concatenated IDs, and concatenated descriptions as output parameters.
The function returns its output to the calling program or form. Note that the Account Generator is only called from particular forms and programs, so if you change your accounting data via another form or program your accounts may not be automatically updated.
The Account Generator can derive segment values from form fields, other Accounting Flexfield combinations, flexfield segments, application tables, and constants.
Sources for values for the Account Generator
These are usually predefined by the application.
You can get values from individual segments of Accounting Flexfield combinations whose structure matches the one you are building. You can specify which segment supplies the value using either the segment name or its flexfield qualifier, if any. You can assign such segment values to your key flexfield structure directly.
For example, you can get a segment value from one combination of an Accounting Flexfield structure and use it to build another combination for the same Accounting Flexfield structure.
You can get values from individual segments of Accounting Flexfield structures other than the one you are building. You need to specify the structure number, and you can specify which segment supplies the value using either the segment name or its flexfield qualifier, if any.
You can get values from an application table.
You can specify a constant value for a segment of the key flexfield structure you want to build.
Several Oracle E-Business Suite products use the Account Generator to create combinations for the Accounting Flexfield.
Oracle Assets
Oracle Order Management
Oracle Purchasing
Oracle Receivables
Oracle Projects (with Oracle Purchasing and Oracle Payables)
Each of these applications provides a default Account Generator process. You can view and customize the Account Generator processes through the Oracle Workflow Builder. Some products' default processes may require customization before they can be used to create flexfield combinations. The product-specific documentation contains detailed information on implementing the Account Generator for a particular product. It also contains information on the product's default Account Generator process as well as information on how you may want to customize the default process.
Implementing an Account Generator process involves several steps:
Oracle provides a product-specific Account Generator item type, which may contain predefined attributes, functions, processes, and subprocesses. Oracle also provides the Standard Flexfield Workflow item type, which contains standard Account Generator functions.
On-site implementors can customize the Account Generator process as explained later in this chapter.
Implementors test the Account Generator process to confirm that it generates the desired combination correctly.
Related Topics
Customizing the Account Generator
Test Your Account Generator Setup
If you need to customize your application's default Account Generator, you should complete the following steps:
Define your Accounting Flexfield structure(s) completely.
Determine the characteristics of the Accounting Flexfield combination you want the Account Generator to construct (determine how the resulting flexfield combination should be populated).
Work backwards from your resulting Accounting Flexfield combination to determine what values you need and how to obtain them.
Specify additional attributes or functions you need, if any, and their properties, within the Oracle Workflow Navigator window.
If necessary, modify the default Account Generator process(es) in the Oracle Workflow Process window. Alternatively, you could create a new process entirely. Which approach you take depends on the extent of your modifications. In either case, you should save a copy of your workflow process definition as a flat file (a .wft file) and check that file into a source control system.
Important: If you have modified the default Account Generator process directly, you should ensure that your customizations are not overwritten when you upgrade to a future release. For more information, see the Oracle Workflow documentation.
Test your Account Generator process, as outlined in the product-specific documentation. Determine if you get the expected resulting Accounting Flexfield combination.
Assign the appropriate process to your Accounting Flexfield structure in the Account Generator Process window.
Start by determining the characteristics of the Accounting Flexfield combination you want to obtain as your result. Then work backwards from your resulting Accounting Flexfield combination to determine what values you need and how to obtain them.
What is the purpose of this combination? For example:
Oracle Order Entry transfers this combination to Oracle Inventory, via the Inventory Interface program, for use in cost of goods sold (COGS) analyses.
Oracle Assets uses this combination to create journal entries for asset transactions.
Oracle Purchasing uses this combination to specify accounts for individual distributions for purchase orders and requisitions.
What are the properties of this combination? For example:
This is an Accounting Flexfield combination with particular characteristics, such as a particular type of value for the balancing segment or the account segment.
Your resulting combination is "just like that other combination but with a different value for the second segment".
Each segment has some prescribed value.
Did a segment value come from a form field, another combination of the same Accounting Flexfield structure, a segment of another key flexfield, an application table, a constant, or somewhere else?
In customizing your Account Generator setup, you make modifications to the default process or create a new process using the Oracle Workflow Builder. For details on working within the Oracle Workflow Builder, see the Oracle Workflow documentation.
See the product-specific documentation for limitations on what you can and cannot customize. For example, you may not be allowed to customize a top level process, but only the subprocesses within it. Also, see if your product's Account Generator item type already includes attributes or functions you can use. Using pre-defined attributes and functions will save you time in your customization.
Save a copy of the original item type in a source control area as a flat file (.wft file) before beginning customizations. By saving the original as a flat file you can limit access to it, thus ensuring that you will always have a copy of the original file.
Important: If you have modified the default Account Generator process directly, you should ensure that your customizations are not overwritten when you upgrade to a future release. For more information, see the Oracle Workflow documentation.
Warning: You should never create a new item type as your Account Generator. Instead, start from the default Account Generator item type or a copy of it.
Important: You cannot modify the attributes or functions given to you in your default Account Generator item type. That is, you cannot select an attribute or function within the Navigator window and modify it. You can, however, modify the attributes of a function activity that is part of a process.
Warning: Do not change the threshold level of the Oracle Workflow Engine. All of your Account Generator functions should have low costs, so you should never need to change the threshold level.
You can create a new attribute for your Account Generator item type, which you can then use in your custom process. Note that custom attributes cannot be "input" attributes, that is, their values cannot be set by the calling form or program. After you create a new attribute, you need to set its value by adding a function activity to your process. For example, if the value comes from another code combination you could use the Get Value from Code Combination function activity from the Standard Flexfield Workflow.
You can modify the values passed to a function activity.
For example, suppose your default Account Generator process uses the standard function Copy Segment Value from Code Combination to copy a segment value from the default code combination. This function thus has "Default CCID" as the value for the attribute "Code Combination ID". However, suppose you want to use "Distribution CCID" instead of the "Default CCID". Assuming the Distribution CCID is available to the workflow, you would change function activity's attributes to use the Distribution CCID.
You can change the logic of the process by adding functions to the process diagram. Predefined standard Account Generator functions are described later in this chapter. Your product may have additional predefined functions that you can use. For information on these, see the product-specific documentation.
For example, suppose that you are working within the Oracle Assets Account Generator item type. In your process, you want to check to see if any account is a Category Account. You would then add the Check Category Account function activity in the appropriate place in the process diagram. If a function requires values to be passed in as arguments, you need to ensure the proper values are set for the attributes of the function. Also, make sure that if you expect a result from the function, the result type is set properly, and any transitions from the function branch appropriately.
Warning: Oracle Workflow provides activities that in general, you should not add to your Account Generator, namely, Notification and Block activities, since these halt the process.
Warning: In general, avoid using parallel branches in your Account Generator process diagram. The Oracle Workflow Engine processes activities sequentially. If your process includes parallel branches that converge on a single function, you should ensure that that function is an AND function, so that all required activities are completed before the Engine continues to the next activity in the process.
You can create a new function activity and add it to your Account Generator item type. The Oracle Workflow documentation contains information on how to create new function activities and any associated PL/SQL stored procedures.
You can create an entirely new Account Generator process in the Workflow Builder.
Select the item type that you want to create the process for. For example, for Oracle Assets you would choose the FA Account Generator item type. From the Edit Menu choose New Process. Within the property sheet that appears, specify an internal name, display name and description. The display name will appear in the Navigator window for the process, and it would be the name used in the Account Generator Process window. If your process itself will create a code combination specify "Flexfield Result". If this is the top-level process that you will actually run, specify "Runnable".
Tip: Examine your product's default Account Generator process diagram first to see how a process works.
Your start activity for the top-level process must be the Start Generating Code Combination function activity, which you can copy from the Standard Flexfield Workflow item type. Designate this as a Start activity in the process Properties page, under "Start/End."
You can then add activities to the process. See the Oracle Workflow documentation for details on how to add activities to a process, as well as details on standard Workflow activities.
See the section on the Standard Flexfield Workflow for generic Account Generator function activities you might want to add. For example, the activity Is Code Combination Complete? checks to see if all segments have values. The Validate Code Combination activity is useful for validating your combination after it has been generated. You can add the Abort Generation of Code Combination activity to terminate the process in the case of a fatal error. You should pass in an error message to this activity if you use it. This activity should be marked in the properties page as an "End" activity with the Result of "Failure".
In addition, your product's Account Generator may also contain function activities particular to your product that you may want to use. See your Oracle [Product] User's Guide for more information on these activities.
Once the combination has been generated and validated, your process should end with the End Generation of Code Combination standard flexfield workflow activity. This activity should be marked in the Properties page as an "End" activity with the Result of "Success".
If your custom process has a result type of "Flexfield Result," make sure your "End" activity(ies) give a result of "Success" or "Failure," since these are the possible values for "Flexfield Result."
Related Topics
To test your setup, make sure that the correct process is assigned to your structure in the Account Generator Process form. See: Choosing the Process for a Flexfield Structure.
Test your Account Generator setup as described in the product-specific documentation for the particular Account Generator process. In some products, you can test your setup within Oracle E-Business Suite; in others, you can test using a PL/SQL statement. Always test your setup on a test database before using it on a production database.
Set the profile option Account Generator:Debug Mode to "Yes" if you are using the Oracle Workflow Monitor to view your results during testing. This profile option will ensure that the runtime data is saved for debugging.
After you are finished testing, you can set Account Generator:Debug Mode to "No" to improve the performance of the Account Generator.
The Standard Flexfield Workflow item type provides special function activities for generating and validating key flexfield code combinations. These functions are in addition to the predefined Workflow activities described in the Oracle Workflow documentation. Also, your product may provide you with product-specific Account Generator functions. See the product-specific documentation for details on these additional functions.
The Standard Flexfield Workflow only provides you with function activities you can use to customize your own Account Generator workflow. The Standard Flexfield Workflow does not contain any attributes or processes to run. The following is a description of each of the Standard Flexfield Workflow function activities.
This function is used as the start activity of the top-level process that generates the code combination, and should be used only in the top-level process. It should not be used as a start activity of any subprocess the top level process may invoke. This function should be marked as a "Start" activity after copying it to the process window. This function does not have any attributes.
The Workflow Engine uses this function to get values from the calling form or program for attributes ("input attributes") that are used to build the combination.
Note: Do not use the Oracle Workflow Standard Start activity as the start activity of a top-level Account Generator process. The Account Generator may need to obtain attribute values that cannot be obtained using the Standard Start activity.
This function assigns a value to a specific segment of the combination. This function has the following attributes:
Segment Identifier: How the segment is identified, either "Qualifier" or "Name".
Segment: The flexfield qualifier name or segment name of the specific segment.
Value: The value to be assigned to the segment.
Replace existing value: Has the value of "False" if the value should be assigned only if the segment currently has no value, "True" if the value should be assigned even if the segment already has one.
This function copies a segment value from a given code combination to the combination that is being generated. This function has the following attributes:
Code Combination ID: The code combination ID for the combination from which the segment value will be copied.
Segment Identifier: How the segment is identified, either "Qualifier" or "Name".
Segment: The flexfield qualifier name or segment name.
Replace existing value: Has the value of "False" if the value should be copied only if the segment currently does not have a value, "True" if the value should be copied even if the segment already has one.
This function copies a segment value from a given code combination of a different accounting flexfield structure to the combination that is being generated. This function has the following attributes:
Structure Number: The structure number of the source combination.
Code Combination ID: The code combination ID for the combination from which the segment value will be copied.
Segment Identifier: How the segment is identified, either "Qualifier" or "Name".
Segment: The flexfield qualifier name or segment name.
Replace existing value: Has the value of "False" if the value should be copied only if the segment currently does not have a value, "True" if the value should be copied even if the segment already has one.
This function copies all the values from a given code combination to the combination that is being generated. If you set the "Replace existing value" attribute to "False", you can use this function to copy values from a default code combination to segments without values. This function has the following attributes:
Code Combination ID: The code combination ID for the combination from which values will be copied.
Replace existing value: Has the value of "False" if the value should be copied only if the segment currently does not have a value, "True" if the value should be copied even if the segment already has one.
This function retrieves a segment value from a given code combination and assigns it to an attribute of the current workflow item. This function has the following attributes:
Code Combination ID: The code combination ID for the combination from which values will be copied.
Segment Identifier: How the segment is identified, either "Qualifier" or "Name".
Segment: The flexfield qualifier name or segment name.
Attribute to assign value: The internal name of the item attribute to which the value should be assigned.
This function retrieves a segment value from a given code combination of another accounting flexfield structure and assigns it to an attribute of the current workflow item. This function has the following attributes:
Structure Number: The structure number of the source combination.
Code Combination ID: The code combination ID for the combination from which values will be copied.
Segment Identifier: How the segment is identified, either "Qualifier" or "Name".
Segment: The flexfield qualifier name or segment name.
Attribute to assign value: The internal name of the item attribute to which the value should be assigned.
This function checks to see if values have been assigned to all segments in the code combination. This function returns "True" if all segments have values and "False" if one or more segments do not have values. This function has the following attribute:
Check only for required segments: If this attribute is set to "True" then the function only checks if the required segments have values. If this attribute is set to "False", then the function checks that all segments have values.
This function validates the code combination that has been generated. It has the following attributes:
New code combinations are allowed: If this attribute is set to "True" AND the key flexfield has 'Dynamic Inserts Allowed' set to "True", then the validation will not generate an error if the combination does not exist in the code combination table.
Validation Type: Either use "Generate Code Combination ID" to do a full validation and generate a code combination ID, or use "Validate Segments with Values only" to do value validation on only segments with values. Full validation applies to the entire combination to see if it is a valid combination. "Validate Segments with Values" only validates the values for segments with values.
Note: If the code combination in question is new (that is, it does not already exist in the code combinations table), this function activity does not insert it into the database or generate a new CCID for it. If the combination is successfully validated and dynamic inserts are allowed, then the function will set the CCID to -1, and this will be the value that will be returned to the calling form or program.
This function is used to end the Account Generator process when a fatal error occurs. An error message in the encoded format is passed to the function and that message is displayed in the calling form or program. This function should be marked as an "End" activity and should return a value of "Failure".
Error message: The error message for the failure condition. The message should be in the Message Dictionary encoded format.
This function ends the top level process of the account generation, after the combination has been generated and validated. This function should normally follow immediately after the Validate Code Combination activity. This function should be marked as an "End" activity and should return a value of "Success". It does not have any attributes.
For the functions listed above with the attributes Segment Identifier and Segment, "Qualifier" refers to the segment qualifier name that appears in the Qualifier window, for example, "GL_BALANCING". The segment "Name" refers to the Name specified in the Segments window. For information on segments, segment qualifiers, and validation see the following sections:
Related Topics
Use the Account Generator Processes window to assign Account Generator processes to Accounting Flexfield structures.
This window is under the navigation path Application > Flexfield > Accounts in the "System Administrator" responsibility.
To choose your Account Generator process:
Select the structure to which you want to assign a process. You can choose the application, flexfield title, structure, and description using View > Find...
Specify the Oracle Workflow Item Type containing the process.
Specify the process you want to use to generate the accounts.
The default process, as specified in the product-specific documentation, will default in. If you want to use a different process, enter the name of the process you wish to use.
The application which uses the Accounting Flexfield structure. A list of values is available for this field.
The title of the Accounting Flexfield. A list of values is available for this field.
The Accounting Flexfield structure for which the Account Generator will be creating combinations.
The Oracle Workflow item type which contains the process which will generate the code combinations.
The process within the above item type which will be used to create the code combinations. The default process, as specified in the product-specific documentation, will default in.