{"id":11455,"date":"2016-06-06T14:02:18","date_gmt":"2016-06-06T19:02:18","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=11455"},"modified":"2016-06-06T14:02:18","modified_gmt":"2016-06-06T19:02:18","slug":"oracle-soa-ftp-adapter-get-file-name","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=11455","title":{"rendered":"Oracle SOA FTP Adapter: Get File Name"},"content":{"rendered":"<div class='toc wptoc'>\n<h2>Contents<\/h2>\n<ol class='toc-odd level-1'>\n\t<li>\n\t\t<a href=\"#Create_a_Test_Project\">Create a Test Project<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#Create_a_BPEL_Variable_to_Hold_File_Name\">Create a BPEL Variable to Hold File Name<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#Collect_File_Name\">Collect File Name<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#Test_File_Name\">Test File Name<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#Create_a_BPEL_Variable_to_Hold_File_Name_1\">Create a BPEL Variable to Hold File Name<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#Collect_File_Name_1\">Collect File Name<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#Retrieve_File_Name_from_Java_Callout\">Retrieve File Name from Java Callout<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#Pass_File_Name_into_Another_FTP_Adapter\">Pass File Name into Another FTP Adapter<\/a>\n\t<\/li>\n<\/ol>\n<\/ol>\n<\/div>\n<div class='wptoc-end'>&nbsp;<\/div>\n<span id=\"Create_a_Test_Project\"><h2>Create a Test Project<\/h2><\/span>\n<span id=\"\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_proj_1.jpg\" rel=\"attachment wp-att-11465\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_proj_1.jpg\" alt=\"testsoaftpadapter_proj_1\" width=\"919\" height=\"401\" class=\"aligncenter size-full wp-image-11465\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_proj_1.jpg 919w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_proj_1-300x131.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_proj_1-768x335.jpg 768w\" sizes=\"auto, (max-width: 919px) 100vw, 919px\" \/><\/a><\/h6><\/span>\n<p>* Add a new SOA Project to your solution:<br \/>\n&#8211; project name: <strong>TestFTP<\/strong><br \/>\n&#8211; <em>Empty BPEL<\/em><br \/>\n* In <em>composite.xml <\/em>file, add a new <em>FTP Adapter<\/em> to the exposed service lane.<\/p>\n<pre lang=\"xml\">\r\n<adapter-config name=\"GetFile\" adapter=\"FTP Adapter\" wsdlLocation=\"GetFile.wsdl\" \r\n    xmlns=\"http:\/\/platform.integration.oracle\/blocks\/adapter\/fw\/metadata\">\r\n  \r\n  <connection-factory location=\"eis\/ftp\/ALIS\" UIincludeWildcard=\"*.zip\"\/>\r\n  <endpoint-activation portType=\"Get_ptt\" operation=\"Get\">\r\n    <activation-spec className=\"oracle.tip.adapter.ftp.inbound.FTPActivationSpec\">\r\n      <property name=\"DeleteFile\" value=\"true\"\/>\r\n      <property name=\"MinimumAge\" value=\"0\"\/>\r\n      <property name=\"PhysicalDirectory\" value=\"\/out\/AuditData\"\/>\r\n      <property name=\"Recursive\" value=\"false\"\/>\r\n      <property name=\"PollingFrequency\" value=\"60\"\/>\r\n      <property name=\"FileType\" value=\"ascii\"\/>\r\n      <property name=\"IncludeFiles\" value=\".*\\.zip\"\/>\r\n      <property name=\"UseHeaders\" value=\"false\"\/>\r\n    <\/activation-spec>\r\n  <\/endpoint-activation>\r\n<\/adapter-config>\r\n<\/pre>\n<p>* In <em>composite.xml<\/em>, add a new <em>BPELProcess<\/em>:<br \/>\n&#8211; Name: <strong>BPELGetFile<\/strong><br \/>\n&#8211; Template: <em>Define service later<\/em><\/p>\n<span id=\"Create_a_BPEL_Variable_to_Hold_File_Name\"><h2>Create a BPEL Variable to Hold File Name<\/h2><\/span>\n<p>* Open <em>BPELGetFile<\/em><br \/>\n* In <em>BPELGetFile<\/em>, add a new property to hold file name:<br \/>\n&#8211; Name: <strong>GetFileName<\/strong><br \/>\n&#8211; Type: <em>xsd:string<\/em><\/p>\n<span id=\"_1\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_GetFileNameProp_1.jpg\" rel=\"attachment wp-att-11459\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_GetFileNameProp_1.jpg\" alt=\"testsoaftpadapter_GetFileNameProp_1\" width=\"505\" height=\"319\" class=\"aligncenter size-full wp-image-11459\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_GetFileNameProp_1.jpg 505w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_GetFileNameProp_1-300x190.jpg 300w\" sizes=\"auto, (max-width: 505px) 100vw, 505px\" \/><\/a><\/h6><\/span>\n<span id=\"Collect_File_Name\"><h2>Collect File Name<\/h2><\/span>\n<p>* In <em>BPELGetFile<\/em>, add a new <em>Receive <\/em>activity.<br \/>\n* Double click Receive activity. Wire it to GetFile FTP adapter:<\/p>\n<span id=\"_2\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_receiveActivity_1.jpg\" rel=\"attachment wp-att-11460\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_receiveActivity_1.jpg\" alt=\"testsoaftpadapter_receiveActivity_1\" width=\"437\" height=\"467\" class=\"aligncenter size-full wp-image-11460\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_receiveActivity_1.jpg 437w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_receiveActivity_1-281x300.jpg 281w\" sizes=\"auto, (max-width: 437px) 100vw, 437px\" \/><\/a><\/h6><\/span>\n<p>* In <em>Properties <\/em>tab, set <em>jca.ftp.FileName<\/em> property to the newly created <em>GetFileName<\/em> variable:<\/p>\n<span id=\"_3\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_GetFileNameProp_2.jpg\" rel=\"attachment wp-att-11461\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_GetFileNameProp_2.jpg\" alt=\"testsoaftpadapter_GetFileNameProp_2\" width=\"439\" height=\"362\" class=\"aligncenter size-full wp-image-11461\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_GetFileNameProp_2.jpg 439w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_GetFileNameProp_2-300x247.jpg 300w\" sizes=\"auto, (max-width: 439px) 100vw, 439px\" \/><\/a><\/h6><\/span>\n<p>* <em>GetFileName <\/em>variable now contains the file name received by FTP adapter.<\/p>\n<span id=\"Test_File_Name\"><h2>Test File Name<\/h2><\/span>\n<p>* In <em>BPELGetFile <\/em>designer, add a new <em>Email <\/em>Activity<br \/>\n* Email <em>GetFileName <\/em>property value to test email account:<\/p>\n<span id=\"_4\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_EmailGetFileNameVar_1.jpg\" rel=\"attachment wp-att-11462\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_EmailGetFileNameVar_1.jpg\" alt=\"testsoaftpadapter_EmailGetFileNameVar_1\" width=\"410\" height=\"382\" class=\"aligncenter size-full wp-image-11462\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_EmailGetFileNameVar_1.jpg 410w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_EmailGetFileNameVar_1-300x280.jpg 300w\" sizes=\"auto, (max-width: 410px) 100vw, 410px\" \/><\/a><\/h6><\/span>\n<span id=\"_5\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_EmailGetFileNameVar_2.jpg\" rel=\"attachment wp-att-11463\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_EmailGetFileNameVar_2.jpg\" alt=\"testsoaftpadapter_EmailGetFileNameVar_2\" width=\"744\" height=\"582\" class=\"aligncenter size-full wp-image-11463\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_EmailGetFileNameVar_2.jpg 744w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2016\/04\/testsoaftpadapter_EmailGetFileNameVar_2-300x235.jpg 300w\" sizes=\"auto, (max-width: 744px) 100vw, 744px\" \/><\/a><\/h6><\/span>\n<span id=\"Create_a_BPEL_Variable_to_Hold_File_Name_1\"><h2>Create a BPEL Variable to Hold File Name<\/h2><\/span>\n<p>* Open BPEL process<br \/>\n* Create a new variable, e.g. <em>AuditFileName<\/em>, of <em>xsd:string<\/em> type<\/p>\n<span id=\"_6\"><h6><\/h6><\/span>\n<span id=\"Collect_File_Name_1\"><h2>Collect File Name<\/h2><\/span>\n<p>* Open BPEL process<br \/>\n* Double click <em>Receive Activity<\/em> to open <em>Edit Receive<\/em> window<br \/>\n* Open Properties tab<br \/>\n* Set <em>jca.ftp.FileName<\/em> property value to the newly crated variable, e.g. <em>AuditFileName<\/em><\/p>\n<span id=\"_7\"><h6><\/h6><\/span>\n<span id=\"Retrieve_File_Name_from_Java_Callout\"><h2>Retrieve File Name from Java Callout<\/h2><\/span>\n<pre lang=\"java\">\r\n    oracle.xml.parser.v2.XMLElement element = \r\n        (oracle.xml.parser.v2.XMLElement)getVariableData(\"AuditFileName\");    \r\n    String filename = element.getTextContent();     \r\n<\/pre>\n<span id=\"Pass_File_Name_into_Another_FTP_Adapter\"><h2>Pass File Name into Another FTP Adapter<\/h2><\/span>\n<p>* Open BPEL process<br \/>\n* Double click <em>Invoke Activity<\/em> to open <em>Edit Invoke<\/em> window<br \/>\n* Open Properties tab<br \/>\n* Set <em>jca.ftp.FileName<\/em> property value to the file name variable, e.g. <em>AuditFileName<\/em><br \/>\n* Also set type to <em>output<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create a Test Project * Add a new SOA Project to your solution: &#8211; project name: TestFTP &#8211; Empty BPEL * In composite.xml file, add a new FTP Adapter to the exposed service lane. * In composite.xml, add a new &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=11455\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[22],"tags":[453,593],"class_list":["post-11455","post","type-post","status-publish","format-standard","hentry","category-soa","tag-ftpadapter","tag-soa11g"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-2YL","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/11455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11455"}],"version-history":[{"count":4,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/11455\/revisions"}],"predecessor-version":[{"id":11492,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/11455\/revisions\/11492"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}