Configuring custom Liberty data sources
To integrate custom datasources into your applications, configure the data source in the
Liberty configuration for Business Automation Workflow.
Procedure
- Add the required files, such as the JDBC driver, to the Workflow server pod, by using the
filestore persistent volume claim (PVC) that is mounted at /opt/ibm/bawfile.
For more information, see Accessing files for applications and configurations.
For example, run the following command to copy your JDBC driver to the Workflow server location /opt/ibm/bawfile, where jdbcdriver.file is the file you want to copy and
workflow-server-podis the name of one of your Workflow pods.
The files are stored in the persistent volume (PV) related to the PVC and are kept between restarts.oc cp jdbcdriver.file workflow-server-pod:/opt/ibm/bawfile/Note: For Workflow Process Server Runtime, you must set up node.customFilePVC. See Installing a CP4BA Workflow Process Service production deployment . - Create a valid XML snippet with the Liberty datasource settings that you want, starting
from the
<server>element.The file path in the configuration must match the appropriate container path. For more information, see Configuring relational database connectivity in Liberty
and
Administering Liberty manually
. This example uses a PostgreSQL database.<server> <dataSource id="PostgresSQLDataSource" jndiName="jdbc/postgres"> <jdbcDriver libraryRef="PostgresLib" /> <properties.postgresql databaseName="customdb" serverName="dbserver.mydomain.com" portNumber="5432" user="username" password="password"/> </dataSource> <library id="PostgresLib"> <file name="/opt/ibm/bawfile/postgresql-42.6.2.jar"/> </library> </server> -
To customize Liberty with your XML snippet, follow the instructions for your environment
type.
- For Workflow Runtime: Customizing Business Automation Workflow properties
- For Workflow Process Server Runtime: Customizing the Liberty configuration
- For Workflow Authoring or Workflow Process Server Authoring: Customizing Business Automation Studio properties