Create Scenario Instance after Event

Hi at all,

i’ve created a scenario (.sdf) with the Event Modeler. I would like to start one scenario instance automatically.

I’ve tried this with the Scenario Service Bundle. An incoming JMS message (JMS Adapter) from Integration Server is succesfully translated to an event. In a monitor file i log this event and want to create a scenario instance.

But it doesnt work. Whats wrong?

My monitor File:

package com.yyy.xxx;

using com.apama.scenario.Created;
using com.apama.scenario.Create;
using com.apama.scenario.Scenario;

monitor KairosSimulation {
com.apama.correlator.jms.JMS jms;
Scenario Sim;
string scenarioServiceChannel := “com.apama.scenario”;

action onload() {
	jms.onApplicationInitialized();
	log("KAIROS ---- Monitor initialized");
	simulationListener();
	startSimulationScenario();
		
}

action simulationListener{
	StartSimulation simstart;
	StopSimulation simstop;
	on all StartSimulation():simstart {
		log ("KAIROS ---- Start simulation event incoming: " + simstart.getFieldValues().toString());
	}
	
	on all StopSimulation():simstop {
		log ("KAIROS ---- Stop simulation event incoming: " + simstop.getFieldValues().toString());
	}
}

action startSimulationScenario{
	StartSimulation sim;
	on all StartSimulation():sim {
		log ("KAIROS ---- start Simulation Scenario: "+sim.id +" Simulation Time: "+ sim.simulationTime);

		[b]send Create("KairosSimulationScenario",1001,"remote",[sim.id,sim.simulationTime]) to scenarioServiceChannel;[/b]
	}
	
	Created sc;
	on all Created():sc {
		log ("KAIROS ---- Created Simulation Scenario Instance ID: " + sc.scenarioInstanceId.toString());
	}
	
}

}

Hi Alexander,
Firstly, please note that Scenario instance creation is currently only officially supported via the Java client API’s.

However, we do know that some customers use the EPL event definitions to create instances from within other EPL actions as you are attempting.
The channel com.apama.scenario is the name of one of the channels used for outgoing events from the correlator to an external client. You might want to instead send your creation event to the default channel.

Kev


In order to aid other members of the community assisting with a question please state product version and OS with questions.
This is a community forum and responses from Software AG teams is not guaranteed.
Any customer paying maintenance is also entitled to formal support (details via the Empower web site), or may purchase consulting services.

Wow Kevin,

thank you for the quick answer!

Now I send it to default channel (“”) an get this: … KairosSimulationScenario: Scenario create ignored - unknown scenarioId.

How can i get the scenarioId? In the Scenario Browser I only see the “name” of my scenario.

Attach an engine_receive and create an instance via the ScenarioBrowser. Should show you what you need. But as I said be conscious that it is not currently a supported mechanism and therefore is allowed to change behind the supported client API.

K.


In order to aid other members of the community assisting with a question please state product version and OS with questions.
This is a community forum and responses from Software AG teams is not guaranteed.
Any customer paying maintenance is also entitled to formal support (details via the Empower web site), or may purchase consulting services.

Thank you Kevin!

I’ll also try to create an instance via IS-Java Service (and the API). Then I’LL have a supported constellation.

Regards

Alex Enns