jadex.bdibpmn.examples.helloworld.SayGoodbyeTask Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-bdibpmn Show documentation
Show all versions of jadex-applications-bdibpmn Show documentation
The Jadex BDI-BPMN applications package contain
several example applications, benchmarks and
testcases using BDI agents that have BPMN plans.
package jadex.bdibpmn.examples.helloworld;
import jadex.bdibpmn.BpmnPlanBodyInstance;
import jadex.bpmn.runtime.BpmnInterpreter;
import jadex.bpmn.runtime.ITaskContext;
import jadex.bpmn.runtime.task.AbstractTask;
/**
* Print goodbye on the console and print parameter 'y'.
*/
public class SayGoodbyeTask extends AbstractTask
{
public void doExecute(ITaskContext context, BpmnInterpreter instance)
{
System.out.println("Goodbye BPMN world!");
int y = ((Number)context.getParameterValue("y")).intValue();
System.out.println("Parameter y: "+y);
if(instance instanceof BpmnPlanBodyInstance)
((BpmnPlanBodyInstance)instance).killAgent();
}
}