Difference between revisions of "TestFileAttachment"
(→Defining System, Channel and Operations) |
|||
Line 59: | Line 59: | ||
|} | |} | ||
− | [[File:GVExamplesTestFileAttachmentFlow.jpg|thumb|TestFileAttachment flow]] | + | ===Flow implementation=== |
+ | |||
+ | [[File:GVExamplesTestFileAttachmentFlow.jpg|thumb|TestFileAttachment flow]]To implement the TestFileAttachment service [[Flow]] design it as shown in the picture: | ||
+ | |||
+ | |||
+ | The service searchs the files present in a directory, sends it as attachment and moves it into another directory | ||
+ | |||
+ | |||
+ | The following table shows the nodes and attributes to be defined for each Flow node: | ||
+ | |||
+ | {|class="gvtable" | ||
+ | ! Attribute/Subelement !! Value | ||
+ | |- | ||
+ | | first-node || Prepare | ||
+ | |- | ||
+ | | Conditions/GVBufferCondition || condition="FilesFound" type="condition" | ||
+ | Property: | ||
+ | : name="GVFM_FOUND_FILES_NUM" | ||
+ | : operator="greater" | ||
+ | : type="gvbuffer-field" | ||
+ | : value="0" | ||
+ | : value-type="integer" | ||
+ | |- | ||
+ | | GVOperationNode || dump-in-out="false" <br/>id="list_files" <br/>id-system="GVESB" input="input" <br/>next-node-id="check_files" <br/>op-type="call" <br/>operation-name="ScanAttachments" <br/>output="files" | ||
+ | |- | ||
+ | | GVNodeCheck || default-id="end-nofiles" <br/>id="check_files" <br/> input="files" <br/>on-exception-id="end"<br/>GVRouting: | ||
+ | : condition="FilesFound" | ||
+ | : next-node-id="prepare" | ||
+ | |- | ||
+ | | ChangeGVBufferNode || dump-in-out="true" <br/>id="prepare" <br/>input="files" <br/> next-node-id="send_email" <br/> output="files" | ||
+ | ChangeGVBuffer: clear-data="false" | ||
+ | : OGNLScript: property['GV_SMTP_ATTACHMENTS'] = property['GVFM_FOUND_FILES_LIST']' | ||
+ | |- | ||
+ | | GVOperationNode || dump-in-out="false" <br/>id="send_email" <br/>id-system="GVESB" <br/>input="files" <br/>next-node-id="move_files" <br/> operation-name="SendEmail" <br/>output="files" | ||
+ | |- | ||
+ | | GVOperationNode || dump-in-out="false" <br/> id="move_files" <br/>id-system="GVESB" <br/>input="files" <br/>next-node-id="end" <br/>operation-name="MoveAttachments" <br/>output="files" | ||
+ | |- | ||
+ | | GVEndNode || end-business-process="yes" <br/>id="end-nofiles" <br/>output="files" | ||
+ | |- | ||
+ | | GVEndNode || end-business-process="yes" <br/>id="end" <br/> output="files" | ||
+ | |} |
Revision as of 16:52, 15 February 2012
Contents
Description
This example shows how use GreenVulcano® ESB to send an email containing attachments.
TestFileAttachment services executes the following operations:
- Reads a file from a directory of input (in this case TestAttach/input)
- Sends an email with this file as attachment
- Moves sent file to another directory (we choose TestAttach/sent)
VulCon Configuration
To configure TestFileAttachment service follow these steps:
- Define the System, Channel and Operations required
- Define the Services
- Implement the flows.
Defining System, Channel and Operations
To define a System, go to VulCon core view and, into Systems element, insert the System GVESB if it is not already present. Inside of it create the Channel TEST_CHANNEL_FILE in which the following operations will be configured:
Attribute/Subelement | Value |
---|---|
name | ScanAttachments
FileCommands:
|
Attribute/Subelement | Value |
---|---|
name | MoveAttachments
FileCommands:
|
Attribute | Value |
---|---|
jndi-name | gvesb.mailServer |
name | SendEmail |
mail-message | content-type="text-html" high-priority="true" sender-display-name="GV ESB" subject="Test send attachments"
|
Flow implementation
To implement the TestFileAttachment service Flow design it as shown in the picture:
The service searchs the files present in a directory, sends it as attachment and moves it into another directory
The following table shows the nodes and attributes to be defined for each Flow node:
Attribute/Subelement | Value |
---|---|
first-node | Prepare |
Conditions/GVBufferCondition | condition="FilesFound" type="condition"
Property:
|
GVOperationNode | dump-in-out="false" id="list_files" id-system="GVESB" input="input" next-node-id="check_files" op-type="call" operation-name="ScanAttachments" output="files" |
GVNodeCheck | default-id="end-nofiles" id="check_files" input="files" on-exception-id="end" GVRouting:
|
ChangeGVBufferNode | dump-in-out="true" id="prepare" input="files" next-node-id="send_email" output="files" ChangeGVBuffer: clear-data="false"
|
GVOperationNode | dump-in-out="false" id="send_email" id-system="GVESB" input="files" next-node-id="move_files" operation-name="SendEmail" output="files" |
GVOperationNode | dump-in-out="false" id="move_files" id-system="GVESB" input="files" next-node-id="end" operation-name="MoveAttachments" output="files" |
GVEndNode | end-business-process="yes" id="end-nofiles" output="files" |
GVEndNode | end-business-process="yes" id="end" output="files" |