Preparing an Approval Engine Database

The Approval Engine (AE) application requires a PostgreSQL database for keeping information about:

  • Modules whose objects require approval (for example, Order Management),
  • Actions available for an application,
  • Created workflows,
  • Steps that comprise workflows,
  • Criteria defined in workflows,
  • Incoming requests,
  • And all actions performed on particular approval requests.

Before deploying the database for the Approval Engine application, make sure all prerequisites are met.

To prepare the database for the AE application, complete the following steps:

  1. Connect to the node where the Approval Engine database will be hosted.

  2. Create the create_db.sql script file with the commands required for database creation. To do this, run the following command:

    cat << EOF > /tmp/create_db.sql
     DO
     \$\$
     BEGIN
     	IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = 'mservice_login') THEN
     	   CREATE ROLE mservice_login LOGIN;
     	   RAISE NOTICE 'Group mservice_login created';
     	END IF;
     END
     \$\$;
     CREATE USER :name PASSWORD :'password';
     \echo User :name created
     GRANT mservice_login to :name;
     \echo User is a member of mservice_login group
     GRANT :name to CURRENT_USER;
     CREATE DATABASE a8n_:name OWNER :name TEMPLATE template0;
     \echo Database a8n_:name created
     REVOKE :name from CURRENT_USER;
     SELECT pg_reload_conf();
     EOF
    
  3. Create the database by running the following command:

    su - postgres -c "psql -f /tmp/create_db.sql --set ON_ERROR_STOP=on -q -o /dev/null -v name='approvalengineapp' -v password='<db_user_password>'"

    where:

    • <db_user_password> is the password of the AE database user

When installing the component, you will need to specify the connection parameters to this database, which are the following:

Paramater Value
BackNet IP address of the database host The BackNet IP address of the server where the AE database is hosted.
Database name a8n_approvalengineapp
Database user name approvalengineapp
Password of the database user The password you specified during database creation.
CloudBlue, an Ingram Micro business, uses cookies to improve the usability of our site. By continuing to use this site and/or logging in you are accepting the use of these cookies. For more information, visit our Privacy Policy.