IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Is Plugin applicable for Attributes?

  • 1.  Is Plugin applicable for Attributes?

    Posted Fri February 28, 2003 02:04 PM

    Hello,
    I want to use plugin for setting the value of an attribute.
    To do this I add this text to the xapplication.xml
    where Registration is the name of an attribute of my Documents root.

    <action name=“setValue”
    method=“hitit.HPlugin.setRegistration”>
    arg
    variables



    But this doesnt invoke the HPlugin.setRegistration method :frowning:
    Can somebody help me please ?
    Ps : I have also tried as it didnt work either…


    X-Application Version: 3.1.3
    Tamino Version : 3.1.1
    Platform : Win2k
    WebContainer : Tomcat 3.3a
    JDK Version : 1.3.1


    #webMethods
    #API-Management
    #Tamino


  • 2.  RE: Is Plugin applicable for Attributes?

    Posted Mon March 03, 2003 07:20 PM

    Hello,

    I checked the code for the plugins. What I found out is for X-Application 3.1.3:

    - The attribute is wrapped as a BusinessNode.
    - The target context for BusinessNodes is the name of the element the BusinessNode belongs to. This means the target name for the attribute the name of the element it belongs to.

    As a solution for your problem you could try out the following approach that overwrites the standard element action ‘setValue’ for elements

    Within the xapplication.xml add the action setValue with the arguments you need:

      <element>
    <action name="setValue"
    method="...yourSetMethod">
    <arg>arg</arg>
    ...
    </action>
    </element>
    </pre><BR><BR>For your Plugin Code:<BR><pre class="ip-ubbcode-code-pre">
    public static void yourSetMethod(BusinessNode node, String newValue, ...) {
    if (node instanceof AttributeNode) {
    String attrName = ((AttributeNode)node).getName();
    if (attrName.equals("Registration") {
    // invoke your method and pass the arguments to it what ever you need
    return;
    }
    // dispatch other attributes
    }
    // do the normal work for the nodes that are not filtered out 
    StandardElementPlugin.setValue(node, newValue);
    }



    The basic idea of this approach is: use a plugin method to extend the behavior of the dispatcher by your own delegation.

    This is only a proposal and I never tried it out by myself. If you have problems to implement this approach, write a new post and I will have a closer look at it.

    Also for the next version X-Application 4.1.1 we are currently developing we didn’t extend the plugin module to support more target context than workspace, document and element. I didn’t check if the same approach is applicable for this version.

    Bye,
    Christian.


    #API-Management
    #webMethods
    #Tamino