Leave feedback
  • Question

    CallProc scripting function not working as desired.

Enter a new topic
  • Naga Pradeep Bysani Naga Pradeep Bysani
    0 likes 18506 views

    I have been using CallProc function to call the process if a condition is satisfied and it worked perfectly all these days. Today for the first time, I had a need to use this function in Message after script if a condition is satisfied. When I tried this, it gave the below error if the condition is not satisfied though it works well if the expression in the condition is true.

    0406 133431 (3465) 0 Fatal error: No resources allocated for process, possible reason: CallProc() not called during preproc phase
    0406 133431 (0336) 3 StreamServer: Stopping inconnectors

    Also, the same script works well in before Message script and before/after Process scripts without making any changes.

    if(Exist($OutputFilePathDummy))
    CallProc("New PageOUT 1");

    This is the condition I used in the Streamserve project. If at all event and process details are required, I am using PageIN event and PageOUT process.

    Also, I see "The CallProc function can be used in Before/After Message or Before/After Process scripts."  in the help manual. So, it is clear that this function can be used in four of these places (Before/After Message or Before/After Process scripts).

    Of course as a temporary solution, I am using skip function using a reverse condition in the process before script of the process.

    I could not understand clearly what the error message says. Please explain what the error means and give any inputs on this.

    Thanks.

    Pradeep.

    Wednesday 06 April, 2011
  • Tony RANNOU Tony RANNOU
    0 likes

    Hi Pradeed,

    It is normal, because during the preprocessing phase, if the file doesn't exist, the callproc isn't called, and after the processing file in the script before message, if the file exists the callproc is called.

    But for Strs, a process can't be called if it is not call in the preproc phase.

    Tony

    Wednesday 06 April, 2011
  • Naga Pradeep Bysani Naga Pradeep Bysani
    0 likes

    Hi Tony,

    My name is Pradeep (not Pradeed). Thanks for your reply. In fact, it does not seem to be normal for me as it clearly states "Fatal Error" in Control Center log and this does not happen if the same segment of script is placed in Before/After Process or Before Message scripts irrespective of the existence of file. This error is shown only if the file does not exist and the function is called in Message After script.

    Pasting more log details below.

    0406 163110 (0048) 3 File outconnector: File <pdf file path> created.
    0406 163110 (3465) 0 Fatal error: No resources allocated for process, possible reason: CallProc() not called during preproc phase
    0406 163110 (0336) 3 StreamServer: Stopping inconnectors
    0406 163110 (0099) 3 directoryscanner/1.0: <directory>\streamserve_proc\ds166013021038708720.tmp moved to <directory>\unprocessed\ds166013021038708720.bak
    0406 163110 (0337) 3 StreamServer: Stop Scheduled Queues
    0406 163110 (0338) 3 Stop Communication Server Application
    0406 163111 (3182) 1 Server: Closing down
    0406 163111 (3178) 0 Server: Stopped.
    0406 163111 (2388) 0 Stopped

    0406 163111 (0327) 3 StreamServer: Stop Scheduled Events

    What happens is - if the expression in the condition used is false, it creates the pdf output, shows this log message in Control Center and stops processing any further input files. Though it seems to be in "start" mode in Control Center after showing this error, it needs a restart of that particular application to process any further input files. When it is restarted, it works well if the condition is true and if it is false, the same cycle continues.

    Probably, you will get more clear picture if you practically try this out.

    Wednesday 06 April, 2011
  • Andreas Hjelle Andreas Hjelle
    0 likes

    Hi Pradeep,

    Which version and build are you using?

    One way to find out if indeed it is the callproc that is causing the problem is simply to call the process on the after message script without conditions. Remember, if you use dynamic out connectors to set the connector as well before you call the process.

    Regards,

    andreas

    Wednesday 06 April, 2011
  • Johan Steneby Johan Steneby StreamServe Employee
    2 likes

    Hello Pradeep,

    You can get this fatal error when the project logic for some reason does not use the script function CallProc() in the same way in the preproc and process phase.

    When using Callproc and if-statements you should be careful since the variables and scripts are evaluated in preprocess mode.
    You can log the variables used for logic for calling CallProc() using the functions Preproclog() and Log().

    Here is a short description of what happens:
    In preproc all the resources are allocated that will be used for the “real” run.
    The event is now run plus all scripts and so on, the only thing that differs is that nothing is written to the outqueues.
    After the preprocess-phase all the variables are reset but now are all resources that are needed for the real “run” .
    When the preprocess phase is run the order of the called processes are stored in a list.

    When the process phase is then run, every process will be verified against the list from preproc.
    If the order is not the same there will be an error. The order of the processes must be the same in preproc and runtime.

    You can find more information about these phases in the online help (/Scripting/Scripting in StreamServe/StreamServe Job execution).

    I hope this helps

    /Johan

    Thursday 07 April, 2011
  • Naga Pradeep Bysani Naga Pradeep Bysani
    0 likes
    More inputs from me. Andreas, I am using Streamserve Persuasion 5.4 Johan, Thanks for the clear explanation. Though I am aware of the three phases in execution of data in Streamserve, I never assumed a scenario where data in Preprocess is different from that of Process phase unless Preproc function is used as a condition. As suggested by Andreas, I used PreprocLog function to log the data in preprocess phase. And now, I found that FileMove function returns 0 in Preprocess phase always though actual value is returned correctly only in Process phase. (For example, if filemove function returns 2 in process phase, still it returns 0 in preprocess phase.) I do not know the reason why this happens but this is the practical finding and fact. In my query at the top, I pasted a segment of script when I assumed it makes no difference. In fact, actual script is as below. if(Exist($OutputFilePath)) { $errorNum = FileMove($MetadataFilePathDummy, $MetadataFilePath); $errorMessage = ioErrText($errorNum); if(num($errorNum) > 0) CallProc("New PageOUT 1"); } When this script did not work in Message after script, I was checking in other three places (Msg before, Process before/after scripts) with just exist condition and callproc . That led me to come to a conclusion while posting the query that CallProc does not work with if condition in Message after script. Now, below are the queries I have. 1. Why is FileMove function returning actual value only in process phase and not in preprocess phase? 2. This error "0406 163110 (3465) 0 Fatal error: No resources allocated for process, possible reason: CallProc() not called during preproc phase " is displayed only for CallProc function. If I replace callproc statement with any other statement in this script and execute, it works very well without errors. Why so? 3. Is there any direct approach to trigger an email when there is an error while moving a file? The intention of using CallProc in this script is - send an error email when there is any error in moving the file. I am trying with a work-around. Hopefully, it works. Friday 08 April, 2011
  • Naga Pradeep Bysani Naga Pradeep Bysani
    0 likes

    Previous post can be ignored as formatting did not get applied as there was some error in the browser while posting. And so, posting it again.

    More inputs from me. Andreas, I am using Streamserve Persuasion 5.4

    Johan, Thanks for the clear explanation. Though I am aware of the three phases in execution of data in Streamserve, I never assumed a scenario where data in Preprocess is different from that of Process phase unless Preproc function is used as a condition. As suggested by Andreas, I used PreprocLog function to log the data in preprocess phase. And now, I found that FileMove function returns 0 in Preprocess phase always though actual value is returned correctly only in Process phase. (For example, if filemove function returns 2 in process phase, still it returns 0 in preprocess phase.) I do not know the reason why this happens but this is the practical finding and fact.

    In my query at the top, I pasted a segment of script when I assumed it makes no difference. In fact, actual script is as below.

    if(Exist($OutputFilePath))
    {
     $errorNum = FileMove($MetadataFilePathDummy, $MetadataFilePath);
     $errorMessage = ioErrText($errorNum);
     if(num($errorNum) > 0)
     CallProc("New PageOUT 1");
    }

    When this script did not work in Message after script, I was checking in other three places (Msg before, Process before/after scripts) with just exist condition and callproc . That led me to come to a conclusion while posting the query that CallProc does not work with if condition in Message after script.

    Now, below are the queries I have.
    1. Why is FileMove function returning actual value only in process phase and not in preprocess phase?
    2. This error "0406 163110 (3465) 0 Fatal error: No resources allocated for process, possible reason: CallProc() not called during preproc phase" is displayed only for CallProc function. If I replace callproc statement with any other statement in this script and execute, it works very well without errors. Why so?
    3. Is there any direct approach to trigger an email when there is an error while moving a file?

    The intention of using CallProc in this script is - send an error email when there is any error in moving the file. I am trying with a work-around. Hopefully, it works.

    Friday 08 April, 2011
  • Kanakadurga Pamulapati Kanakadurga Pamulapati
    0 likes

     Hello Guys,

    I am New to Stream Serve. I have an issue connecting from SAP.

    I am an SAP-ABAPER.. we have forms generated in SAP and the logo is comming from StreamServe. Now the Issue is how to change the logo in StreamServe.

    My Queries

    1. How to Open StreamServe. Is it a GUI. If so how to connect.

    2. I found that StreamServe is in Unix Platform. So, how to connect to StreamServe from Windows platform.

    Please help me in those above things.

    Regards,

    Sunil

    Contact me to my below mailid

    sunil.medepalli@in.ibm.com

     

    Tuesday 26 April, 2011
  • Naga Pradeep Bysani Naga Pradeep Bysani
    0 likes

    Hello Sunil,
    Streamserve has mainly two components - Design Center and Control Center.

    Design Center is a GUI tool used to create and maintain Streamserve projects (configurations). The configurations are exported to a folder using Design Center. This exported file will be deployed in Control Center to be able to run the Streamserve application.

    Control Center is an administration tool (of course GUI), used to deploy, run and administer Streamserve applications on Windows and Unix hosts. But, Control Center tool can be opened only in Windows environment.

    For more details, you can refer Design Center.pdf and Control Center.pdf help files which are available along with the software.

    Specific to your case - to just change the logo in Streamserve, if you can locate the path of the image file used by Streamserve, you can replace the new one with the existing file without the need to change any configurations in Streamserve. Make sure the image file name remains same even after replacement of the file.

    Regards,

    Pradeep.

    Tuesday 26 April, 2011
  • Vyv Lomax Vyv Lomax Administrator
    0 likes

    Hi Sunil - please post this on a new thread as your question (which is valuable to others) is unrelated to the original posting.

    Tuesday 26 April, 2011
  • Rajesh Kumar Singh Rajesh Kumar Singh
    0 likes

    Hi Pradeep,

    I am also facing the same issue:

    1023 215241 (3465) 0 Fatal error: No resources allocated for process, possible reason: CallProc() not called during preproc phase

    Can you please help with the workaround. My purpose is also same like yours i.e. to send email.

    Below is my scrIPT IN Message After:

    if(num($var_getTotalCount) = num( $var_TotalCount))
        {
        log (1, "INFO  :: XML_TO_PDF_MESSAGE_DocType2 : Mail Firing Initiated......................:");
        callProc("MailOUT_PDF_DocType2");
        }

    And the error comes up after prinitng  Mail Firing Initiated......................:.

    Can you please help me on this?

    Thanks in advance.

    Sunday 23 October, 2011
Next