Loading...

Scripting in ConnectPlaza

Table of Contents

    Why scripting in ConnectPlaza?

    We build scripting in our environment because we wanted to give the developer a simple tool for building all the components needed. Just like User defined services, but much more simple. Scripting in ConnectPlaza is done in Javascript. A very powerful scripting language with a lot of followers in their community. Javascript is easy to learn and very flexible to use. The advantage over java programming, as user defined services do, is that you do not have to compile the code and to not have to write a bean to add to let it work with the other components. Another advantage is that with the way we implemented the Javascript engine, you have access to all components in our framework. 

    Using scripts, you can develop more rapidly. 

    Which components can we use

    Scripting can be added to a diversity of components. For example:

    • Header enricher
    • Filter
    • Router
    • Nominate
    • Generic consumer / Producer
    • FileNameGenerator
    • Message enricher
    • Aggregator strategies
    • etc......

    These components have the option of scripting. Like the Filter Strategy in the filter component or the Router Strategy Bean or Script Reference in the router producer. 

    What do I need to know 

    First of all you need to know the following:

    • The script fill be executed as part of the component
    • The script will have direct access to ConnectMessage and Properties
    • The script will have direct access the Logging of the interface
    • The script will be able to access all java classes the agent uses

    As you write a script, you have to think about the return type. This return type is defined per component, i.e.:

    • Generic Message expect a ConnectMessage object or an ConnectMessagePart object
    • An Header enricher returns an object which will become a header value
    • A Filter will return a boolean
    • A Router will return a Mapping key of ChannelName

    Adding scripts

    Create a new script with the Scripts option at your business connector. The next screen will open: 

    Write your script and save it. The script will be added to the scripts list.

    Using the scripts

    There are a number of components, as described above, where you can use scripts. You can only use scripts available in the selection box. This can also be Java Beans or other resources. The system knows which resources to put into your selection box. 

    The possibilities

    What can you do with scripting? What are the possibilities? Because you get access to all Java classes within the ConnectAgent and you get access to the message itself, the possibilities are endless. For instance, you can influence the ConnectMessage. You can transform, modify or delete parts. You can influence properties, add or modify dynamic headers based on part content. You can create dynamic filter and router strategies. 

    As you can see, you can do a lot of things with scripting, which could, in the past, only be done by using User defined services created by Java developers. Now you can add them yourself with scripting. 

    Scripting documentation

    You can find the documentation for scripting in the JAVADOC documentation via the URL: https://www.connectplaza.com/doc/java/


    Copyright © 2018 ConnectPlaza.   For pricing, account management and more go to https://www.connectplaza.com

    About Connectplaza

    Si components version:   

    Lorem ipsum delore set

    Lorem ipsum delore set

    Window size is not optimal. Please enlarge for optimal experience

    No connection

    No response from the server. This window will automaticly disappear by an valid connection