How to Configure Scenario
This is an example on how to configure scenario script engine in the default Apis instance.
1. Create a scenario file as shown below and save it to the file ’MyScnBee.scn’ in folder '[Apis_INSTALLDIR]\Config\ApisHive'.
MAP Error = #Worker.Error#
MAP ErrorText = #Worker.ErrorText#
MAP PulseInterval_in = #Worker.Pulse.Interval#
MAP RampInterval_in = #Worker.Ramp.Interval#
START #Worker.Start#
Counter = 0
#Worker.Start# = 0
#Worker.Cond1# = 0
#Worker.Cond1.Result# = 0
#Worker.Cond1.Status# = "Initialized"
#Worker.Cond2# = 0
#Worker.Cond2.Result# = 0
#Worker.Cond2.Status# = "Initialized"
#Worker.Cond3# = 0
#Worker.Cond3.Result# = 0
#Worker.Cond3.Status# = "Initialized"
#Worker.Cond4# = 0
#Worker.Cond4.Result# = 0
#Worker.Cond4.Status# = "Initialized"
#Worker.End# = 0
#Worker.End.Status# = "Initialized"
WHILE 1
Counter = Counter + 1
#Worker.Execution.Status# = "Executed at counter " + #Worker.Counter#
#Worker.Execution.Status# = #Worker.Execution.Status# + " and internal counter " + Counter
WHEN #Worker.Cond1#
#Worker.Cond1# = 0
#Worker.Cond1.Status# = "Executed at counter " + #Worker.Counter#
#Worker.Cond1.Result# = sin(Counter)+4
WHILE #Worker.Cond2#
#Worker.Cond2# = 0
#Worker.Cond2.Status# = "Executed at counter " + #Worker.Counter#
#Worker.Cond2.Result# = max( sin(Counter), cos(Counter))
WHILE #Worker.Cond3#
//#Worker.Cond3# = 0 --> If the condition becomes false the RAMP will stop calculating.
#Worker.Cond3.Status# = "Executed at counter " + #Worker.Counter#
RAMP #Worker.Cond3.Result# 30 40 RampInterval_in
WHEN #Worker.Cond4#
//#Worker.Cond4# = 0 --> If the condition becomes false the PULSE will stop calculating.
#Worker.Cond4.Status# = "Executed at counter " + #Worker.Counter#
PULSE #Worker.Cond4.Result# 30 40 PulseInterval_in
END #Worker.End#
#Worker.End# = 0
#Worker.End.Status# = "You have reach" + " the end"
#Worker.Cond1.Status# = "Stoped"
#Worker.Cond2.Status# = "Stoped"
#Worker.Cond3.Status# = "Stoped"
#Worker.Cond4.Status# = "Stoped"
2. Add the Worker Bee and create the following items
3. Add the ScenarioBee and set the property
4. Press "Apply".
5. To execute one of the actions, toggle the condition items.