Thursday, September 26, 2013

Configurator: Check for Model Logic Status using Plsql API

Sometimes its useful to find how many model's logic is not upto date using plsql API. One simple example would be for during republish of the model - if model logic is not upto date at the time of publication processing, publication program will fail and model will not be published. Following block can be handy before running any publication or locally creating configuration for the model using CIO API.

DECLARE
  p_model_id      NUMBER := 1774920;
  x_return_status VARCHAR2(10);
  x_msg_data      VARCHAR2(256);
BEGIN
  CZ_PB_MGR.IS_MODEL_UPTO_DATE( P_MODEL_ID =>p_model_id, X_RETURN_STATUS =>x_return_status, X_MSG_DATA =>x_msg_data);
  dbms_output.put_line('X_RETURN_STATUS = ' || X_RETURN_STATUS);
  dbms_output.put_line('X_MSG_DATA = ' || X_MSG_DATA);
END;

If x_return_status=1 then logic is not upto date, 0 value means logic is upto date.