> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# buildAPEX

> Builds an APEX application artifact, sourcing from an SCM or Oracle APEX Application Builder in a development environment. This operation can be used

Builds an APEX application artifact, sourcing from an SCM or Oracle APEX Application Builder in a development environment. This operation can be used in conjunction with FlexDeploy's Full and Package-Based deployment models.

* Full Deployment

  * Entire application gets exported.

  * Source from SCM

    * Set desired SCM type.

    * Add SCM export or checkout operation before buildAPEX operation in workflow.

  * Source from App Builder

    * Set SCM type to None. 

    * You only need to add buildAPEX operation in workflow.

* Package-based Deployment

  * Only selected page/components are exported. You can also export All Files, which means entire application gets exported.

  * Source from SCM

    * Set desired SCM type.

    * You only need to add buildAPEX operation in workflow.

    * SCM export or checkout operation is not required at all as FlexDeploy will implicitly perform extract of files from SCM based on project configurations.

  * Source from App Builder

    * Set SCM type to None.

    * You only need to add buildAPEX operation in workflow.

    * Oracle JDBC driver must on the FlexDeploy server's classpath. If the FlexDeploy is setup to use Oracle Database, the driver will be already available. However, if the FlexDeploy is using PostgreSQL or MySQL, then you will need to place the Oracle JDBC Driver on the FlexDeploy server, add it to the server's classpath, and restart it.

Artifact generated by this operation is zip file containing split application sql files. For APEX versions 4.x, no split is done hence artifact will be entire application sql file.

# Target Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Oracle SQLcl Home</td><td>`FD_SQLCL_HOME`</td><td>Yes</td><td>Folder where SQLcl is installed. *Only required if sourcing from App Builder.*Make sure that the endpoint Java Home is a high enough version for your SQLcl version.</td></tr><tr><td>APEX User</td><td>`FDAPEX_USER`</td><td>Yes</td><td>Provide database user APEX\_xxxxx (APEX user requires INHERIT Privilege) or owner (parsing schema) of the application for export and import operations. You can use system user as well. *Only required if sourcing from App Builder.*</td></tr><tr><td>APEX Password</td><td>`FDAPEX_PASSWORD`</td><td>Yes</td><td>Password for APEX User.  *Only required if sourcing from App Builder.*</td></tr><tr><td>Oracle Database URL</td><td>`FDORA_URL`</td><td>Yes</td><td>JDBC URL for Oracle database. For example:<ul local-id="d3b953db1df8"><li local-id="969c3a1fa965">jdbc:oracle:thin:@HOSTNAME:PORT:SID or</li><li local-id="f6231cfb0ef9">jdbc:oracle:thin:@//HOSTNAME:PORT/SERVICENAME</li></ul>*Only required if sourcing from App Builder.*Connecting to Oracle Autonomous DatabaseYou will need client credential zip file (wallet) to connect with Oracle Autonomous Database on Oracle cloud. You can download wallet zip file from Oracle Cloud, you will need admin userid and password to perform this download. See [Download Client Credentials (Wallets)](https://docs.oracle.com/en-us/iaas/autonomous-database/doc/download-client-credentials.html) for more details on how to download wallet file.<ul><li>**Since FlexDeploy 9.0.0.9 with Oracle Wallet Credential Type :** Instead of maintaining the wallet zip file under the file system, you can now store the wallet zip as an Oracle Credential Type in FlexDeploy. This allows for secure storage and use of the wallet.<ul><li>Use the URL syntax in the following format: `jdbc:oracle:thin:@service_low?TNS_ADMIN={{FDORACLE_WALLET_FILE}}` is replaced with the temporary wallet folder path during execution. Once execution is completed, the temporary file is cleaned up automatically.</li></ul></li><li>**Before FlexDeploy 9.0.0.9**<ul><li>You must make sure that only authorized users have access to these wallet files. Unzip the client credentials zip file (**wallet\_*****databasename*****.zip**) on FlexDeploy server and/or endpoint where it will be used. For example, /home/flexdeploy/.wallets/\<**wallet\_*****databasename***> is folder where specific wallet file was unzipped. Make sure to secure this folder to FlexDeploy and/or Endpoint user, so that it is not readable by all users.</li><li>We recommend using Oracle Wallet Credential Type for better security and easier management of Wallet usage.</li><li>**Database URL Syntax **: jdbc:oracle:thin:@service\_high?TNS\_ADMIN=/home/flexdeploy/.wallets/\<**wallet\_*****databasename***><ul><li>service\_high is one of the entries in the tnsnames.ora file where client credentials zip file was unzipped. See [Predefined Database Service Names for Autonomous Database](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/connect-predefined-generic.html) for details on services.</li><li>TNS\_ADMIN value in URL points to the location of the **unzipped client credentials zip file**.</li></ul></li><li>**Database URL Long Connection String Format Syntax **: `jdbc:oracle:thin:@(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=<hostname>))(connect_data=(service_name=<serice_name>))(security=(ssl_server_cert_dn="CN=<hostname>,OU=Oracle BMCS US,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))`<ul><li>Examples for the same can be found [here](https://www.oracle.com/database/technologies/java-connectivity-to-atp.html).</li></ul></li></ul></li></ul>If using the Oracle Database Plugin with ADW or ATP databases , use the \_low connection. The \_medium and \_high connections can sometimes throw error** ORA-12839: cannot modify an object in parallel after modifying it.**</td></tr><tr><td>Oracle Wallet File</td><td>`FDORACLE_WALLET_FILE`</td><td>No</td><td>**Since 9.0.0.9** - Provide the Oracle Wallet file, see[Credential Type - Oracle Wallet](https://docs.flexagon.com/flexdeploy-10-0-documentation/flexdeploy-users-guide/administration/credentials/credential-types/credential-type-oracle-wallet.md) for more details.</td></tr></tbody></table>

1 - Required only if sourcing from App Builder.

# Project Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Workspace Name</td><td>`FDAPEX_WORKSPACE_NAME`</td><td>Yes</td><td>APEX Workspace Name. Provide uppercase name. This defaults to FD\_INSTANCE\_CODE expression, so if you keep instance code same as your workspace, you will not need to change default value.\
</td></tr><tr><td>Parsing Schema</td><td>`FDAPEX_DB_SCHEMA`</td><td>No</td><td>Used to set the parsing (owner) schema of the APEX application. Provide uppercase schema name.</td></tr><tr><td>Application ID</td><td>`FDAPEX_APPLICATION_ID`</td><td>No</td><td>APEX Application ID</td></tr><tr><td>Application Name</td><td>`FDAPEX_APPLICATION_NAME`</td><td>No</td><td>APEX Application Name. Used to resolve the Application Id if Application Id and Application Alias are not provided.</td></tr><tr><td>Application Alias</td><td>`FDAPEX_ALIAS`</td><td>No</td><td>APEX Application Alias. An alphanumeric identifier unique within a workspace. If provided, the alias is used to resolve the application. Available since 10.0.0.2.</td></tr><tr><td>Export Supporting Object Definitions</td><td>`FDAPEX_EXPORT_SUPPORTING_OBJECTS`</td><td>No</td><td>Specify whether to export supporting object definitions with your application.</td></tr><tr><td>Export Private Reports</td><td>`FDAPEX_EXPORT_PRIVATE_REPORTS`</td><td>No</td><td>Specify whether to include private reports with your application.</td></tr><tr><td>Export Public Reports</td><td>`FDAPEX_EXPORT_PUBLIC_REPORTS`</td><td>No</td><td>Specify whether to include public reports with your application.</td></tr><tr><td>Export Report Subscriptions</td><td>`FDAPEX_EXPORT_REPORT_SUBSCRIPTIONS`</td><td>No</td><td>Specify whether to include interactive report or interactive grid subscription settings with your application.</td></tr><tr><td>Export Developer Comments</td><td>`FDAPEX_EXPORT_DEV_COMMENTS`</td><td>No</td><td>Specify whether to include Developer Comments in your application export.</td></tr><tr><td>Export Translations</td><td>`FDAPEX_INCLUDE_TRANSLATION`</td><td>No</td><td>Check to include Translations with your application export.</td></tr><tr><td>Use Offset</td><td>`FDAPEX_USE_OFFSET`</td><td>No</td><td>Determines if the plugin will attempt to set the Offset.</td></tr><tr><td>Offset value</td><td>`FDAPEX_OFFSET`</td><td>No</td><td>APEX Offset value</td></tr><tr><td>Use Original Ids</td><td>`FDAPEX_USE_ORIGINAL_IDS`</td><td>No</td><td>Determines if the plugin will use original ids when exporting.**@Since 8.0.0.9**</td></tr></tbody></table>

> [!TIP]
>
> FlexDeploy needs to identify the application id.  This can be provided by either entering the application id directly or by entering the associated application name. If the application name is not unique across workspaces, you must provide the workspace name in addition to the application name.

# Artifacts

Artifact generated by this operation is zip file containing split application sql files. For APEX versions 4.x, no split is done hence artifact will be entire application sql file.

# Endpoint Selection

This operation will select all available endpoints associated to the Target.

* If sourcing from App Builder, you can use any Endpoint where SQLcl is installed and has connectivity to database using JDBC URL. We recommend use of LOCALHOST endpoint if connectivity can be established between FlexDeploy and your APEX database.

* If sourcing from SCM, then you can use any Endpoint. We recommend using LOCALHOST endpoint in this case.

# Endpoint Execution

This operation will execute on any one of the selected endpoints and will be random in the determination of which one.
