Interacting with external processes

What are the options in the latest AIR regarding interacting with external processes running on the same machine?
Thanks

You will need to user AIR 2.0.
Here is a tutorial:
http://www.adobe.com/devnet/air/ajax/quickstart/interacting_with_native_process_print.html

Similar Messages

  • Interact with extern process by Runtime.exec()

    Hi,
    I want interact with a extern process by Runtime.exec(), but I don't Know the way for introduce the params required for the extern process.
    So, Is posible, interact with the extern process from Java?
    Thanks

    Exactly, I would like to know how exec can pass a PIN
    number when the proccess already has been launched. Sounds like you're doing it through the process' stdin. Read that article I linked.
    You'll have to call Process.getOutputStream() or whatever that method is. To you it's an OutputStream, to the process, it's input. You'll write the stuff to that stream that you'd type to the command line. If you want to get that from the user interactively, you'll do it like you would any interactive user input in any Java program--get it by reading System.in or from some GUI element, and then take that and write it to the process' stream.
    If you're not familiar with I/O in Java, look here:
    http://java.sun.com/docs/books/tutorial/essential/io/index.html

  • How to interact with external database in CQ5

    Hi,
    I need to interact with external database like SQL or Oracle to store some/fetch some data in CQ5. Can someone pls provide some help regarding the same. I guess I need to do it through JDBC. Please guide me step by step how to do this.
    Thanks

    Hi,
    Bellow you find some references to the documentation related to CQ and DB configuration and developments:
    http://dev.day.com/docs/en/cq/current/developing/jdbc.html
    https://helpx.adobe.com/cq/kb/HowToConfigureSlingDatasource.html
    Regards,
    kasq

  • BPM - Interact with external system

    Hi Experts,
    We are implementing a project with BPM Suite Version 1.1.1.6 (PS5). A requirement is the following things:
      - The BPM process begins through a human task.
      - Upon completion of the human task, the flow must interact asynchronously with an external system through a webservice. The BPM system sends data to external system.
      - The user interacts with the external system and runs a couple of tasks.
      - After completing the activities in the external system, the BPM should be receiving an event to continue with the main flow was in wait.
    The question is....as an external system can reactivate a BPM process that is in wait hoping the event.
    Thank you very much.

    Investigate the use of the Call activity. If the external process is long-running, you might use a Service activity in conjunction with correlations.

  • Interact with another process

    Does anyone know how can I make my program send/read text from another program? Let's say that my active window is Notepad. I would like to be able to insert text and also read what has been typed (i.e. it would copy & paste).
    Any macro program can do that, but I want to treat the data with Java.
    Thanks.

    If what you want is just a copy&paste tool wich can interact with other programs, you can try the api clipboard from awt:
    import java.awt.datatransfer.Clipboard;
    import java.awt.datatransfer.ClipboardOwner;
    import java.awt.datatransfer.Transferable;
    import java.awt.datatransfer.StringSelection;
    import java.awt.datatransfer.DataFlavor;
    import java.awt.datatransfer.UnsupportedFlavorException;
    import java.awt.Toolkit;
    it can be useful:
    // clipboard
    public void getClipboardContents() throws Exception
         BufferedReader in;
         Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
         Transferable contents = clipboard.getContents(null);
         boolean hasTransferableText =(contents != null) && contents.isDataFlavorSupported(DataFlavor.stringFlavor);
         if ( hasTransferableText )
              in = new BufferedReader (new StringReader((String)contents.getTransferData(DataFlavor.stringFlavor)));
              String linea = in.readLine();
              while (linea!=null)
                   linea = in.readLine();
              in.close();
    public void setClipboardContents( String aString )
         StringSelection stringSelection = new StringSelection( aString );
         Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
         clipboard.setContents( stringSelection, this );
    the clipboard can be fullfilled from any app and read from java because it's a sysyem pool, but you cannot receive events from windows apps like notepad, you can copy notepad's text and paste it to your java app.

  • Routing and Externally Process and Purchase requisition

    Dear Experts
    I try to set routing with External processing.
    I have 2 questions.
    I would really appreciate you, if you could answer my questions.
    I still have not understood the relationship between "Control key" and "Purchase Order"
    The routing is like below
    10 self manufacturing
    20 External Processing with the control key is pp02
    30 self manufacturing
    In case I set "+"  (Externally processed operation)   for "External Processing" in "pp02", the Purchase Requisition will be created.
    However in case I set "X"  (Internally processed operation / Externally processed operation)  for "External Processing" in "pp02", the Purchase Requisition will not be created.
    My question is in case I set "X" for "External Processing" for Control key, how can I create Purchase Requisition?
    Should I create Purchase Requisition manually?
    In case I set task 20 as External Processing.
    What kind of Work center should I regist for task20?
    Is it dummy work center or is empty OK?
    Best Regards

    Dear,
    When you maintain external processing in your control key PP02 and the system will create a purchase requisition when you release the production order. For that particular external processing operation you need to maintain the purchasing group and info record details in the external processing tab in routing.
    Please refer my reply from this link,
    Re: Control key for external process operation & internal.
    Regards,
    R.Brahmankar

  • Interacting with perl through java.

    I'm trying to do something with Java that I haven't managed to do until now. I'm trying to interact with a perl process giving him input and reading output.
    I have a perl module that has several functions and the idea is to launch a process in a java program with the following line :
    perl -e 'while(<STDIN>) { eval $_ ; }'
    and then give the process the necessary input and the read the given output.
    For instance with the above line you can do the following:
    [user@host ~]$ perl -e 'while(<STDIN>) { eval $_ ; }'
    print "Hello World\n";
    Hello World
    Here is the code I'm using:
    import java.io.BufferedReader;
    public class ExecProgram {
    private static Runtime runtime;
    private static Process process;
    public static void main(String[] args) {
         runtime = Runtime.getRuntime();
         try {
         process = runtime.exec("/usr/bin/perl -e 'while(<STDIN>) { eval $_ ; }'");
              process = runtime.exec(cmd);
         } catch (IOException e) {
              System.err.println("Error executing process");
         PrintWriter out = new PrintWriter(process.getOutputStream());
         String commandLine = "print \"Hello World\n\"";
         out.println(commandLine);
         BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
         try {
         String line;
         while ((line = in.readLine()) != null)
              System.out.println("Output: "+line);
         } catch (IOException e) {
         System.err.println("Error reading output");
    As you can see I'm using Runtime class to interact with the process but nothing happens if replace the exec line with:
    process = runtime.exec("ls");
    I can see in the output the listing of the current directory.
    Have you ever tried something like this? Is this the correct way for doing this?

    Have you ever tried something like this? I have. Here's a rough sample:
        public static void main(String[] args) throws Exception {       
            String[] cmd = new String[]{
                "/usr/bin/perl",
                "-e",
                "while(<>){ eval or die $@; }"
            final Process p = Runtime.getRuntime().exec(cmd);
            new Thread(){
                public void run(){
                    try{
                        BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
                        for(String line; (line = r.readLine()) != null; System.out.println("ProcessOUT:: "+line));
                    catch (Throwable t){
    //                    t.printStackTrace();
            }.start();
            new Thread(){
                public void run(){
                    try{
                        BufferedReader r = new BufferedReader(new InputStreamReader(p.getErrorStream()));
                        for(String line; (line = r.readLine()) != null; System.err.println("ProcessERR:: "+line));
                    catch (Throwable t){
    //                    t.printStackTrace();
            }.start();
            new Thread(){
                public void run(){
                    try{
                        OutputStream out = p.getOutputStream();
                        for(int ii = 0; ii < commands.length; ii++){
                            System.err.println("Sending command: "+commands[ii]);
                            out.write(commands[ii].getBytes());
                            out.write('\n');
                            out.flush();
                    catch (Throwable t){
    //                    t.printStackTrace();
            }.start();
            int exit = p.waitFor();
            System.err.println("Process exited with code: "+exit);
        static final String[]
            commands = {
                "print \"The road goes ever\\n\";",
                "print \"ever\\n\";",
                "print \"on.\\n\";",
                "exit 13;"
        ;

  • Workflow integration with external DMS system

    Hi,
    What integration/control transfer possibilities exist between SAP Workflow and an external document management system (e.g. Hummingbird)? Would some sort of interface be necessary for the integration and what would the level of effort be more or less?
    This is quite urgent and I would greatly appreciate your input.
    Regards
    Liza-Marie

    Hi Liza-Marie,
    you can work at different levels:
    1) Integration of documents use in the SAP workflow can be stored in external DMS and linked to SAP transactions through SAP Archivelink; you'll probably need a Hummingbird interface certified archivelink
    2) If you want to integrate your SAP workflow with the workflow of the DMS (if any), you can practice as follows:
    a) From you DMS, you can raise events in the SAP system on which your SAP workflow would react (to start or resume) by making use of standard RFCs such as SWE_EVENT_CREATE; eventually you can expose it as web service, which will simplify the call
    b) From SAP worfklow, you can send mails, call external system commands (more rarely used) or call web services that would allow you external DMS to be triggered on
    Details on all these techniques would be too huge to be described in a post, but this gives you an overview on how SAP Workflow can interact with external solutions.
    In summary to your question:
    1) Interface required YES - ARCHIVELINK CERTIFIED in case you want to store documents in external DSM that need to be connected to your SAP transactions
    2) Level of effort is depending on your scenario
    Rgds,
    Karim

  • Interacting with processor

    Okay, so I'm curious about how to use Java to interact with the processor like you would with C or C++. For example, what if I wanted to interact with a process or write a software driver using Java.

    write a software driver using JavaYou can't.Well I fact you can, but not on all platforms, may be only one : see the JNode project
    --Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                           

  • Running an Interactive External Process

    I am trying to run an Interactive external process.
    This process is an exe program.
    When I run this program it prompts for a password.
    Here the reader.read() is never gets to a ready state.
    Following is a snippet of the program
    public class StreamGobler extends Thread{
    private InputStream is;
    private OutputStream os;
    private String pwd;
    private int waitState = 1;
    public StreamGobler(InputStream _is, OutputStream _os, String _pwd)   {
            this.is = _is;
            this.os = _os;
            this.pwd = _pwd;
         public void run() {
            BufferedReader reader = null;
            BufferedWriter writer = null;
            try {
                reader = new BufferedReader(new InputStreamReader(is));
                writer = new BufferedWriter(new OutputStreamWriter(os));
                String msg = "";
                int c=0;
                //This is where my program get blocked it never enters the while block and eventually timesout               
                while ((c = reader.read()) != -1) {            
         msg += (char) c;
         if (waitState == 1) {                 
            if(msg != null && msg.toLowerCase().indexOf("password") != -1){
         writer.write(pwd+ "\n");                    writer.flush();                         waitState++;                    msg = "";
                       }else{
           buffer.append((char) c);              
            catch (Exception ee) {}       
            finally {
                try {
         if (reader != null)
             reader.close();
         if (writer != null)
             writer.close();
               } catch (Exception ee) {}
    Message was edited by:
            ff1012                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    You need to check with the vendor of this unspecified application to see if they have an api for remote control. Perhaps they have an ActiveX interface? If not, I've had very good luck with an application called AutoIT - https://www.autoitscript.com/site/autoit/
    There are LabVIEW examples on the forum.

  • How to handle starting of external processes with Runtime.exec() properly

    hi people,
    you find a lot about starting external processes with the Runtime class in every forum.
    -> that the stdout of the started processes has to be redirected and read
    due to os buffer problems
    -> that calling batches is done by starting the interpreter and the batch as parameter (cmd.exe, /bin/sh,..)
    -> that the created process doesn't have an os environment
    -> ...
    but what if you don't know anything about the started process.
    what if you only want only to start an external process. if you don't want to wait til waitfor() returns and if you don't read the streams of the created processes, the os stdout buffer will overflow immediately an the started process will be blocked.
    you can read the stdout of the started process, but what if the process does print nothing to stdout, and your bufferreader.readLine() will block ?
    you can do this (read buffer, waitFor()) in an separate thread, but the thread lives til the started process will finish, so maybe you got dozens of senseless thread ?
    So, what is an effective and good way to start external programs/processes if you don't know about them.
    so i would be grateful for an answer
    regards
    Alen

    I realize that's a pat answer, but it's true. Spawing off another program without being able to predict its behavior is dangerous.
    But anyway, as I understand it creating a new process is relatively expensive. The cost of creating new threads to read the process's I/O and later garbage collecting those threads when the process dies, probably isn't much of an additional burden.

  • Muliple process interactions with client

    Is it possible to have multiple interactions with the client?
    I have a BPEL process that calls a web service and then replies to the user what is sent back. This is then used by the user to invoke another web service through the business process.
    In other words: the client initiates the process, the process uses this to invoke a service. The reply is sent to the user. The user then sends another message to the process which uses this to invoke another service. The result of the service invocation is sent to the user by the process.
    This seems really simple but I am having trouble achieving this and all examples seem to be one invocation by the client and then one repliy. If anyone knows if/how this can be achieved it would be greatly appreciated.
    thanks,
    Clive
    Edited by: clive jefferies on Dec 3, 2008 10:51 AM

    yes, its pretty much possible to call the same BPEL instance again and again. This is called Asynchronous call back, and is possible with WS-Addressing or you can use the BPEL Correlation set to achieve this functionality.
    Here is a step by step tutorial on how to achieve this,
    http://technology.amis.nl/blog/2813/use-bpel-correlation-sets-for-repeated-synchronous-access-to-long-running-bpel-processes
    Hope this will resolve your problem...
    -Abhi

  • Internal processing Vs external processing with in the networks under a WBS

    Dear Gurus,
    please give an over view about internal processing Vs external processing with in the networks under a WBS element ,
    is there any different process for creating reservatios & PRs in both the above ?
    rgds

    I think for internal processing the procurement indicator willbe 140 (when PR is not required) & for external processing the procurement indicator willbe 130 (when PR is required)
    Regards,
    Indranil

  • Starting of external processes with Runtime.exec() properly

    hi people,
    you find a lot about starting external processes with the Runtime class in every forum.
    -> that the stdout of the started processes has to be redirected and read
    due to os buffer problems
    -> that calling batches is done by starting the interpreter and the batch as parameter (cmd.exe, /bin/sh,..)
    -> that the created process doesn't have an os environment
    -> ...
    but what if you don't know anything about the started process.
    what if you only want only to start an external process. if you don't want to wait til waitfor() returns and if you don't read the streams of the created processes, the os stdout buffer will overflow immediately an the started process will be blocked.
    you can read the stdout of the started process, but what if the process does print nothing to stdout, and your bufferreader.readLine() will block ?
    you can do this (read buffer, waitFor()) in an separate thread, but the thread lives til the started process will finish, so maybe you got dozens of senseless thread ?
    So, what is an effective and good way to start external programs/processes if you don't know about them.
    so i would be grateful for an answer
    regards
    Alen

    http://forum.java.sun.com/thread.jspa?threadID=659862&tstart=0
    The first four might pass as accidents, but this one is simply idiocy, spamming and general bad manners.

  • External Processing with material Provided to Vendor

    Dear All,
    I have a problem in external processing of Maintenance Order.
    When i have created external processing operation.
    I have assigned one component for that external operation which i have to send to vendor.
    After saving the Maintenance order, system is generating Purchase Requisition for that operation.
    That purchase requisition is having account assignment category F. But it is not picking the item category L and the component assigned for this external operation is not flowing to the purchase requisition.
    Please guide me to solve this issue.
    Thanks & Regards
    Bala

    Hi
    For external service we can use PM03, for that we have to create service sheet and proceed further.
    But here my requirement is, just like PP external processing they are doing one operation outside.
    If you look at PP routing, Operation overview there is given external processing data and there will be subcontracting tick.
    If we tick the sub-contracting button, then system will pick the component assigned to that operation to the Purchase requisition.
    If we don't tick that button, system will not copy the component to PReq. .
    Is there any option available here in PM?
    Please guide me.
    Thanks & Regards
    Bala

Maybe you are looking for

  • Engineer appointment Confusion

       We are meant to be expecting an engineer on the 19th September to set up our BT infinity. On the tracking it is saying we do not need an engineer anymore because they can connect at the exchange. Somehow I don't think this is right. I contacted BT

  • Payables Account Analysis report takes long time to produce xml output

    Hi, I am trying to get xml data for the Payables Account Analysis report. I have changed the output format of the concurrent program to XML. The report takes long time to produce the xml data irrespective of the number of rows fetched. But the same r

  • Reading XML using Java

    I want to read all <temp >nodes map them to some variable and create one more XML. I am stuck up in the first place itself where i need to read the data :( . I am getting null pointer exception, please find the code also. <?xml version="1.0" encoding

  • Blackberry user ID

    I have a problem with my blackberry ID. I know my username and password are correct , but when I downloaded the new bbm that required the blackberry id information, everytime I type the correct information a message appears saying (Please enter the u

  • Out XML element values extract

    hi their How can I out XML element the values extract and in a loop in variable and/or in an array store? Example: [loop] <SA>'MS','GYM'</SA> Values 'MS' and 'GYM' should be in variables e.g var1='MS' and var2='GYM' [end loop] Please, help me!!!! Urg