Defining a Generation Order for Stored Procedures

You can define the order of the generation of stored procedures by using traceability links with a type of DBCreateAfter. The procedure from which you start the traceability link is dependent on the procedure you link it to, and this influent procedure will be generated before the dependent procedure.

For example, a publisher may decide to sell certain books at a reduced rate (15%) when a customer's order is above 10 000$. The GENERAL CHECK stored procedure verifies orders globally by checking availability, the order amount, if a discount rate is required, and so on. This procedure calls the DISCOUNT CALC procedure to calculate the 15% discount rate. Consequently, DISCOUNT CALC must be generated before GENERAL CHECK, and you can enforce this by creating a traceability link of type DBCreateAfter from GENERAL CHECK to DISCOUNT CALC.

Note: There is a model check to warn you if you create a reflexive or circular set of traceability links of type DBCreateAfter. If generate without correcting this error, procedures will be generated in alphabetical order, without taking into account the generation order.
  1. Open the property sheet of the dependent stored procedure and click the Traceability Links tab.
  2. Click the Add Objects tool, click the Procedure sub-tab in the Add Object selection dialog, select the influent stored procedure, and click OK.
  3. Click in the Link Type column, click the down arrow and select DBCreateAfter.


  4. Click OK to close the property sheet and return to your model.
    Note: You can also create DBCreateAfter traceability links using the Traceability Links tool (see Defining a Generation Order for Views). For detailed information about traceability links, see Core Features Guide > Linking and Synchronizing Models > Getting Started with Linking and Syncing > Creating Traceability Links.