Loading...

Scripting - Custom development

Table of Contents

    Using script in custom developement

    When using scripting in other objects (user defined objects), you can not only use java scripts, you can also use Groovy, Ruby or JPython, if you like. You can use inline scripts and script saved on your file system. 

    Scripts always start with the  <myesb:script> tag. Selecting the language can be done vai the attribute lang=

    <!-- javascript on file system -->
    <myesb:script 
    id="testjavascript" 
    lang="javascript"
    location="file:/temp/testjavascript.js"
    refresh-check-delay="2000"
    />

    You can also add variables to the script. You do that, by adding a placeholder into the script, like this: <myesb:scriptvar name=”foo” value=”${placeholder}”/>

    <!-- inline groovy script will replace &gt; and &lt; and add a property via a scriptvar -->
    <myesb:script lang="groovy" id="testscript1" messagepart="msgprt0">
    
    <myesb:scriptvar name="scriptvar1" value="Hello from inline groovy script via scriptvar"/>
    
    <![CDATA[
    properties.put("ScriptProperty",scriptvar1);
    return 
    msgprt.getContent().replace("<","&lt;").replace(">","&gt;");
    ]]>
    
    </myesb:script>

    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