File Channel sequential processing based on file names

Hi,
I have a requirement in a sender file channel.
There are mulitple files with different file names, I want these files to be processed in sequence based on the file name.
For example.
The files lets say are A3_1, A2, A1,A3_2.
I want to process A1 then A2 and then A3.
Please suggest methods to implement the same, I think an adapter module should help, please throw some light on the same.
Regards,
Varun.

Varun,
In that case I think you need to consider BPM. The file adapter does not support 'advanced' techniques for the sequence in which it polls files.
The process would then be:
- Use the adapter specific identiers for the file adapter to include the file name (/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions)
- Create a message mapping that puts the file name from the dynamic configuration into a field in the message type
- Create an integration process that receives the files from this adapter inside a loop step (/people/daniel.graversen/blog/2006/09/07/using-a-bpm-to-collect-messages-for-a-set-interval-of-time)
- You can now create an interface mapping that sorts the messages according to their filename and then send the messages to the receiver one by one (EOIO?).
Kind regards,
Koen

Similar Messages

  • FCC file channel cannot process the empty file

    Hi,
    My requirement is like that a msg mapping getting two files from different sources and combining into one file and send to the receiver. There is a possibility that any one of the file can be empty.. now  problem is how to process the empty file in FCC file channel. When we trying to process the msg we are getting the error msg like "file end of exception". we already check the option empty file in file comm channel....under processing tab. But no use.Though we achieved through a module in sender channel. i want to know how to achieve this through simple content conversion by the FCC channel.
    In Content conversion. Record----> item,.. here what is mean ''? 0 to outbound or 1 to outbound?
    Regards
    Balaji

    Hi Balaji,
    here what is mean ''? 0 to outbound or 1 to outbound*
    means 0 to unbounded.
    Let me remind u ... the requirement cannot be achived in this way.. if file is empty.
    I hope u already checked the option..
    process empty files.
    I think u can handle this by, using a adapter module, in which..
    if file size(ASMA) is zero.. create a empty message and send it
    to the PI.
    Babu
    Edited by: hlbabu123 on Mar 9, 2010 2:36 PM

  • Custom Authentication Scheme - call SSO or Local Process based on User Name

    Hi,
    We are looking at building a new application that allows employee and public user access.
    For staff we want to use Single Sign On as we have for all our other ApEx applications.
    For public users (who will register to create an account) we want to use our own Custom Authentication Function.
    What I would like to do is to have an Authentication Function along the lines of:
    If username like '%@%'
    then call Custom Function
    else call SSO Funcion.
    How do I call the SSO Authentication Function progamatically?
    Thanks,
    Martin

    Probably I don't explain myself clearly....sorry for that!
    Anyway you are right, the role of the user can change after the user is initially provisioned.
    I'll try to summarize to be sure to have understood your answer and to explain my scenario more in details:
    1. After user identity creation, I'll assign the role "Project Manager". Before role assignment the user has not any role. So using a pre-populate adapter I can retrieve the assigned role and compose the right userid.
    2. After step 1, I need to assign another role to the user, the new role should be "External Reseller" for example. In this case the user has a role already. What I would is: basing on the role that I'm assigning (External Reseller), the pre-populate should compose the right userid. Obviously this second userid will be different from the first one and this means a new account will be created for the user. At the moment I don't care to deprovisioning the first userid.
    Is it possible with pre-populate adapter?
    Sorry again for my not very clear explanations.
    Daniele
    Edited by: 886636 on Jan 24, 2012 4:10 AM

  • How to pick the multiples based on file size

    Hi All,
    my sender file adapter needs to pick up 5 files based on file size.
    for example 1file size is 500kb,2nd file size 300kb,3rd file size 400kb, 4file size 100kb and 5file size 600kb.
    here my requirement is, my file adapter needs to pick in the below order like 5th file,1st file,3rd file 2nd file and 4th file.
    means based on file size, i need to pick up my file adapter.
    could you please ang inputs on this requirement.
    Thanks & Regards,
    AVR

    Hi AVR,
    for case 2:
    1. At specific time each day  "23:58:00" hours ,count the number of files in directory say "c:\apps\acm".
    2. sort the files on basis of their size.
    3. place the files one by one after definite  time interval (more than polling time of the sender communication channel).
    in target directory say "c:\apps\acm1" from where PI server  picks up the files for further processing. The file with smallest size is placed last.
    4. In this case you need to ensure all files are present in the directory "c:\apps\acm" before "23:58:00" hours.
    for case 2  java code
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    public class sortFilesOnSpecificTime {
    * @param args
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    try
    * In Unix/Linux OS, dir1="/usr/apps/test"  etc
    int pollingInterval=10,sleepTime=1*60;
    String dir1="c:\\apps\\acm";
    String dir2="c:\\apps\\acm1";
    File fread=new File(dir1);
    File fwrite=new File(dir2);
    if(fread.canRead()==false)
    System.out.println("error: "+dir1+" does not have read permission. Program Terminates.");
    return;
    if(fwrite.canWrite()==false)
    System.out.println("error: "+dir2+" does not have write permission. Program Terminates.");
    return;
    String fileNames[],fileNamesOut[];
    long fileSize[];
    int i,j;
    byte b[];
    int t=4;
    Calendar cal;
    int hour24,min,fileCopyHour=23,fileCopyMin=58;
    long waitSeconds=1,currentTime=0;
    while(t>0)
    cal = new GregorianCalendar();
    hour24 = cal.get(Calendar.HOUR_OF_DAY);     // 0..23
    min = cal.get(Calendar.MINUTE);             //0..59
    System.out.println("current time="+hour24+":"+min);
    /*loop unless time reaches a specific predetermined value
    * predetermined values are provided by values
    * fileCopyHour=8,fileCopyMin=30 i.e say 08:30 hours
    currentTime=(hour24*60+min)*60;
    waitSeconds=(fileCopyHour*60+fileCopyMin)*60 - currentTime;
    if(waitSeconds>0)
    * in case you wanna to make this thread sleep for
    * say sleepTime(10) minutes before it checks the files once again
    * because looping continuously causes wastage of CPU cycles.   
    Thread.sleep(waitSeconds*1000);
    //read list of files
    fileNames=fread.list();
    if(fileNames.length;=0)
    * time is up but there are no file
    * in dir1 to copy. Then this program
    * goes to sleep for some time and
    * checks only at 11:55 hours. That is
    * end of the day
    continue;
    fileSize=new long[fileNames.length];
    fileNamesOut=new String[fileNames.length];
    //read their sizes
    for(i=0;i<fileNames.length;++i)
    fileNamesOut<i>=fileNames<i>;
    fileNames<i>=dir1+System.getProperty("file.separator";)+fileNames<i>;
    fileSize<i>=new File(fileNames<i>).length();
    System.out.println(fileNames<i>+" size="+fileSize<i>);
    //sorting on basis of file size descending order
    long value;
    String temp;
    for(i=1;i<fileSize.length;++i)
    value=fileSize<i>;
    temp=fileNames<i>;
    for(j=i-1;j>=0 && fileSize[j]<value;--j)
    fileSize[j+1]=fileSize[j];
    fileNames[j+1]=fileNames[j];
    fileSize[j+1]=value;
    fileNames[j+1]=temp;
    //now copy files to dir2
    b=new byte[512];
    for(i=0;i<fileNames.length;++i)
    System.out.println(fileNames<i>+" size="+fileSize<i>);
    for(i=0;i<fileNames.length;++i)
    File f=new File(fileNames<i>);
    FileInputStream in=new FileInputStream(f);
    FileOutputStream out=new FileOutputStream(dir2+System.getProperty("file.separator";)+fileNamesOut<i>);
    int len=0;
    while(2>1)
    if((len=in.read(b))<0)
    break;
    out.write(b,0,len);
    in.close();
    //delete files after copying from dir1
    f.delete();
    out.close();
    //put each file after polling interval is over
    Thread.sleep(pollingInterval*1000);
    catch(Exception e)
    e.printStackTrace();
    The code runs in infinite loop. You need to run them in command line in DOS environment as you indicated that you OS is WIN XP.  I have a few print statements which I kept for debugging, you can safely remove them and run the codes. This code is independent of the Operating System you are using. Only change is required in values of "dir1","dir2", timings and file count, which I think you can take care easily.
    Hope this solves your problem.
    regards
    Anupam

  • Overwrite executable file when the process is running

    When a program is still running (a UNIX server process), can I overwrite the executable file with a newer version?
    also, can i overwrite a shared library file that is being used by a currently running process?
    I don't think it is a good idea. But what happens?
    This is my first posting. Sorry if this is not the right place.

    Your question is about Unix. This forum is about C++ programming. You are more likely to get comprehensive answers in an OS forum. But I can tell you part of the answer.
    Remember that in Unix, a directory entry is separate from the file it refers to. One file can be referred to (linked to) by more than one directory entry. The file system keeps a count of how many directory entries refer to a file, and how many processes currently have the file open. When the directory count and the process count both go to zero, the space used by the file is reclaimed.
    The answer to your questions depend on exactly how you overwrite the files. A typical way to overwrite a file is to delete the orginal file and create a new file with the same name in the same directory. Most applications that seem to be changing the contents of a file actually delete the original and create a new file.
    Suppose you create a new version of /mydir/mylib.so, which is currently in use by process1. The directory entry /mydir/mylib.so now points to a different file, but process1 continues to use the old file, which currently has no name, and no directory entries pointing to it. If you start a new process that depends on /mydir/mylib.so, it will use the new library version. When process1 exits, the last reference to the original version disappears, and the disk blocks used by the original version will be reclaimed.
    If you used some other mechanism to update a file, such as a binary editor that changes disk blocks directly, you could create inconsistencies for processes that are using the file. Whether processes using the file see a change depends on whether they go back to refer to the file, or have finished reading it.

  • Problem in File Channel

    Hi,
    I have a scenario whice is split in two parts (to be precise two saperate scenarios execute).
    In the first one file is received from a SOAP channel as attachment, and through a receiver file channel it is sent to a local folder in XI.
    In the second Interface, a File channel picks that files and througha SOAP channel sends it to the third party.
    Now the issue is,
    In the first interface the size of the file received and size of the file sent to XI folder is same, means no truncation is there.
    But when the File is picked by the file channel in second interface, the file gets trucated and it only picks a part of the file.
    Other interfaces are dealing fine with any file size, but only this particular interface is truncating data.
    Any help on this will be appreciated,
    Thanks,
    Vikas

    Hi Vikas,
          I dont know why you designed interface like 2 flow,you can avoid one interface as per question
    SOAP---->SAP PI----->File
    File-->SAPPI---->Receiver.current flow,
    you can make it SAOP--->pi--->Receiver,but i dont know why you developed as two flows..coming to truncation problem i  dont think problem with communication channel,my advice to you check in Moni Outbound payload,if it is taking whole message then the problem with Maping,some where you done wrong.
    else
    first open the content of the file in wordpad and see,and check communication details.
    Regards,
    Raj

  • Receiver File channel for XML files: with carriage return

    Hi all,
    we are using a receiver FILE channel to generate an XML file that is sent to an external partner.
    The XML file looks good in a parser (IExplorer). But in fact there are not carriage return / line feeds between the XML tags
    of the XML payload in the file.
    Our partner now requires the XML file in a more vertical structure which means: for every tag a separate line (like it is displayed in a parser)
    Does anybody know a more general way to convert to a vertical XML structure (so with carriage return line feed).
    There is one entry in the SDN dealing with this topic but suggesting using an UDF. I think this is a very specific way.
    I don't think it is a good way to change/enhance the message mapping just because of a general formating change.
    Is it better to use an XSLT mapping as a second step in the interface mapping or a JAVA adapter module to convert ?
    any experiences? suggestions? examples?
    Thank you very much
    best regards
    Hans
    examples:
    original by XI receiver FILE adapter
    <?xml version="1.0" encoding="UTF-8"?>
    <MT_batchStatus><type>BS</type><header><message><messageSender>SENDER</messageSender><messageDate>20090723143720</messageDate> ... and so on
    required:
    <?xml version="1.0" encoding="UTF-8"?>
    <MT_batchStatus>
    <type>BS</type>
    <header>
    <message>
    <messageSender>SENDER</messageSender>
    <messageDate>20090723143720</messageDate>
    ... and so on

    >
    Hans Georg Walter wrote:
    > Is it better to use an XSLT mapping as a second step in the interface mapping or a JAVA adapter module to convert ?
    > any experiences? suggestions? examples?
    In such a case, the best is to write an generic XSLT or Java mapping that will attempt to do the pretty printing/formatting of the xml.
    The advantage of a generic one is that you can reuse the same class/jar for many other scenarios.
    so the flow will be as below in your interface mapping;
    1. your specific source to target mapping
    2. the generic formatting class

  • Appending multiple xml files to single xml file using File channel?

    Hi Experts,
    I would like to get some pointers around xml files append.
    My sender application will send around 1000 messages through SOAP per day. But the target application needs single xml file formed by consolidation of all these 1000 files.
    I tried with txt files and the receiver file channel could append the txt files. However, since xml files allow only one root node, I am not able to achieve the requirement.
    Is there any option we can do to get the result?
    The target file location is UNIX folder. Do we need to create any shell script to run from the channel for appending the file?
    Do we need to use any XSLT mapping to strip the xml declaration tags and append the files. Once the single file is ready, using another file channel with XSLT mapping, insert a dummy root node and xml declaration tags to build an xml file?
    Any thoughts to get the result will be much appreciated.
    Thanks
    Ray..

    Hi,
    You have two options
    1)Using Receiver Sender File channel select mode append it does the job.
    Option 2:
    Using BPM we cann collect all messages per day and club them as a one message, in this case create Target data type root node occurance 1 to unbounded. so it cal hold multiples SOAP messages in only XML messages.
    search in sdn for BPM collect pattrersn,its very simple .
    Option 3:
    Create scheell script in OS level and write a logic to append all files planced in FTP.
    Regards,
    Raj

  • How do I name output files based on files processed from a watched folder?

    Hello!
    I've built a small process to merge XML files with XDP templates, generating PDF files at the end of the process.
    Right now the process is generating all files with a fixed name + a random number, as defined in the Input panel (literal value with option "Appen a suffix..." checked.
    I'd like to change this so the resulting files have the same name as the input files, changing only the extension (PDF instead of XML).
    I believe I should change from literal value to XPath expression, in order to build the resulting name based on the input file name.
    QUESTION: what function should I use to get the input file name in XPath builder (if this is the right place to do it) ?
    I tried with:
         getDocAttribute(/process_data/@docApolicesXML,"wsfilename")  + ".PDF"
    Does not work.
    Thanks a lot for any hints!
    Marcos

    Hi Marcos,
    You should do the following:
    Create new variable "filename"
    And in a Set value you should:
    filename = getDocAttribute(/process_data/@docApolicesXML,"basename")
    filename = concat(/process_data/@filename,".pdf")
    This will give you "myFile.xml.pdf - if you want myFile.pdf instead, you need to do this in the Set value:
    filename = getDocAttribute(/process_data/@docApolicesXML,"basename")
    filename = substring-before(/process_data/@filename,".xml")
    filename = concat(/process_data/@filename,".pdf")
    That should do it :-)
    Kim Christensen
    Dafolo A/S
    Denmark

  • Sender adapter processing based on done file content

    hi
    sender system creates a done file, after the creating of actual file. SAP PO 7.4 first need to read the done file for the list of files to be processed from the same folder.
    for eg:
    source folder files:
    xxx11092014.xml
    yyy11092014.xml
    zzz10092014.xml
    done11092014.xml
    content of done file:
    <files>
    xxx11092014.xml
    zzz10092014.xml
    <files>
    In SAP PO 7,4 first need to read the done file, based on the content of the file xxx11092014.xml & zzz10092014.xml need to be processed in sap po and
    all the three file xxx11092014.xml, zzz10092014.xml & done11092014.xml need to be deleted. leaving behind the yyy11092014.xml for which new done file will be created..
    Could anyone please throw some light on this scenario to implement???

    Hi,
    Please check below steps helpful for your requirement by creating two flows and additional files.
    Interface1: This interface to read the filenames from done*.xml and generate the additional files with same name with different extension like xxx11092014.txt and zzz10092014.txt for interface2 to pick.
    1. Configure your sender CC to pick file done*.xml
    2. Use multimapping to create multiple messages based on how many files under <files>
    3. Create additional files in receiver file adapter with same name with different extension by using variable substitution.
    One IDOC to Multiple Files sending to Multiple folders of the FTP using single Communication Channel (SAP XI-PI Process …
    Interface2: This interface to pick files having only additional files with same namepart
    1. Configure your sender CC to pick files having additional files by enabling Additional Files
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816?QuickLink=index&…
    Regards,
    Praveen

  • Crearte folders based on file name and then do action

    I've written this in the best possible step to step way as possible buti've no idea how to pull it altogether as a script. Hopefully its all there, just let me know if its still not clear, I would love the help if anyone can help sort this out for me.
    Many Thanks
    Matt
    -there is a folder on the desktop called Season_SSxx_PSD where xx = a number
    --This folder contains a quantity of PSD files that need to be processed the same but placed in different locations.
    set theDesktopFolder to "Hal 9000:Users:matthew:Desktop"
    set folderName to (folder of theDesktopFolder whose name starts with "SE")
    --From the folderName
    --set the seasonNumber to the item that follows Season_ and is before _PSD (the Season number should be SS13  but can change)
    --Look at all files of folderName
    --Files can be named like the following.
    -- SE_BH70NW01234BM4BM
    -- SE_BU40NW01234BM4BM
    -- SE_ES20NW01234BM4BM
    -- SE_DV25NW01234BM4BM
    -- SE_DJ30NW01234BM4BM
    -- SE_RA30NW01234BM4BM
    -- SE_FR10NW01234BM4BM
    -- SE_TM15NW01234BM4BM
    -- SE_WA35NW01234BM4BM
    -- Now set the brandIdentifier to Item that follows SE_ of the file names of the folderName
    --Convert brandIdentifier to realName
    --BH = BigandHuge
    --BU = Buttons etc..
    -- Now create the folders
    --set up names to destination folders and create over Network for FTP collection (based on a mounted drive)
    --set this_ftp_folder to "Impulse:"
    --set ftpSeasonNumberFolder to my getFolderPath(seasonNumber, this_ftp_folder)
    --Or Impulse:SS13:
    --set ftpBrandFolder to my getFolderPath(realName, ftpSeasonNumberFolder)
    --Or Impulse:SS13:BigandHuge:
    --set ftpBrandFolder_High_Res to my getFolderPath(realName & seasonNumber & "_HR", ftpBrandFolder)
    --Or Impulse:SS13:BigandHuge:BigandHuge_SS13_HR:
    --set ftpBrandFolder_High_PNG to my getFolderPath("_PNG", ftpBrandFolder_High_Res)
    --Or Impulse:SS13:BigandHuge:BigandHuge_SS13_HR:PNG:
    --then the following
    --Impulse:SS13:BigandHuge:BigandHuge_SS13_HR:JPG:
    --Impulse:SS13:BigandHuge:BigandHuge_SS13_LR:PNG:
    --Impulse:SS13:BigandHuge:BigandHuge_SS13_LR:JPG:
    --Its these last 4 that will be used later.
    --then all files begining with BH in the folderName  do this photoshop action and save in the folders created from --above, then move on to the next file begining with BU create the relevant folders and then do the action as --before and so on.

    Cool that sorted the folder creation out without an issue, many thanks.
    Just struggling to pin the photoshop part in.
    property type_list : {"8BPS"}
    property extension_list : {"psd"}
    script o
              property theseNames : {}
    end script
    -- empty log file
    do shell script "echo  'Files not processed in Photoshop :'  > ~/Desktop/LogPhotoshopError.txt"
    set noError to true
    --at the beginning of the script, ask whether to replace or skip existing files? to apply to all?
    --use the result for the if file exists?
    display dialog "Should I replace or skip exisiting files?" buttons {"Replace", "Skip (Faster)"} default button 2 with icon 1
    set skipFiles to (button returned of the result) is "Skip (Faster)"
    set theDesktopFolder to "Hal 9000:Users:matthew:Desktop"
    tell application "Finder" to set seFolder to (folders of folder theDesktopFolder whose name starts with "SE")
    if seFolder is not {} then
              set seFolder to item 1 of seFolder
              tell application "Finder" to set tName to name of seFolder
              set seasonNumber to my getText(tName) -- get Season Number
              if seasonNumber is not "" then
                        set list1 to {"BH", "BU", "ES", "DV", "DJ", "RA", "FR", "TM", "WA"}
                        set list2 to {"BHS", "Burtons", "DaisyAndEve", "Diva", "DorothyPerkins", "DorothyPerkins", "Freedom", "TopMan", "Wallis"} -- you must complete this list ***
                        set tc to count list2
                        repeat with i from 1 to tc
                                  set brandIdentifier1 to item i of list1
                                  set brandIdentifier to item i of list2 -- the real name
      --first item = all files begining with BH
                                  tell application "Finder" to set theseFiles to (files of seFolder whose name starts with "SE_" & brandIdentifier1) as alias list
                                  if theseFiles is not {} then
      --local Folders
                                            set this_local_folder to "Images:2012-2013"
                                            set localSeasonNumberFolder to my getFolderPath("SS" & seasonNumber, this_local_folder)
                                            set localSeasonFolder to my getFolderPath(brandIdentifier, localSeasonNumberFolder)
                                            set localSeasondFolder_PSD to my getFolderPath("PSD", localSeasonFolder)
      --  *** Now create the folders ***
                                            set this_ftp_folder to "Impulse:"
                                            set ftpSeasonNumberFolder to my getFolderPath("SS" & seasonNumber, this_ftp_folder)
                                            set ftpBrandFolder to my getFolderPath(brandIdentifier, ftpSeasonNumberFolder)
                                            set ftpBrandFolder_High_Res to my getFolderPath(brandIdentifier & "_SS" & seasonNumber & "_HR", ftpBrandFolder)
                                            set ftpBrandFolder_Low_Res to my getFolderPath(brandIdentifier & "_SS" & seasonNumber & "_LR", ftpBrandFolder)
      --Use the folders below within Photoshop
                                            set ftpBrandFolder_High_PNG to my getFolderPath("PNG", ftpBrandFolder_High_Res)
                                            set ftpBrandFolder_Low_PNG to my getFolderPath("PNG", ftpBrandFolder_Low_Res)
                                            set ftpBrandFolder_High_JPG to my getFolderPath("JPG", ftpBrandFolder_High_Res)
                                            set ftpBrandFolder_Low_JPG to my getFolderPath("JPG", ftpBrandFolder_Low_Res)
      --- *** end create the folders ***
                                            repeat with i in theseFiles
                                                      set tFile to i as string
      --taking the folder identify which process it must follow.
                        if brandIdentifier is equal to "BHS" then
                                  try
                                            tell application "Finder" to set o's theseNames to (name of files of alias theFolder whose file type is in the type_list or name extension is in the extension_list)
                                  on error
                                            set o's theseNames to {} -- no psd files or "8BPS"
                                  end try
                                  set numOfNames to (count o's theseNames)
                                  repeat with j from 1 to numOfNames
                                            set thefile to theFolder & ":" & (item j of o's theseNames)
                                            --    B H S    Folder Photoshop Process
                                            set thisName to (item j of o's theseNames)
                                            tell application "Finder"
                                                      set t_ext to name extension of file thefile
                                                      if t_ext is not "" then set thisName to text 1 thru -((count t_ext) + 2) of thisName
                                                      set b to exists file (localSeasondFolder_PSD & thisName & ".psd")
                                            end tell
                                            if not b or (b and not skipFiles) then -- not exists file or file exists and "replace" (continue the rest of the script).
                                                      tell application "Adobe Photoshop CS5.1"
                                                                -- I remove the command activate, Photoshop stay in background
                                                                set ruler units of settings to pixel units
                                                                try
                                                                          open (alias thefile) showing dialogs never
                                                                          set origName to name of current document
                                                                          set myOptions to {class:JPEG save options, quality:12}
                                                                          set myPSDOptions to {class:Photoshop save options, embed color profile:true, save layers:true}
                                                                          tell current document
                                                                                    --If the quick mask mode has been left on then delete the channel Quick Mask
                                                                                    if (quick mask mode) then delete channel ¬
                                                                                              "Quick Mask"
                                                                                    --If the Layer is incorrectly labeled with Original Layer it needs renaming to original Image
                                                                                    if (exists layer "Original Layer") then ¬
                                                                                              tell layer "Original Layer" to set name to "Original Image"
                                                                                    save in (localSeasondFolder_PSD & origName) as Photoshop format with options myPSDOptions without copying
                                                                                    (delete layer "Original Image") flatten
                                                                                    resize image resolution 300 resample method none
                                                                                    --sharpen image
                                                                                    filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
                                                                                    save in (ftpBrandFolder_High_JPG & name) as JPEG with options myOptions without copying
                                                                                    --Prepare for Low RES by resetting image history
                                                                                    set current history state to history state 3
                                                                                    flatten
                                                                                    resize image width 1348
                                                                                    resize image resolution 300 resample method none
                                                                                    filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
                                                                                    --add save to lowResFolder with same options
                                                                                    save in (ftpBrandFolder_Low_JPG & name) as JPEG with options myOptions without copying
                                                                                    close saving no
                                                                          end tell
                                                                on error
                                                                          set noError to false
                                                                          my myLogs(thefile) -- write path to log file in Desktop
                                                                          try
                                                                                    close saving no --if exists, close current document
                                                                          end try
                                                                end try
                                                      end tell
                                            end if
                                  end repeat
                                  --End BHS
                                            --taking the folder identify which process it must follow. W A L L I S
                        else if brandIdentifier is equal to "Wallis" then
                                  try
                                            tell application "Finder" to set o's theseNames to (name of files of alias theFolder whose file type is in the type_list or name extension is in the extension_list)
                                  on error
                                            set o's theseNames to {} -- no psd files or "8BPS"
                                  end try
                                  set numOfNames to (count o's theseNames)
                                  repeat with j from 1 to numOfNames
                                            set thefile to theFolder & ":" & (item j of o's theseNames)
                                            --    W A L L I S     Folder Photoshop Process
                                            set thisName to (item j of o's theseNames)
                                            tell application "Finder"
                                                      set t_ext to name extension of file thefile
                                                      if t_ext is not "" then set thisName to text 1 thru -((count t_ext) + 2) of thisName
                                                      set b to exists file (localSeasondFolder_PSD & thisName & ".psd")
                                            end tell
                                            if not b or (b and not skipFiles) then -- not exists file or file exists and "replace" (continue the rest of the script).
                                                      tell application "Adobe Photoshop CS5.1"
                                                                -- I remove the command activate, Photoshop stay in background
                                                                set ruler units of settings to pixel units
                                                                try
                                                                          open (alias thefile) showing dialogs never
                                                                          set origName to name of current document
                                                                          set myOptions to {class:JPEG save options, quality:12}
                                                                          set myPSDOptions to {class:Photoshop save options, embed color profile:true, save layers:true}
                                                                          tell current document
                                                                                    --If the quick mask mode has been left on then delete the channel Quick Mask
                                                                                    if (quick mask mode) then delete channel ¬
                                                                                              "Quick Mask"
                                                                                    --If the Layer is incorrectly labeled with Original Layer it needs renaming to original Image
                                                                                    if (exists layer "Original Layer") then ¬
                                                                                              tell layer "Original Layer" to set name to "Original Image"
                                                                                    save in (localSeasondFolder_PSD & origName) as Photoshop format with options myPSDOptions without copying
                                                                                    (delete layer "Original Image") flatten
                                                                                    resize image resolution 300 resample method none
                                                                                    --sharpen image
                                                                                    filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
                                                                                    save in (ftpBrandFolder_High_Res & name) as JPEG with options myOptions without copying
                                                                                    --Prepare for Low RES by resetting image history
                                                                                    set current history state to history state 3
                                                                                    flatten
                                                                                    resize image width 1020
                                                                                    resize image resolution 300 resample method none
                                                                                    filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
                                                                                    --add save to lowResFolder with same options
                                                                                    save in (networkBrandFolder_Low_Res & name) as JPEG with options myOptions without copying
                                                                                        close saving no
                                                                          end tell
                                                                on error
                                                                          set noError to false
                                                                          my myLogs(thefile) -- write path to log file in Desktop
                                                                          try
                                                                                    close saving no --if exists, close current document
                                                                          end try
                                                                end try
                                                      end tell
                                            end if
                                  end repeat
                                  --End W A L L
                          end if
    end if
    if not noError then do shell script "/usr/bin/open  ~/Desktop/LogPhotoshopError.txt'"
    on myLogs(t)
              try
                        do shell script "echo " & (quoted form of t) & ">> ~/Desktop/LogPhotoshopError.txt'"
              end try
    end myLogs
    on getText(t)
              set {oTID, text item delimiters} to {text item delimiters, "_"}
              try
                        set r to ""
                        set r to text -2 thru -1 of (text item -2 of t)
              end try
              set text item delimiters to oTID
              return r
    end getText
    on getFolderPath(tName, folderPath)
              tell application "Finder" to tell folder folderPath
                        if not (exists folder tName) then
                                  return (make new folder at it with properties {name:tName}) as string
                        else
                                  return (folder tName) as string
                        end if
              end tell
    end getFolderPath

  • Receiver File adapter: dynamic folder name based on file name

    Hi there,
    is it possible to set up one communication channel that will use different target folders based on file name?
    E.g.
    File abcdef will be saved to /root/abcdef/abcdef or /root/abcdef/abcdef.txt
    File xyz will go to /root/xyz/xyz or /root/xyz/xyz.txt
    I know I could use Sender/Receiver Service, Interface/namespace or data from message for variable substitution but could not find an easier solution for this scenario than to create multiple communication channels.
    Thanks.

    If you haven't a message mapping, then you can create only an interface mapping with an abap mapping.
    In your abap mapping:
      DATA l_record type mpp_dynamic.
      l_record-namespace = 'http://sap.com/xi/XI/System/File'.
      l_record-name = 'FileName'.
      l_record-value = "your filename"
      dynamic_configuration->add_record( l_record ).
      l_record-namespace = 'http://sap.com/xi/XI/System/File'.
      l_record-name = 'Directory'.
      l_record-value = "your directory ".
      dynamic_configuration->add_record( l_record ).
    Afther that, you must activate Adapter Specific Message Attributes (directory and/or filename) in your target communication channel .
    Regards,
    Carme.

  • Advise on complex scenario. Correlation based on file name

    I need to process all *.xml files in a folder, but I should only process a specific .xml file if I find another one .ctl with the same name.
    That is. I may have 3 .xml files in a folder (a.xml, b.xml and c.xml), but as I have only one .ctl in the same folder (b.ctl), I should only process b.xml and do something with it.
    I've been struggling to find out a possible way to solve this scenario. I think it's only possible using NFS with the option of "additional files", but I have to use FTP, and it doesn't have that option.
    Of course I could implement it using a java module adapter in the sender comm channel for *.ctl files which establishes the ftp connection for the other file (.xml), but I'm trying to avoid this.
    Thanks!

    Hi,
    Hopefully this blog will solve your problem..(you have to set your parameter as per your need)
    /people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
    Sorry Jorge, I misunderstood your question.. above blog will not help in your case..
    Update:-
    How about writing a script which will scan the source folder  and check if there is a file with .ctl extension then it will move the same name file with extension .xml into some other folder and then you can configure your adapter with this second directory path to simply pick the files.
    Edited by: Sarvesh Singh on Feb 12, 2010 2:07 AM

  • BPM - merge files based on file name

    Hi All,
    i need to collect two source files based on the file name in BPM and then process it.
    Lets say, i need to collect a header file and a items file. but any point of time, there can be more than one header and more than one item file in the source folder. and i need to collect the header and its corresponding/related item file.
    can anyone help me how to achieve it in BPM? whats the correlation i need to give? is it possible to have a java code executed in BPM?
    Is it possible to take care of this at adapter level itself while picking the file? if so, whats the file name scheme can i give?
    Faster reply is very much appreciated.
    Thanks n regards,
    Rashmi

    hi,
    we can have the header file as header and item file as item. basically based on our convenient we can suggest the file name to the sender. so scheme can be anything that fits our requirement

  • Oracle SQL Developer  error - "The file-based source procedure Name is not present in the database."

    I recently started working on the Oracle SQL developer. I have 'select' privileges on the QA schema and when tried to execute proc in QA. It is giving the error as 'The file-based source <procedure Name>  is not present in the database.  Was it compiled?'
    instead 'you do not have sufficient privileges to execute this procedure'. Did research on internet but with no luck.What configuration changes needed to be done to make it work.Guide me.

    Sounds like you do not have the correct privileges.  What should have been granted to you by the QA user, or some other user with appropriate privileges, is...
    grant EXECUTE on "QA"."<PROCEDURE_OF_INTEREST>" to "<YOUR_USERID>" ;
    Note that a grant of execute on a procedure has nothing to do with grants of select on some or all of QA's tables and views.
    So, as Vadim suggests, from your connection node in SQL Developer's Connections view, if you expand the Other Users node, then expand QA and look in the Procedures node, do you see the procedure of interest?  If not, you cannot expect to be able to execute it from your userid's connection. And even if you do see it, you may have some other privilege that permits viewing but not executing, like...
    The role SELECT_CATALOG_ROLE
    The system privilege SELECT ANY DICTIONARY
    And even if you do not see it there, then having certain other privileges granted to you could permit executing it in general, like...
    The role EXECUTE_CATALOG_ROLE
    The system privilege EXECUTE ANY PROCEDURE
    Also, note that the 3.0 release is a bit dated nowadays. Upgrading to 4.0.3 production or even the 4.1 EA2 (early adopter) release will, in general, give you a better experience.
    Best wishes,
    Gary

Maybe you are looking for