Define Method List¶
On many occasions you will only have one method in the Method List, f. ex. on migration of single basic data tables, but it would often be convenient to use more than one method from the business logic in one job. If you declare a special view or f. ex. define a JOIN in your data source, you can involve several IFS Logical Units.
To achieve this you can create a list of methods that should be executed for a job. Each method listed here will be executed in same order as specified in the execution sequence column. The methods you enter here must be valid IFS New__ or Modify__ methods or user-defined procedures stored in the database.
I.e. to migrate suppliers from a data source into IFS, you may want to add SUPPLIER_INFO, SUPPLIER_INFO_ADDRESS and SUPPLIER_INFO_ADDRESS_TYPE in the same job using the method list.
All methods defined in the method list will be executed for each row selected from the data source if the action In Loop is specified (see Show Select Statement for more information). If one method fails all data from previous methods in the list will be rolled back, and an error will be reported for the row. Note that this is not true if the IFS business logic itself performs a commit in the source code. If that happens, the row will be partially committed, and a note of this will be reported to the error log.
You may also invoke procedures or functions from the Method List. This is useful if you want to perform same functionality as a RMB-choice in the client, or if you need to lookup values (from Get-functions) during execution of the job.
- A Migration Job with direction Source Migration must be created.
- It is not necessary but highly recommended to configure the rules for the job before adding methods to the method list. This is because some of the rules will affect the way columns are created in the Source Mapping tab. Rules are configured in Migration Job/Rules
- If you are not sure what methods to use, try to insert or update data from the client, starting the debug-console to reveal method names. In principle, it should be possible to set up a migration job for all transactions that are committed from a Client window, providing you have a data source that delivers necessary information.
When inserting a new method in the method list, the system will automatically fill in column mappings in the Source Mapping tab. The mapping will be done by creating all the columns from the view specified in the View Name column. The columns will be mapped against columns from the source specified in Source Name. If the Source Name is blank the system will use the Source Name from the Formatting tab instead. Automatic creation of the column mappings will only be executed if the rule CREATEDET is set to Active for the job, which is the default by installation.
The columns from the view will be displayed Method List tab. The columns here represents the ATTR-string that will be created when the method is executed.
If you have entered a specific procedure or function in Method Name, then the IN/OUT-parameters of the method will be displayed in the Source Mapping tab and under Method List tab. The principle for assigning values to parameters are the same as described above.
Restrict execution of a method¶
Methods that are specified to execute 'InLoop', will be executed for each row of the main SELECT.
You may limit this by connecting the method to a specific Column Name with a given Column Value.
The method will now be executed within the loop only when specified column holds the specified value.
If your select is a JOIN of a MASTER/DETAIL relation, where you want to insert f.ex. order headers and order details, you may connect the method for order header to Check Box 'On New Master' . Now this method will be executed for new order headers only.
This requires a sorted SELECT.
More info about this is available from the Tips&Tricks menu.