Dashboard > Appistry EAF v3.8 > Documentation > Fabric Application Definition XML
Log In   View a printable version of the current page.  

Overview

An application definition file identifies several elements that comprise a fabric application. Fabric package uses this file to bundle all the application files into one package. Only one version of an application can exist on the fabric at a time.

Example application definition file

<?xml version="1.0"?>
<!DOCTYPE app SYSTEM "FabricApp.dtd">
<app name="sample_app" version="1.0">
    <tasks>
        <file name="my_java_task.xml"/>
    </tasks>
    <process-flows>
        <file name="my_proc_flow.xml"/>
    </process-flows>
</app>


Table - Fabric Application XML Description

Element Description
app This is the root element of the Fabric application description: one application is defined per XML file.
Attribute Use Description
name required The name of the Fabric application. This element is required and is a FabricIdentifier.
version required The version of the Fabric application. The Fabric uses the version value to ensure the most current version of the application is running. All version numbers are right justified and zero filled. When comparing version 1.2 with 1.19, the Fabric actually compares 1.02 with 1.19. Version 1.19 is considered newer than version 1.2. Also, when comparing version 1.0.0 with 1.0 and 1, 1.0.0 is considered newer than version 1.0 and 1.0 is considered newer than version 1.

The app element defines the following child elements. The elements are listed in the order that they must appear in the XML:

Element Cardinality Description
group-access 0..1 Controls access to the application during execution. See Fabric Security Overview.
tasks 0..1 The list of task definition files to include in the application.
spring 0..1 Defines a scope for Spring related elements.
components 0..1 The list of component definition files to include in the application.
process-flows 0..1 The list of process flow definition files to include in the application.
fars 0..1 The list of fabric archives on which the application will depend.
java-libs 0..1 The list of java libraries to include in the application and add to the user class path.
libs 0..1 The list of native libraries to include in the application and add to the user path.
support-files 0..1 The list of additional files of any type to include in the application.

An example:

<?xml version="1.0"?>
<!DOCTYPE app SYSTEM "FabricApp.dtd">
<app name="order-app" version="1.0">
    <components>
<!-- component files go here -->
    </components>
    <java-libs>
<!-- java lib files go here -->
    </java-libs>
</app>
bean-factory-locator This element is used to provide the Fabric application with a Spring bean factory or application context. The bean factory is used to provide instances of Java objects to the Fabric at runtime. The Fabric obtains an object (Spring bean) by calling the "getBean(String beanName)" method on the bean factory. The bean name that is used during the call to getBean method is determined by a Component definition.

The resource-location attribute is optional, and by default will point to the beanRefFactory.xml file found on the classpath.

Attribute Use Description
bean required The name or id of the Spring bean that defines the bean factory or application context.
resource-location optional Specifies where to locate the spring configuration file that contains the bean definition. If not specified the value will default to "classpath*:beanRefFactory.xml".

The resource-location attribute uses an extended URL syntax to reference the resource. The table below lists some examples:

Type Description Example Attribute
file location on the file system resource-location="file:beanFactory.xml"
http online resource resource-location="http://www.domain.com/beanFactory.xml"
classpath file on the classpath resource-location="classpath:beanFactory.xml"

An example:

<app name="..." version="...">
    <spring>
        <bean-factory-locator bean="my-bean-factory"
                              resource-location="classpath:my-bean-factory.xml" />
    </spring>
    ...
</app>

components The components element identifies the list of component definition files to include in the application.

The components element defines the following child elements:
Element Cardinality Description
file 1..n Includes a component definition file in this application.

An example:

<app name="..." version="...">
    <components>
        <file name="my_component.xml"/>
    </components>
    ...
</app>

far Identifies the name of a Fabric Archive on which the application will depend. Java libraries and native shared libraries listed in the FAR will be added to the application's class loader or the native library path.

Attribute Use Description
name required The name of the Fabric Archive. This attribute is a FabricIdentifier.

An example:

<app name="..." version="...">
    ...
    <fars>
        <far name="my-far"/>
    </fars>
</app>

fars The fars element identifies a list of Fabric Archives that can be referenced in this application. See far.

The fars element defines the following child elements:
Element Cardinality Description
far 1..n Includes a Fabric Archive in this application.

file Identifies the name of a file to be included in the element set. See components, tasks, process-flows, libs, java-libs, or support-files.
Attribute Use Description
name required The name of the file to include in the application.
Absolute paths and parent directories are not allowed.

group Identifies the name of a group that is authorized to run the application. See group-access.
Attribute Use Description
name required The name of a group that is authorized to run the application.

group-access The group-access element identifies the list of groups authorized to run the application.

If the group-access element is not present, all users have authorization to run the application. Consult with your fabric administrator for group members and group names. For more information, see Application Security.

The group-access element defines the following child elements:
Element Cardinality Description
group 1..n Identifies the name of a group that is authorized to run the application.

An example:

<app name="..." version="...">
    <group-access>
        <group name="my-group"/>
    </group-access>
    ...
</app>

java-libs The java-libs element identifies the list of Java libraries (e.g. JARs) to include in this application. The files in this list are added to the application class loader at package time and run time.

The java-libs element defines the following child elements:
Element Cardinality Description
file 1..n Includes a Java library in this application. It will also be added to the application class loader when the application is packaged and run in the fabric.

An example:

<app name="..." version="...">
    ...
    <java-libs>
        <file name="my_java.jar"/>
    </java-libs>
</app>

libs The libs element identifies the list of native shared libraries to include in the application. The libraries are made available to the application at package time and run time. The directories of the files are added to the PATH environment variable in Windows and the LD_LIBRARY_PATH environment variable in Linux. They will appear on the PATH/LD_LIBRARY_PATH in the order that they appear in the XML.

The libs element defines the following child elements:
Element Cardinality Description
file 1..n Includes a native shared library in this application. The libraries are made available to the application at package and run time.

An example:

<app name="..." version="...">
    ...
    <libs>
        <file name="my_lib.dll"/>
    </libs>
</app>

process-flows The process-flows element identifies the list of process flow definition files to include in the application.

The process-flows element defines the following child elements:
Element Cardinality Description
file 1..n Includes a process flow definition file in this application.

An example:

<app name="..." version="...">
    ...
    <process-flows>
        <file name="my_process_flow.xml"/>
    </process-flows>
</app>

spring Defines a scope for Spring related elements in the application. Only bean-factory-locator is currently defined.

The spring element defines the following child elements:
Element Cardinality Description
bean-factory-locator 1..n Identifies a Spring bean factory or application context to use in the application.

An example:

<app name="..." version="...">
    <spring>
        <!-- Spring related stuff goes here (currently just bean-factory-locator). -->
    </spring>
    ...
</app>

support-files The support-files element identifies a list of files of any type to include in the application.

The support-files element defines the following child elements:
Element Cardinality Description
file 1..n Includes a file of any type in this application.

An example:

<app name="..." version="...">
    ...
    <support-files>
        <file name="my_data.dat"/>
    </support-files>
</app>

Java libraries and native shared libraries required by your application should be included in either java-libs or libs to ensure that they are properly added to the application class loader or native library path. JARs listed under support-files will be added to the application class loader but this behavior is deprecated.

tasks The tasks element identifies the list of task definition files to include in the application.

The tasks element defines the following child elements:
Element Cardinality Description
file 1..n Includes a task definition file in this application.

An example:

<app name="..." version="...">
    <tasks>
        <file name="my_tasks.xml"/>
    </tasks>
    ...
</app>

Example application definition with components

<?xml version="1.0"?>
<!DOCTYPE app SYSTEM "FabricApp.dtd">
<app name="app_with_components" version="1.0">
    <components>
        <file name="pojo_component.xml"/>
    </components>
    <process-flows>
        <file name="add_integers_flow.xml"/>
    </process-flows>
</app>

Example application definition with spring

<?xml version="1.0"?>
<!DOCTYPE app SYSTEM "FabricApp.dtd">
<app name="touchless_app" version="1.0">
    <spring>
        <bean-factory-locator bean="myBeanFactory"
                              resource-location="classpath:beanRefFactory.xml"/>
    </spring>
    <components>
        <file name="pojo_component.xml"/>
    </components>
    <process-flows>
        <file name="spring_add_integers_flow.xml"/>
    </process-flows>
    <fars>
        <far name="my-spring"/>
    </fars>
</app>