Hi,
But with the tool supporting edition 3 the code segment you have shown before may not work (depending what the "..." contains). When creating an alive PTC e.g. with:
Manager := MyManagerCompType.create alive;
// by the way, using the alive keyword will show you if your tool
// supports this feature or not
and then starting the first behaviour with
Manager.start(ManagerFirstFunc());
you have to wait until ManagerFirstFunc() finishes before starting the second behaviour:
...
Manager.done;
Manager.start(ManagerSecondFunc());
When you try to start ManagerSecondFunc() while ManagerFirstFunc() is still running, your tool is correct to give an error message.
The
Manager.stop;
statement didn't help because either your tool does not support alive PTCs (as Matti pointed out) or you have not created your PTC as an alive-kind one.
BR, Gyorgy
>
Original Message
>From: active_ttcn3 : mts stf133 ttcn version 3 - active
>members only [
This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Vesa-Matti Puro
>Sent: Thursday, 2006 April 06. 07:06 AM
>To:
This email address is being protected from spambots. You need JavaScript enabled to view it.
>Subject: Re: 'component already running': two function on one
>component problem
>
>Hello,
>
>Most TTCN-3 tools use currently edition 2 of TTCN-3. The
>features you were looking for is specified in the edition 3 of
>TTCN-3 standard.
>
>With edition 2 you need to do the following:
>
>...
> Manager.start(ManagerFirstFunc());
>...
>
>and
>
>function ManagerFirstFunc() runs on YourMTC {
>
> ... // behaviour of original ManagerFirstFunc()
>
> // call the second function from the first function
> ManagerSecondFunc();
>}
>
>Edition 2 specifies only possibility to run one function in a
>each test component after it has been created.
>
>Best regards,
>Vesa-Matti
>
>沙安澜 wrote:
>> there is one need for me to run two different functions on
>one component.
>> the code lines just like:
>>
>> Manager.start(ManagerFirstFunc());
>> ...
>> Manager.start(ManagerSecondFunc());
>>
>> but it always prompt: component already running:
>> `component2'(component2' is Component Manager) after I tried like:
>>
>> Manager.start(ManagerFirstFunc());
>> ...
>> Manager.stop;
>> Manager.start(ManagerSecondFunc());
>>
>> it made no help
>> anyone can help me?
>> thanks!
>
>
>Vesa-Matti Puro
>OpenTTCN Oy
>E-mail:
This email address is being protected from spambots. You need JavaScript enabled to view it. * Tel.: +358 440396461 * Web:
>
www.openttcn.com
>