Menu

Composite components

Help
jobi23
2017-09-03
2017-09-03
  • jobi23

    jobi23 - 2017-09-03
     

    Last edit: jobi23 2017-09-05
  • jobi23

    jobi23 - 2017-09-05

    Hey,

    basically i just want to know how to create subcomponents.

    @Agent
    @ComponentTypes(@ComponentType(name="ChildAgent", filename=".../ChildAgent.class"))
    public class ParentAgent {
    // how can i create the subcomponent micro agent ChildAgent ??
    }
    
    @Agent
    public class ChildAgent{
    
    }
    

    jadex.micro.annotation
    Annotation Type ComponentTypes
    https://download.actoron.com/docs/releases/latest/javadoc/ :

    Define component types that can be instantiated as subcomponents of the declaring component. This components can be instantiated either by referring to in a Binding annotation.

    Can someone help me please?

    Thank you

    jobi

     

    Last edit: jobi23 2017-09-05
  • jobi23

    jobi23 - 2017-09-05

    Hey,

    i solved my problem.
    I uploaded the solution.
    The parentcomponent needs a configuration.
    In the configuration you can select the component by its type.
    The type of the subcomponent must be defined in the ComponentTypes annotation.

    Jadex Control Center: Applications -> Parent -> Child you can see that it worked :)

    jobi

     

    Last edit: jobi23 2017-09-05
  • jobi23

    jobi23 - 2017-09-05

    Hey,

    i extended my solution.
    Now you can perform a subcomponent service-search (scope = SCOPE_COMPONENT).
    The subcomponent only provides the service to its parent (scope = SCOPE_PARENT)
    Maybe it's useful for someone :)

    jobi

     
  • Lars Braubach

    Lars Braubach - 2017-09-06

    Hi Jobi,

    thank for posting your answer.

    You can also create subcomponents by just stating the parent component id in the creation info object that can be passed as parameter to the createComponent() method of the component management system.

    Best
    Lars

     

Log in to post a comment.

MongoDB Logo MongoDB