monitor provoked session

Hello

I created a session ,the 3rd uproc wait for a file resource,if exist the chain carry on ,if not the session wait until the file exist in a path.
I need to have only one session for file ,so for now the solution was a provoked session that in the last uproc launch another provoked session of the same type and so on ,but now I have a problem,how can I know that the session is running or in "event wait" ?
I need to know if the session is active or I need something that restart the session automatically when the session is not active.
or in alternative I can create a cyclic session/scheduled session but I need to have only one session running at time.

Thanks in advance for your help

Regards
 

Answers

  • Andreas GASTLAndreas GASTL Posts: 24 Journeyman ✭✭✭

    we just use logical resources in such cases

    The first uproc in the session allocates the resource and the last one frees it again.

    If now, the same session tries to start while the resource is blocked it waits until the resource is freed and starts then.


    maybe this will match your needs?

    regards,

    Andreas

  • Hi Andreas ,thanks for your answer!!
    yes this match with my needs,
    But I don't know how to allocate the resource and free it in the end ,
    could you please give me some details?

    thanks in advance
  • Andreas GASTLAndreas GASTL Posts: 24 Journeyman ✭✭✭

    we/I use header- and tail- Uprocs for this purpose within the session with internal scripts to handle the resources

    (if you use the resource within the Launch Formula it is freed as soon as the header-uproc is finished)


    so you need 2 internal scripts

    header:

    create a loop around the command "uxshw res res=resource-name full" and wait until the resource is free

    (you need to check the resource-value in the output of the command)

    once it is free you can allocate it with

    "uxhld res res=resource-name lock"


    tail:

    "uxrls res res=resource-name clear"


    however....  maybe anyone else has a better idea without scripting?

    that's just the way I do it and it works for me/us quite well :)

  • Thanks for your  advices and patience :-)

    now I 'm triing to implement the command

    uxhld.exe res res=AGM_BLOCK lock

    I receive an error :
    No resource is selected for the operation.
    command in error!!

    but I indicated the resource on the res=AGM_BLOCK
    probably I'm doing some errors.






  • NPO srl NPO srlNPO srl NPO srl Posts: 6 Rookie
    Hi

    I resolved in another way,
    I used a "file"  resource, I put a file to "lock" the resource at the beginning of the session.

    Thanks


Sign In or Register to comment.