Creating a variable provider for use by a REST call
Procedure
-
Create a class that extends com.datasynapse.fabric.broker.userartifact.variable.AbstractVariableProvider and override the methods as needed. For example:
package com.tibco.sf.providers; import java.util.Properties; import com.datasynapse.fabric.broker.userartifact.variable.AbstractVariableProvider; public class My_Var_Provider extends AbstractVariableProvider { private static final long serialVersionUID = 1L; @Override public Properties getVariables() { Properties p = new Properties(); p.setProperty("MyApp/vars/name", "SomeString"); p.setProperty("MyApp/vars/episodic", "true"); p.setProperty("MyApp/vars/Xduration", "60"); return p; } @Override public void destroy() {} @Override public void init() throws Exception {} }
-
Export a JAR from it and save it to the TIBCO Silver Fabric Broker directory:
SILVERFABRIC_HOME/webapps/livecluster/deploy/config/variableProviders
-
Create an XML file with the properties shown in this sample to associate the new class for TIBCO Silver Fabric.
<variableProvider class="com.tibco.sf.providers.My_Var_Provider"> <property name="name" value="Some_PROVIDER_Name"/> <property name="description" value="GV values are in the JAR"/> <property name="enabled" value="true"/> </variableProvider>
The variable provider name used by the REST statement is specified as "name" in the XML file.
Save the XML file in the same directory as the JAR:
SILVERFABRIC_HOME/webapps/livecluster/deploy/config/variableProviders
You can verify what variable providers are ready for use by REST invocation on the TIBCO Silver Fabric Administrator > Admin > Variables page.
Copyright © Cloud Software Group, Inc. All rights reserved.