Version: 17.01
In this section we will learn about the Project.xpml file and its content. From now on, I will refer to it as XPML file since there can be only one Project.xpml file within a single Ultra Project.
The XPML file is the beginning point of the project when it comes to the execution of the project. Sample XPML file is shown in below XML and there are few key components in this file.
<x:project id="mySampleProject" name="mySampleProject" version="1.0-SNAPSHOT"
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:x="http://www.adroitlogic.org/x/x-project"
xsi:schemaLocation="http://www.adroitlogic.org/x/x-project
http://schemas.adroitlogic.org/x/x-project-1.0.0.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd">
<x:description>
A sample project that demonstrates the projects concept
</x:description>
<x:flows>
<x:flow id="sampleFlow" file="helloWorldFlow.xcml"/>
</x:flows>
<x:resources>
</x:resources>
</x:project>
Project Id - This specifies the Id of the project (id="mySampleProject)
Project Name - Name of the current Project (name="mySampleProject")
Project Version - Current version of the project (version="1.0-SNAPSHOT")
Description - A brief description about the current project
Flows - This section contains the current Integration Flows in the project. Only the flows specified in this section will be deployed when the project is executed.
Resources - This section contains spring beans which are used by the Integration Flows. User can add or remove beans through a UI and in the next section let’s see how to do that.
Below figure depicts the design view of the XPML file. As you can see, by clicking on the add Bean button you can create a new Spring bean as a resource.
When adding a Spring bean as a resource, first you must specify the Java class name of the resource you want to add. Within the dialog box, you can either type the short class name and it will suggest the fully qualified class name or you can directly specify the fully qualified class name as well.
After that, click on the load button and the modal will show you the setters and constructors available in the class. Specify the properties, constructor arguments you want and click the save button. This will add a resource bean to the XPML file with respective properties. After adding the resource, you can delete or edit the resource as well.
Apart from Spring beans for classes, you can add Maps and Lists as resources as well. (figure 1:2, figure 1:3) You can refer to these resources from your processing elements or connectors.