Preview App Control - how can I correctly start PAC using my client & server

I’m currently trying to use the PAC for our application, which at the moment only starts the client and server in the ./bin directory, I am planning to change this to our custom client and server as opposed to the given version (./bin/server & ./bin/client), I’ve played around with the settings.json of the PAC but this is not working correctly thus far.

My questions - is this PAC meant to work with custom projects or was only meant to be a preview starter (playground) for the template from the A12 installer?

If this is meant to work with custom projects then how is this to be configured, I tried modifying the settings.json with .js of my client & .jar for the client but this doesn’t exactly work correctly. (e.g. I get Could not start bap-server in 600000 ms although actuator was already accessible before this for the server).

Hej @ezekiel-risen-module, the Preview App Control is only intended to start the Preview App from the installer, it is not intended for custom applications.

Oops…, are there any future plans to support custom applications, asking as this is a very valuable tool for BA(s)

Not to my knowledge, maybe @annemarie-clear-alder knows more?

Hi @ezekiel-risen-module and @eva-solid-surge . As @eva-solid-surge said, the PAC is only intended for use with the Preview app in the installer. For custom application the project template is available as a starting point. You can find more information about the project template in our documentation under the Development → Get Started section here: GetA12 Login
There are also some tutorials available that are based on the project template:
GetA12 Login
GetA12 Login
Maybe these would be of interest to you?

Thanks for the response @annemarie-clear-alder & @eva-solid-surge - the tutorials won’t help for now as my project is already fully set up, we’re only looking to reuse PAC for BA(s) comforts.

hi @ezekiel-risen-module despite the fact that PACs only official supported usecase is starting the preview app, your usecase should work in principle.

prerequisites

  • a node js app for the front-end
// bin/preview-app-control/5.2.0/settings.json
// ...
"path": "../../bap-client/202206.0.7/app.js"
// ...
  • bootable server jar
// bin/preview-app-control/5.2.0/settings.json
// ...
"path": "../../bap-server/202206.1.4/server-202206.1.4.jar"
// ...

Then

(e.g. I get Could not start bap-server in 600000 ms although actuator was already accessible before this for the server)

Please check the startupCheck of the server entry:

// bin/preview-app-control/5.2.0/settings.json
"bap-server": {
            // ...
            "process": {
                // ...
                "startupCheck": {
                    "value": "Started ServerApplication in"
                }
            }
        },

Check the logs (e.g. in expert mode view ) if this value is ever printed by stdout. You are also free to change the startup check into an actuator check:

// e.g.
"startupCheck": {
                    "path": "/actuator/health",
                    "key": "status",
                    "value": "UP"
                }

in general
check the PAC logs for any issues appearing and your handed in environment variables.

environment variables will be taken from application.yml of bin/bap-server/202206.1.4 and workspace.json in workspace root (e.g. workspaces/202206.1.2-basic/)

// workspace.json
// ...
"environmentVariables": {
        "bap-server": {
            // desired prop has to be added here as [relaxed binding](https://docs.spring.io/spring-boot/docs/1.1.x/reference/html/boot-features-external-config.html#boot-features-external-config-relaxed-binding) in form of:
            // "Environment variables are usually underscore-separated and upper case"
        }
    },
// ...

Keep in mind that PAC will set some of the variables on its own by using information from workspace.json this could lead to force you to change some of these variables on your own via workspace.json.
List of env vars set by PAC and used by “bap-server”:

  • SERVER_PORT
  • MGMTP_A12_UAA_AUTHENTICATION_USER_ACCESS_RIGHTS_RESOURCE
  • MGMTP_A12_UAA_AUTHENTICATION_USER_LOCAL_CONFIG_USER_RESOURCES
  • LOGGING_FILE_NAME
  • SPRING_DATASOURCE_URL
  • MGMTP_A12_DATASERVICES_SEARCH_LUCENE_HOMEDIR
  • MGMTP_A12_DATASERVICES_ATTACHMENTS_EXT_FS_LOCATION
  • MGMTP_A12_DATASERVICES_INITIALIZATION_IMPORT_MODELS_PATH

:warning: Again - this is not officially supported by A12 PAC