@Agent @Goals(@Goal(clazz=StampGoal.class, publish=@Publish(type=IStampService.class))) public class StampBDI { @Plan(trigger=@Trigger(goals=StampGoal.class)) public void stamp(IComponentIdentifier wp, String text) { // transport work piece to stamp and stamp with text System.out.println("Stamped workpiece: "+wp+" with text: "+text); } }
Goal[] goals = getAnnotation(clazz, Goals.class, cl).value(); for(Goal goal: goals)
Goal[] goals = getAnnotation(clazz, Goals.class, cl).value(); for(Goal goal: goals)
@Goals(@Goal(clazz=TranslationGoal.class, publish=@Publish(type=ITranslationService.class, method="translateEnglishGerman"))) public class TranslationBDI
@Goals(@Goal(clazz=TranslationGoal.class, publish=@Publish(type=ITranslationService.class)))//, method="translateEnglishGerman"))) public class TranslationBDI
@Goals(@Goal(clazz=ExternalGoal.class, excludemode=ExcludeMode.Never)) public class ExternalGoalBDI
@Agent @Goals(@Goal(clazz=StampGoal.class)) @RequiredServices(@RequiredService(name="stampser", type=IStampService.class, binding=@Binding(scope=RequiredServiceInfo.SCOPE_PLATFORM))) @Plans(@Plan(trigger=@Trigger(goals=StampGoal.class), body=@Body(service=@ServicePlan(name="stampser")))) public class WorkpieceBDI { @AgentBody public void body(IInternalAccess agent) { agent.getComponentFeature(IBDIAgentFeature.class).dispatchTopLevelGoal(new StampGoal(agent.getComponentIdentifier(), "date: "+System.currentTimeMillis())).get(); } }
@RequiredServices(@RequiredService(name="transser", type=ITranslationService.class, binding=@Binding(scope=RequiredServiceInfo.SCOPE_PLATFORM))) @Goals(@Goal(clazz=TranslationGoal.class)) @Plans(@Plan(trigger=@Trigger(goals=TranslationGoal.class), body=@Body(service=@ServicePlan(name="transser", mapper=TranslationGoalMapper.class))))
@RequiredServices(@RequiredService(name="transser", type=ITranslationService.class, binding=@Binding(scope=RequiredServiceInfo.SCOPE_PLATFORM))) @Goals(@Goal(clazz=TranslationGoal.class)) @Plans(@Plan(trigger=@Trigger(goals=TranslationGoal.class), body=@Body(service=@ServicePlan(name="transser")))) public class UserBDI