Solved

Deployment order of customer modifications

  • 11 January 2023
  • 2 replies
  • 502 views

Badge +2
  • Do Gooder (Customer)
  • 2 replies

Hello everyone,

we are developing our own modifications for IFS Cloud 22.2.2 with the IFS Developer Studio. We had several issues before ordering environments and deliveries from the build place which were related to the compilation and deployment procedure. But now I do not how to fix this problem.

 

Szenario

We added a custom field to CustomerOrder in Component ORDER. This field is a enumeration.

The enumeration was placed in component ORDER.

Now we want to use this enumeration in Component CFGCHR - Entity ConfigOptionValue.

 

But the deployment when ordering an environment fails:

 

!!!Error deploying file cfgchr/ConfigOptionValue.apv at 10-JAN-23 14:35:53
!!!Error creating VIEW CONFIG_OPTION_VALUE
CREATE OR REPLACE VIEW CONFIG_OPTION_VALUE AS
SELECT
       characteristic_id              characteristic_id,
       option_value_id                option_value_id,
       description                    description,
       note_text                      note_text,
       Pol_Legal_Constraints_API.Decode(pol_legal_constraints) pol_legal_constraints,
       pol_legal_constraints          pol_legal_constraints_db,
       pol_int_opt_val_msg            pol_int_opt_val_msg,
       pol_ext_opt_val_msg            pol_ext_opt_val_msg,
       pol_conf_opt_in_use            pol_conf_opt_in_use,
       rowkey                         objkey,
       to_char(rowversion,'YYYYMMDDHH24MISS') objversion,
       rowid                          objid
FROM   config_option_value_tab
WITH   READ ONLY

ORA-00904: "POL_LEGAL_CONSTRAINTS_API"."DECODE": invalid identifier


!!!Error deploying file cfgchr/ConfigOptionValue.apv at 10-JAN-23 14:35:53
!!!Error occurred while executing Plsql Block
DECLARE
   PROCEDURE Alter_Column_Comment (
      view_name_   IN VARCHAR2,
      column_name_ IN VARCHAR2,
      comment_     IN VARCHAR2)
   IS
      stmt_ VARCHAR2(32767) := 'COMMENT ON COLUMN ' || view_name_ || '.' || column_name_ || ' IS ''' || REPLACE(comment_, '''', '''''') || '''';
   BEGIN
      EXECUTE IMMEDIATE stmt_;
   END Alter_Column_Comment;
BEGIN
   Alter_Column_Comment('CONFIG_OPTION_VALUE', 'characteristic_id', 'FLAGS=PMI--^DATATYPE=STRING(24)/UPPERCASE^PROMPT=Characteristic Id^REF=ConfigCharacteristic^');
   Alter_Column_Comment('CONFIG_OPTION_VALUE', 'option_value_id', 'FLAGS=KMI-L^DATATYPE=STRING(24)/UPPERCASE^PROMPT=Option Value Id^');
   Alter_Column_Comment('CONFIG_OPTION_VALUE', 'description', 'FLAGS=AMIUL^DATATYPE=STRING(100)^PROMPT=Description^');
   Alter_Column_Comment('CONFIG_OPTION_VALUE', 'note_text', 'FLAGS=A-IU-^DATATYPE=STRING(2000)^PROMPT=Note Text^');
   Alter_Column_Comment('CONFIG_OPTION_VALUE', 'pol_legal_constraints', 'FLAGS=A-IUL^DATATYPE=STRING(200)^ENUMERATION=PolLegalConstraints^PROMPT=Legal Constraints^');
   Alter_Column_Comment('CONFIG_OPTION_VALUE', 'pol_legal_constraints_db', 'FLAGS=A----^DATATYPE=STRING(20)^PROMPT=Legal Constraints^');
   Alter_Column_Comment('CONFIG_OPTION_VALUE', 'pol_int_opt_val_msg', 'FLAGS=A-IU-^DATATYPE=STRING(2000)^PROMPT=Internal Message^');
   Alter_Column_Comment('CONFIG_OPTION_VALUE', 'pol_ext_opt_val_msg', 'FLAGS=A-IU-^DATATYPE=STRING(2000)^PROMPT=External Message^');
   Alter_Column_Comment('CONFIG_OPTION_VALUE', 'pol_conf_opt_in_use', 'FLAGS=A-IU-^DATATYPE=BOOLEAN^PROMPT=Pol Conf Opt In Use^');
   EXECUTE IMMEDIATE 'GRANT SELECT ON CONFIG_OPTION_VALUE TO IFSSYS';
END;


ORA-00904: "POL_LEGAL_CONSTRAINTS": invalid identifier
ORA-06512: at line 9
ORA-06512: at line 16


!!!Error deploying file cfgchr/ConfigurationCharacteristicHandling.svc at 10-JAN-23 14:37:42
!!!PACKAGE BODY CONFIGURATION_CHARACTERISTIC_HANDLING_SVC created with compilation errors
PL/SQL: ORA-00904: "POL_CONF_OPT_IN_USE": invalid identifier error at line no :2190
PL/SQL: SQL Statement ignored error at line no :2181

 

 

This is because the enumeration api package is deployed after the view for ConfigOptionValue. I checked this by comparing timestamps in the specific component logs...

 

How can we fix this? I checked the deploy.ini. But the components already have a dynamic reference to each other. 

 

The modification is in one feature branch. The enum was commited seperatly after the entity modification. 

 

We have a similiar issue with an enum field in CcCase which references our own CMOD module. Here I could move the enum to calc but not in the case above …

 

Can somebody help?

 

On a more general point: Is there any more documentation on how the build / deployment order is decided? How is decided which .cre and cdb files are executed during a feature branch environment. And how for ordering deliveries. We had cases where the feature branch worked fine but then the deployment for ordering the delivery failed ...

 

All the best!

icon

Best answer by Jonas Feigl 11 January 2023, 11:05

View original

2 replies

Userlevel 5
Badge +17

Hi @corie!

The deploy.ini defines the order that components are deployed:

  • Before starting deployment of the components the installer identifies a tree structure of all components with STATIC dependencies and makes sure that all components with static dependencies are deployed in the correct order. 
  • For components with DYNAMIC dependencies there is no mechanism to have them deployed in a fixed order. It could be “ORDER then CFGCHR”, “CFCHR then ORDER” or even “CFGCHR and ORDER in parallel”.
  • To avoid dynamic dependencies to cause issues you have to considering this in your models and code.

As you have already identified correctly there is a dynamic dependency between your two components which means there is no guaranteed deployment order for them. To avoid this causing deployment errors you can define a dynamic component dependency on the affected attribute in the -Cust.entity model:

 

This then leads to a Decode method being generated in Config_Option_Value_API. As you can see this method contains conditional compilation ($IF) to handle this dependency:

 

This Decode method is then used in the view definition to avoid the error you are having as the view now doesn’t reference the Pol_Legal_Constraints_API anymore:

 

Regarding your more general questions:

  • The deployment order of components always follows the same logic logic, independent on if it is a feature branch, delivery, etc. 
  • As you can see above for conditional compilation we use the component packages (e. g. “Component_ORDER_SYS”. These packages have a constant “INSTALLED” in the header that defines if a component is installed or not.
  • During any delivery installation this constant is temporarily set to “FALSE” to allow bypassing of reference errors - which is the whole point of the conditional compilation. After all components are deployed this is set back to TRUE and all objects referencing it are recompiled.
  • There is one big condition here though: The constant in the conditional compilation package (i.e. “Component_ORDER_SYS.INSTALLED”) is only set to FALSE during delivery installation if both of the following two things are true:
    • The component itself (i.e. “ORDER”) is included in the delivery
    • The delivery also contains another component that has a DYNAMIC to it (i.e. “CFGCHR” has a dynamic dependency to “ORDER”)
  • It is this limitation that can lead to different behaviour during feature branch deployment and delivery deployment: If you combine multiple developments into a single delivery you will get different combinations of components that during the feature branch bulid leading to potentially slightly different deployment orders as well as additional conditional compilation packages being set to FALSE.

I know this is quite a complex topic and I hope this all makes sense.

Badge +2

@Jonas Feigl : Thank you very much for your quick and detailed reply. I was aware of the conditional compilation features, just did not now that specific property was available for attributes. I found the solution in the meantime by checking other entity files and having another look at the documentation.

But you detailed explanation clearified some other question I had :D

 

https://docs.ifs.com/techdocs/22r2/060_development/027_base_server_dev/030_mechanisms/040_dynamic_calls/

 

Reply