Endeavor to "Mobilise" procedures from appserver to pas, to telerik.. - Forum - Mobile - Progress Community

Endeavor to "Mobilise" procedures from appserver to pas, to telerik..

 Forum

Endeavor to "Mobilise" procedures from appserver to pas, to telerik..

  • Hi you al!

    I'm in the quest to get mobile some procedures, but I found myself into something I can't quite resolve..

    Have the following calling procedure.

     ASSIGN FRAME {&FRAME-NAME} fFecha fFEcha-2 .
            CREATE SERVER hServer. 
                   
            GET-KEY-VALUE SECTION "CONNECTION" KEY "AppServerSuc"    VALUE charID.
    
            lRetOK = hServer:CONNECT (charID) NO-ERROR.
        
            IF NOT lRetOK THEN 
            DO:
                MESSAGE "..."
                    VIEW-AS ALERT-BOX ERROR.
                RETURN.
            END.
            ELSE 
            DO:
                {procs\inc\wait.i} 
                RUN dw/GetAperturas.p ON hServer  
                    (fFecha, fFEcha-2, OUTPUT DATASET dsApertura ) NO-ERROR.            
            END.
            hServer:DISCONNECT ().
            DELETE OBJECT hServer.
        
            EMPTY TEMP-TABLE scrApertura.
        
            FOR EACH ttApertura:
                CREATE scrApertura.
                ASSIGN 
                    scrApertura.Sucursal = ttApertura.Sucursal ....
            END.
        
            {&OPEN-BROWSERS-IN-QUERY-DEFAULT-FRAME}

    Then on appserver I have this called procedure (GetAperturas.p)

    {"DW\dwapertura.i"}
    
    DEFINE INPUT  PARAMETER pFecha1 AS DATE NO-UNDO.
    DEFINE INPUT  PARAMETER pFecha2 AS DATE NO-UNDO.
    DEFINE OUTPUT PARAMETER DATASET FOR dsApertura.
    
    DEFINE VARIABLE FechaCorriente AS DATE NO-UNDO.
    
    
    
    /* ***************************  Main Block  *************************** */
    
    ASSIGN 
        FechaCorriente = pFecha1.
    
    DO WHILE FechaCorriente <= pFecha2:
        FOR EACH dwh.Sucursal WHERE Sucursal.EnLinea NO-LOCK:  
           IF .....
                FOR EACH Apertura NO-LOCK
                    WHERE Apertura.Sucursal = Sucursal.Sucursal
                    AND   Apertura.Fecha = FechaCorriente:
                    CREATE ttApertura.
                    BUFFER-COPY Apertura TO ttApertura.                
                END.        
            END.
            ELSE 
            DO:
                CREATE ttApertura.
                ASSIGN 
                    .......
            END.    
        END.    
        ASSIGN 
            FechaCorriente = FechaCorriente + 1.
    END.

    My problem came at the point where the procedure has parameters, 

    I woul like to use that same procedure to expose as rest for using with jsdo and stuff... and remote proc at PAS...

    Am I getting it right? or Am I confused about the possibilities on the technology involved? and should have 2 parallel procedures?

  • The Mobile/REST tooling requires internal procedures (or methods). The safest approach is to create a new .P that has internal procedures that call your existing .P code. Safest because the existing code will continue to work.
     
     
     
  • Ok!!!

    Will do...  Thanks!