mr_suleyman
14th October 2004, 13:04
Hello all ,
I want to run 5 sessions step by step in one main session. In my structure,
5th session depends on 4 th sessions , 4 th session depens on 3th session and like that. I know job managment in Baan but I don't know exactly sessions' run time.I mean that When one sessions' work finish , other must start up to 5 th sesion.

Thanks all in advice.

mark_h
14th October 2004, 15:58
And depending on your needs for error checking you could always use an AFS function server to run the sessions. If using a job works then I would do it that way, but if you need to check reports and such you could always use a function server. With a function server you could always validate the data between session to make sure everything went just fine, then launch the next session. I use this type method to load our simulation company - creating milestones, contract requirements, costing links, etc.

Mark

mr_suleyman
14th October 2004, 16:30
I meant that I want to write code for running 5 sessions in one session.Because of session's running time period , I Couldn't use Job managment in BAAN. I don't know sessions's running time , it can be change according to processed data.

Any idea ?

lbencic
14th October 2004, 17:49
One suggestion (I'm sure there are several ways) - you can use AFS coding to call each session from one main session. You will have to create and code that main session, and there's a lot of work learning the AFS coding methods. I suggest starting at the sticky at the top of the AFS forum.

Hitesh Shah
15th October 2004, 07:54
I think ohters have given options enough for you to start with. If u need further information , please elaborate exact functional requirement . It will help others to help u better.

mr_suleyman
15th October 2004, 08:21
Thanks for your suggestions. But I need coding samples. I don't know exactly all AFS functions and I don't have enough information about AFS. I want to write
code for running 5 sessions in one main session and error control .
In addition to this , IS AFS compatible witt Baan IV 3c ?

Thanks...

mr_suleyman
15th October 2004, 11:16
I found AFS function to start session that is stpapi.continue.process()
But How can I know that running process finished ?

jp.aalders
15th October 2004, 11:21
using AFS you now that the session has finished when the stpapi.end.session
statement is passed in the program script. This works fine, I've written an AFS session which is processing re-scheduling messages of the MRP automatically and afterward is running the MRP net-change again.

Works fine.

NPRao
15th October 2004, 20:09
How can I know that running process finished ?
Refer to the posting - can we know the process id of sessions started using AFS? (http://www.baanboard.com/baanboard/showthread.php?t=6485&highlight=pstat)

There are some print/process sessions which use - execute(end.program). In that case the session is already closed before the stpapi.end.session() call.
You can get the process id of the AFS session and check its status using the pstat().

But when you are already executing - stpapi.continue.process() or stpapi.form.command() you dont have to check if the process is completed or not. When its done processing it goes to the next statement.

stpapi.form.command(session.code, 5, "exec.cont.process", error)
error = stpapi.get.mess.code(session.code, error)
if not isspace(error) then
message(error)
endif

avpatil
17th October 2004, 17:46
Hi,
If you don't want to use AFS and all of these sessions are tyep 4 sessions then you can create your own custom session and run all the session from this session. For. e.g. I have custom session that does following
1. Report prouction order complete
2. Back Flush Material
3. Generare O/B for sales order
4. Print Pickiing list
5. Release O/B
6. Print Packing slip
6. Email packing slip (custom made)
7. Print Sales Invoice
8. Record Freight Information

All this logic is in one session. There is a standard Baan IV function load_dll and execute_dll that you can use to call each session.
If these are not type 4 session then you can use AFS or the wiselink product from fullscope. I have found that to be a good product.

Arvind

mr_suleyman
18th October 2004, 10:13
Thank you so much
it will be very usefull for me !