Using FileIOInteractionSpec Class For Moving File using File Adapter
Hi All,
I am tring to use FileIOInteractionSpec class to move a file from one location to another. The problem is that I am not able to override its properties from BPEL, here is how the FileAdapter.jca file looks like which moves the file from one location to another:
<adapter-config name="MoveFileService" adapter="File Adapter" wsdlLocation="MoveFileService.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
<connection-factory location="eis/FileAdapter"/>
<endpoint-interaction portType="MoveFile_ptt" operation="MoveFile">
<interaction-spec className="oracle.tip.adapter.file.outbound.FileReadInteractionSpec">
<property name="DeleteFile" value="true"/>
<property name="PhysicalDirectory" value="C:\FileRead"/>
<property name="FileName" value="dummy.txt"/>
</interaction-spec>
</endpoint-interaction>
*<endpoint-interaction portType="MoveFile_ptt" operation="Move">*
*<interaction-spec className="oracle.tip.adapter.file.outbound.FileIoInteractionSpec">*
*<property name="Type" value="MOVE"/>*
*<property name="SourcePhysicalDirectory" value="C:\FileRead"/>*
*<property name="SourceFileName" value="dummy.txt"/>*
*<property name="TargetPhysicalDirectory" value="C:\FileRead2"/>*
*<property name="TargetFileName" value="dummyCopy.txt"/>*
*</interaction-spec>*
*</endpoint-interaction>*
</adapter-config>
In the above code, I have hard-coded the values, and it works fine like that.
However, when I try to override these values by defining properies in BPEL invoke's tag, the values are getting passed as null.
Here is the invoke tag code, tried the following 2 combinations:
<invoke name="InvokeFileMove"
inputVariable="InvokeFileMove_MoveFile_InputVariable"
partnerLink="MoveFileService" portType="ns1:MoveFile_ptt"
operation="Move" bpelx:invokeAsDetail="no">
<bpelx:inputProperty name="jca.file.SourcePhysicalDirectory" value="C:\FileRead"/>
<bpelx:inputProperty name="jca.file.SourceFileName" value="dummy.txt"/>
<bpelx:inputProperty name="jca.file.TargetPhysicalDirectory" value="C:\FileRead2"/>
<bpelx:inputProperty name="jca.file.TargetFileName" value="dummyCopy.txt"/>
</invoke>
And
<invoke name="InvokeFileMove"
inputVariable="InvokeFileMove_MoveFile_InputVariable"
partnerLink="MoveFileService" portType="ns1:MoveFile_ptt"
operation="Move" bpelx:invokeAsDetail="no">
<bpelx:inputProperty name="SourcePhysicalDirectory" value="C:\FileRead"/>
<bpelx:inputProperty name="SourceFileName" value="dummy.txt"/>
<bpelx:inputProperty name="TargetPhysicalDirectory" value="C:\FileRead2"/>
<bpelx:inputProperty name="TargetFileName" value="dummyCopy.txt"/>
</invoke>
These four properties are not visible in Invoke -> Properties tab as well.
Could you please suggest how can I override the jca's values for FileIOInteractionSpec class?
I have successfully used this API and it works fine.
Try to use variables which contains values like "dummyCopy.txt" etc.
Here is what I used :
<bpelx:inputProperty name="jca.file.SourceDirectory"
variable="inputDirectory"/>
<bpelx:inputProperty name="jca.file.SourceFileName"
variable="inputFileName"/>
<bpelx:inputProperty name="jca.file.TargetDirectory"
variable="destinationDirectory"/>
<bpelx:inputProperty name="jca.file.TargetFileName"
variable="inputFileName"/>
Pass approppriate values into the above given variables and try.
Hopefully it should work.
Let us know, how it goes !
<Puneet/>
Similar Messages
-
Need script for moving files to specific directories base on csv
Hi,
I have a question. I have about 2000 files (pdf), which I need move to specific directories and subdirectories, which are based on csv file.
Csv is looking like this:
filename;directoryname;subdirectoryname;subdirectoryname;.......etc.
I have a script for creating directories with subdirectories from csv file, but I need this script for moving files to this directories.....
Thanks a lot for every help.
Best Regards
Petr, OS X Mavericksprivate function snapshotLastFrame():void
gotoAndStop( this.totalFrames );
_bitmapData = new BitmapData( stage.stageWidth, stage.stageHeight );
_bitmap = new Bitmap( _bitmapData );
_bitmapData.draw ( stage );
saveImageJPG( _bitmapData, "test.jpg", 96 );
public function saveImageJPG( bitmapData:BitmapData, fileName:String, quality:int ):void {
this.jpgEncoder = new JPGEncoder( quality );
this.fileReference = new FileReference();
this.fileReference.save( this.jpgEncoder.encode( bitmapData ), fileName + ".jpg" );
Keep in mind that you need a few extra libraries to be able to create a jpeg.. (AS3CoreLib) can be found at googleCode. -
Dynamic File Name for Receiver File Adapter
Hi All,
How can we use dynamic name for Receiver file adapter?
Can anyone help.
Thanks in Advance
ChemmanzHi Chemmanz,
The dynamic filename generation concept is as follows.
In your filename field. just give a variable with % symbols. (eg: %file% ).
Now, under the option Variable Name Substitution, you can give how the value has to be created.
It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
For the former, your give
message:interface_name ,etc
and for the payload part you give,
Payload: "your element root which u wanna acecss"
Just check this link out,
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
And read the contents under variable substitution and it will help you understand the concepts better.
If you have any clarifications, do get back,
Regards,
Bhavesh -
Required Changes in FCC Paramenters for Sender File Adapter.
Hi
I am Doing File-File Scenario.I am using FCC in the Sender File Adapter. I have defined the structure as below.
My Source Structure
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_Source xmlns:ns0="http://city.net/filecopy">
<Message>
<Id>123</Id>
<Head>
<Id>123</Id>
<Filename>test.xml</Filename>
</Head>
<Body>Helloworld</Body>
</Message>
</ns0:MT_Source_FILE>
So for the above structure, I have defined the FCC Parameters as
Document Name: MT_Source (Message Type)
Document Namespace:http://city.net/filecopy(Namespace)
Recordset Name: Message (root node)
Recordset Structure: Message,1,Head,1
Recordset Sequence: Ascending
Recordsets per message:1
Keyfield Type: string
In the Table Rows I have defined
Message.fieldFixedLengths: 3,10
Message.fieldNames: Id, Body
Message.fieldSeparator: ,
Message.endSeparator: 'nl'
Head.fieldFixedLengths: 3,8
Head.fieldSeparator: ,
Head.endSeparator: 'nl'
Head.fieldNames: Id, Filename.
My Input Text file
123,Helloworld
123,text.xml
I am Getting Output as
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MT_Source xmlns:ns="http://city.net/filecopy">
- <Message>
- <Message>
<Id>123</Id>
<Body>HelloWorld</Body>
</Message>
- <Head>
<Id>123</Id>
<Filename>test.xml</Filename>
</Head>
</Message>
</ns:MT_Source>
I should get Body field after Head Structure as in the Source Structure, So Please what changes do I need to do in the Parameters Specified above to get the desired Output.
So How should I define the FCC Paramenters For Sender File Adapter ?
Any Help Would be Appreciated.
Regards,
VarunHi Everyone,
I could Succeed to some extent.
I have defined the parameters as follows
Recordset Structure: Message,*,Head,1
Key Field Name: KZ
Key Field Type: integer
In the table, I defined the Parameters as
Message.fieldFixedLengths:1,3
Message.fieldNames:KZ,Id
Message.keyFieldValue:1
Message.keyFieldInStructure:ignore
Message.fieldSeparator:,
Message.endSeparator:'nl'
Head.fieldFixedLengths:1,3,8
Head.fieldNames:KZ,Id,filename
Head.keyFieldValue:2
Head.keyFieldInStructure:ignore
Head.fieldSeparator:,
Head.endSeparator:'nl'
Message.fieldFixedLengths:1,11
Message.fieldNames:KZ,Body
Message.keyFieldValue:3
Message.keyFieldInStructure:ignore
Message.fieldSeparator:,
Message.endSeparator:'nl'
My source text file
1,123
2,123,test.xml
3,Hello World
my output is
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MT_Source xmlns:ns="http://city.net/FileCopy">
- <Message>
- <Message>
<Id>123</Id>
</Message>
- <Head>
<Id>123</Id>
<Filename>test.xml</Filename>
</Head>
</Message>
</ns:MT_Source>
I got the output almost correct except I am not getting the value in the Body
Any help would be appreciated.
Please correct me If I am wrong.
Regards,
Varun
Edited by: Varun on Sep 2, 2008 12:06 PM
Edited by: Varun on Sep 2, 2008 12:15 PM -
FCC Paramenters for Sender File Adapter
hi
I am using FCC in the Sender File Adapter. I have defined the structure as below. Fields ID, Filename, Values will be generated at Runtime as I have defined Used Defined Funtions for Both.
Only I will Pass the value in Body. i.e "Hello".
So How should I define the FCC Paramenters For Sender File Adapter ?
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_Source_FILE xmlns:ns0="http://city.net/FILEtoHTTP">
<Message>
<Id>123456</Id>
<Head>
<Id>123456</Id>
<Filename>sample.xml</Filename>
</Head>
<Body>hello</Body>
</Message>
</ns0:MT_Source_FILE>
In the source text file, Do I need to send only "Hello" value because ID and filename will be generated at runtime?
Regards,
Varun
Edited by: Varun on Sep 1, 2008 6:00 PMHi,
Refer this link:
http://help.sap.com/saphelp_NW04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
Regards,
Nithiyanandam -
Ejb-jar.xml for a file adapter in 710
Hi,
we moved our file adapter from 700 to 710. Now there is a problem in ejb-jar.xml. There are entries like this:
<session>
<description></description>
<display-name></display-name>
<icon/>
<ejb-name>FileActConversionToSWIFTModuleBean</ejb-name>
<home>com.sap.aii.af.lib.mp.module.ModuleHome</home>
<remote>com.sap.aii.af.lib.mp.module.ModuleRemote</remote>
<local-home>com.sap.aii.af.lib.mp.module.ModuleLocalHome</local-home>
<local>com.sap.aii.af.lib.mp.module.ModuleLocal</local>
<ejb-class>com.sapcons.xi.swift.FileActConversionToSWIFTModuleBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
The error messages are like this:
Bean Interfaces: stateless bean "FileActConversionToSWIFTModuleBean" should have at least one of the following interface pairs: "local" and "local-home", "home" and "remote" or service endpoint interface
Bean Interfaces: The home interface "com.sap.aii.af.lib.mp.module.ModuleHome" cannot be found in the search path.
What is wrong? The interfaces ModuleHome etc. seem not to be here any more. Which interfaces should be entered in ejb-jar.xml for release 710?
Thanks and regards, MarinaHi,
yes, there is a module for file adapter. Some modifications were implemented, too. I can imagine that something was forgotten. It is possible to do the build, to deploy and to test the adapter, even if there are errors in ejb-jar.xml .
Is there a list which things that changed between 700 and 710?
I have these 2 links with useful information:
[Developing Adapters and Modules|http://help.sap.com/saphelp_nwpi71/helpdata/en/8b/895e407aa4c44ce10000000a1550b0/content.htm ]
[Javadoc PI 7.1 (Adapter, Module and Mapping Development)|http://help.sap.com/javadocs/pi/SP3/xpi/index.html]
Is there further information for this topic?
Thanks and regards, Marina -
Variable Substitution settings for Receiver File Adapter
Hi All,
I wanna use variables for File Name Sheme in the File Access Parameters.I had used by enclosing the variable names within %. When i wanna substitute values for those variables, it is given in the documentation(help.sap.com) that v need to set the Enable indicator. only after setting the indiactor, v can use the variables and can then enter the values for those variables in a table. but i can't see either the indicator or the table in my editor. how can i provide the values for the variables used in file name scheme/Target Directory. and for ur information,i'm using sp12.
any help wud b appreciated.
thnx
AnilHi Anil,
Please check out the following link ...
Re: Variable substitution - Pseudo Path Variable - file adapter
Re: Variable substitution problem
Regards,
Raj -
Dynamic Filename for Reciever File Adapter
Hi All,
Can anyone answer to some of my quesries which are as follows
a) . Currently Iu2019m working on an IDOC-to-File scenario in which I need to create zip file on file server by using a payload value. I
search sdn and found a bean that can be used to create zip file which is PayLoadZipBean. Iu2019m referring the below weblog for creating file name dynamically.
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
My question is can anyone explain or provide me the step by step procedure in detail for the prerequisite which are mention in the weblog, i.e.
u201CAssuming that the following have been done and configured.
1.A value table has been created in the ABAP stack of the WAS in which XI is running and the entries as the file types, which will be written into the files are maintained.
2.Create a number range object in SNRO transaction in the same ABAP stack which will be having the sub objects as the file types maintained in the value table with their number ranges maintained. u201C
b) .Can we use all mapping techniques (ABAP, Java, XSLT and Graphical) in a single scenario if yes then how to trigger them and which one executes much faster?
c) .Can we trigger an RFC asynchronously and how?
Your help is highly appreciated and
Regards
Faisal
Edited by: Abdul Faisal on Nov 19, 2009 8:53 AMa) . Currently Iu2019m working on an IDOC-to-File scenario in which I need to create zip file on file server by using a payload value. I
search sdn and found a bean that can be used to create zip file which is PayLoadZipBean. Iu2019m referring the below weblog for creating file name dynamically.
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
My question is can anyone explain or provide me the step by step procedure in detail for the prerequisite which are mention in the weblog, i.e.
Hi Use dynamic configuration UDF to create file name dynamically.its very easy search in sdn you will find the code,even you can create file directory name dynamically.
In receiver file communication channel if you use PayLoadZipBean it will do Zipping of your message,for this you need to add this bean name additional parameters section in Receiver Channel.
If you want to create zip file based on pay load value check the condition at mapping level based on that call the service,if you not required zip file in other case for that you need to create one more file receiver communication channel.
u201CAssuming that the following have been done and configured.
1.A value table has been created in the ABAP stack of the WAS in which XI is running and the entries as the file types, which will be written into the files are maintained.
not claer,can you explain bit more
2.Create a number range object in SNRO transaction in the same ABAP stack which will be having the sub objects as the file types maintained in the value table with their number ranges maintained. u201C
b) .Can we use all mapping techniques (ABAP, Java, XSLT and Graphical) in a single scenario if yes then how to trigger them and which one executes much faster?
We can use all mappings single scenario,how mean just add the mapping names in Operation/Interface mapping.
As per my understanding Message Mapping works faster then JAVA then XSLT then ABAP,but it depends on how many lined of code you written.
c) .Can we trigger an RFC asynchronously and how?
Yes we can use RFC Asynchronous,search in sdn you will find it,if unable to find let me know.
Regards,
Raj -
Adapter Module for Sender File Adapter to access a Flat file
Hi,
We have a scenario where the source is a flat file.I want to develop an Adapter Module to make a small change to every line in the Flat file.
Now how do we read a flat file in the Adapter Module?Coz the flat file will be converted to XML file by the Standard Adapter Module of the File adapter.
Please help me out with this.
Thank you,
Anu.Hi Anu,
If you are not using Content Conversion option Standard Adapter Module does not convert the Flat file to XML .
You can directly access the payload as it is in flat file in the Adapter Module and make changes.
Use the Standard classes ModuleData & moduleContext to fetch the Payload.
chk this :
Customized Sender Adapter Module
XI: Read data from PDF file in Sender Adapter
regards
Ganga -
Poll interval for sender file adapter.
I have a 1_sender file NFS file adapter which picks a trigger file from X location in PI application server, this trigger file initiates the unix script present in the sender file adapter.
Unix script brings all the file which starts with 25588* from bank FTP and places in Y location in PI application server then script deletes the "trigger file".
another NFS File adapter 1_receiver file adapter places the trigger file in the X location of PI.
for 1_sender file poll interval given as 86400, that means it should trigger only once a day @ 1:30pm.
But today same sender file adapter had triggered 4 times, could any one let me know the reason why it had triggered 4 times instead of single time.Vidya,
There are two things :-
1. The polling interval should be 24 hrs;
2. The polling interval should be 24 hrs and it should poll at 1:30 pm every day.
For any reason if the channel is re-started, then with your present configuration, you will never be able to achieve # 2.
So, better use ATP.
But today same sender file adapter had triggered 4 times, could any one let me know the reason why it had triggered 4 times instead of single time.
Might be the connection dropped / failed at the time of polling and the channel re-tried. If you give more details (what time and with how much interval it triggered), someone might be able to help.
Regards,
Neetesh -
OS Command for receiver file adapter
Hi Guys,
I have a requirement that in the target folder before putting the file, I have to rename the exisitng file then put the file. The target folder is in another machine and I have to use FTP option to send file.
is it possible to use OS command after processing option in the receiver file adapter to do this? please let me know how to handle this.
Thanks
MukeshMukesh,
You cannot rename the file in the FTP folder. What you can do is write a OS script where it logs in into the FTP site and renames the file. Then use this OS script before message processing so that it renames the file before you write the actual file.
If you want to rename a file which is on the applicaiton server using NFS then you can directly rename it from the command prompt.
Regards,
---Satish -
Attachments for receiver file adapter
Hello gurus,
I think receiver file adapter does not support attachments. But I do have a scenario where I receive additional files as SOAP payloads accompanying the request message and I have to write them to a network directory. How can I achieve this?
Regards,
GökhanHi Gokhan,
Please have a look at the following links and see if it helps
Re: File adapter with attachment to mail
Re: How to use File Adapter to transport files
Best Regards -
Class for moving images (ImageView)
Hi! I'm trying to create a class for move an image (using ImageView class). For first, I create a simple testing class:
package javafxapplication2;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.scene.input.MouseEvent;
var image: ImageView;
var timeline = Timeline {
def im = image;
keyFrames: [
KeyFrame {
time: 0s,
values: [
im.x => 20.0,
im.y => 20.0
KeyFrame {
time: 1s,
values: [
im.x => 150.0,
im.y => 150.0
Stage {
title: "Test"
scene: Scene {
width: 550, height: 350
content: [
image = ImageView {
x: 20.0, y: 20.0
image: Image {
url: "http://www.google.it/logos/2010/joseffrank-hp.gif";
onMousePressed: function(e: MouseEvent) {
timeline.play();
}But it does not works! And I can't use the "bind" variables, because in an extern class like this:
package javafxapplication2;
import javafx.animation.Timeline;
import javafx.animation.KeyFrame;
var element: Element;
var fromBoxX : Number;
var fromBoxY: Number;
var toBoxX: Number;
var toBoxY: Number;
var timeline = Timeline {
def e = element;
keyFrames: [
KeyFrame {
time: 0s,
values: [
e.x => fromBoxX,
e.y => fromBoxY
KeyFrame {
time: 1s,
values: [
e.x => toBoxX,
e.y => toBoxY
public function move (el: Element, fBox: Box, tBox: Box): Void {
element = el;
fromBoxX = el.matrix.getMatrixIndexes(fBox.location).getY() * el.board.squareSize;
fromBoxY = el.matrix.getMatrixIndexes(fBox.location).getX() * el.board.squareSize;
toBoxX = el.matrix.getMatrixIndexes(tBox.location).getY() * el.board.squareSize;
toBoxY = el.matrix.getMatrixIndexes(tBox.location).getX() * el.board.squareSize;
timeline.playFromStart();
public class Elements {}I can't use it!
Is here anybody that can help me? (Sorry for my bad english)It is because the image variable is null when the timiline is createed.
Try this:
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.scene.input.MouseEvent;
var image: ImageView;
Stage {
title: "Test"
scene: Scene {
width: 550, height: 350
content: [
image = ImageView {
x: 20.0, y: 20.0
image: Image {
url: "http://www.google.it/logos/2010/joseffrank-hp.gif";
onMousePressed: function(e: MouseEvent) {
timeline.play();
var timeline = Timeline {
def im = image;
keyFrames: [
KeyFrame {
time: 0s,
values: [
im.x => 20.0,
im.y => 20.0
KeyFrame {
time: 1s,
values: [
im.x => 150.0,
im.y => 150.0
} -
Same setting for two file adapter but different output
Hi ,
I am having two receiver file adapter for two differrent scenario with same settings but different structure.
I want the output of the file for both the scenario should be displayed line by line but it is working fine for one scenario.File type,file encoding and FCC are same in both the interface except the fieldsnames in FCC.
When i check both the output file i found that the scenario which is working fine having OA OD hexadecimal value at the end of line of each line.and the second scenario which is giving the output in single line is having only OA.
waitng for Valueable inputs!!!
Thanks
SantoshHi Santosh,
Kindly elaborate your question.
it would be helpful if you post the content conversion parameters of the erroneous file channel.
Regards,
Varun -
Need URL for calling File adapter
Hi All,
I have posted this question earlier.but I cl'd not get the response. One more time I am checking my luck.
How can I call File adapter ( may be sender or receiver but it should be file) through URL?
ThanksHi,
this is not possible in standard - write your own adapter for it
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
Maybe you are looking for
-
Export and Import of Portal Database - Help Required
Hi, We have a NW04 production portal running on AIX clustered environment (HACMP). We are building another landscape for which i need to export the current portal and import onto new portal which is already clustered (HACMP). Can someone point docu
-
Syntax error in scan+syslog.dat(1)
Hi, I have repeated errors being logged by one of the SunMC agents on a Solaris 10 system. We are running Agent V4: Nov 17 12:38:19 myserver agent[21172]: syslog Nov 17 12:38:19 agent syntax error in fscan+syslog.dat(1) at token '0' Can someone pleas
-
I have a English firefox 6 but i am getting all chinese apps on App Centre?
Firefox 6 English but chinese language on tab page and app centre.
-
PSE6: moved catalog to new drive - inconsistent with original - need help
I have a puzzling occurence since backing up my Photoshop Elements 6 catalog a week or so ago. I wanted to move my catalog/photos on my laptop from the C drive (to get it to mostly software/programs) to the D drive (mostly data and documents) because
-
I can not update Elements 11 camera raw 8, , I said that already updated
I see that Photoshop is updated camera raw (to 8), but is camera raw 7.4 elements 11. I bought a new camera and I do not recognize the raw, however comes in the list of camera raw 8. Do I have a problem in my program to update?