Dashboard > RIFE > ... > Web engine > Autolink declaration to simplify datalink and flowlink declarations
RIFE Log In | Sign Up   View a printable version of the current page.
Autolink declaration to simplify datalink and flowlink declarations


Added by Geert Bevin, last edited by Geert Bevin on Aug 20, 2006
Labels: 
(None)

If you have elements that use the same input and output names, and you want to connect these through datalinks, then the autolink declaration makes this very easy by creating them automatically. It will also create an exit with the name you specified, and add a flowlink to the element that has the same ID as the exit name. You can override the destination element ID by explicitly specifying a destid attribute.

For example:

<element id="Source" implementation="AutolinkSource" url="source">
  <output name="value1"/>
  <output name="value2"/>
  <outbean name="bean1" classname="BeanImpl1"/>
  <autolink srcexit="Destination"/>
</element>
<element id="Destination" implementation="AutolinkDestination" url="destination">
  <input name="value1"/>
  <input name="value2"/>
  <inbean name="bean1"/>
</element>

You can of course also use the @Autolink annotation if you use annotations as your declaration method. It supports an additional destClass attribute that can be used instead of the srcExit attribute. This will lookup the ID of the element that is specified by the class and use this to create the exit and the flowlink.

For example:

@Elem(
  autolinks = {
    @Autolink(destClass = AutolinkAnnotationDestination.class)
  }
)
public class AutolinkAnnotationSource extends Element {
  private String value1;
  private String value2;
  private BeanImpl1 bean1;
   
  @OutputProperty public String getValue1() { return value1; }
  @OutputProperty public String getValue2() { return value2; }
  @OutBeanProperty public BeanImpl1 getBean1() { return bean1;}
   
  public void processElement() {
    // ...
  }
}
 
 
@Elem
public class AutolinkAnnotationDestination extends Element {
  private String value1;
  private String value2;
  private BeanImpl1 bean1;
   
  @InputProperty public void setValue1(String v) { this.value1 = v; }
  @InputProperty public void setValue2(String v) { this.value2 = v; }
  @InBeanProperty public void setBean1(BeanImpl1 b) { this.bean1 = b; }
   
  public void processElement() {
    // ...
  }
}



Are you enjoying Confluence? Please consider purchasing it today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.1a Build:#515 May 19, 2006) - Bug/feature request - Contact Administrators