The component process for the web component downloads the
most recent version of the component artifacts and puts those artifacts
in the correct folder.
Follow these steps to create the component process that deploys
the web component:
- From the Components tab, click the JPetStore-WEB component.
- Click Processes and then click Create
New Process.
- In the Create New Process window,
specify the name to be Deploy web component.
- In the Process Type list, select Deployment. This list has other options for processes that uninstall or
configure components.
- Accept the default values for the other properties and
click Save.
- From the list of processes, click the new process. The process opens in the process editor. This editor shows
the steps in the process in a graphical form, as a flowchart. The Start and Finish boxes
represent the beginning and the end of the process. From here, you
add steps to the process and link them between the Start and Finish steps
to show the order of the steps.
- Add a step to clean any files out of the working directory. The process runs within a working directory. To ensure that
you are using the most recent version of the files in the web component,
run a command to clean the working directory:
- At the left of the process editor, under Available
Plugin Steps, expand . The Available
Plugin Steps menu shows the available steps. You can explore
the trees to find steps, or you can type into the search box at the
top of the window.
- Under the FileUtils tree item,
click and drag the Delete Files and Directories step
to the process editor. The Edit Properties window
opens, showing the properties for the step. Some of these properties
are unique to the step and others are the same for all steps.
- In the Name field, specify the
name to be Clean working directory.
- In the Base Directory field,
specify a single period (.).
- In the Include field, specify
an asterisk (*).
- Accept the defaults for the other properties and then
click Save.
The new step appears as a box in the process editor. Later,
you connect this step to the other steps in the process. The process
editor looks like the following figure:
- Add a step to download the latest version of the component
artifacts. The Download Artifacts step
is used in most deployment processes. This step downloads the specified
version of the component artifacts to the target computer. When you
run the process, you will specify whether to use the most recent version
of the component artifacts or a specific version.
- Under Available Plugin Steps,
expand and drag the Download Artifacts step
to the process editor.
- In the Edit Properties window,
accept the default values and then click Save.
- Add a step to remove the old web content from the server:
- Expand and drag another Delete
Files and Directories step to the process editor.
- In the Edit Properties window,
specify the name to be Remove old content.
- In the Base Directory field,
specify the following directory:
webapps/JPetStore
- In the Include field, specify
the following directory:
images
- In the Working Directory field,
specify the following variable:
${p:environment/tomcat.home}
This
variable represents the main folder of the Tomcat web server. You
will specify a value for this variable later.
- Accept the default values in the other fields and click Save.
- Add a step to deploy the new content to the server. This step copies the component artifacts to the application
server.
- Expand and drag a Move
Directory step to the process editor.
- In the Edit Properties window,
specify the name to be Deploy new content.
- In the Source Directory field,
specify a single period (.).
- In the Destination Directory field,
specify the following directory:
${p:environment/tomcat.home}/webapps/JPetStore/
- In the Include Files field, specify
the following code:
images/*
- Accept the default values in the other fields and click Save.
Now the process has four steps, as in the following figure:
Each step has two icons at the upper right corner of
the step. The green Edit icon
opens the same Edit Properties window
that opens when you create the step. The X icon
deletes the step.
Also,
if you move the mouse over a step, an arrow icon appears over the
center of the step. This icon is used to create links between steps.

- Connect the steps in the order that they run:
- Move the mouse over the Start step,
and click and drag the arrow icon to the Clean working directory step. The arrow between these steps represents the flow of activity
from one step to another, as in the following figure:
- Similarly, drag an arrow from the Clean working
directory step to the Download Artifacts step.
- Drag an arrow from the Download Artifacts step
to the Remove old content step.
- Drag an arrow from the Remove old content step
to the Deploy new content step.
- Drag an arrow from the Deploy new content step
to the Finish step.
You can connect steps in a sequence like these steps,
or you can run steps in parallel with each other by creating more
links. However, processes always start with the Start step
and end with the End step. The sequence of
steps in this process is as follows:- Start
- Clean working directory
- Download Artifacts
- Remove old content
- Deploy new content
- Finish
- Save the process by clicking the Save
icon under Tools.
The complete component process for the web component looks
like the following figure: