By default, Oracle Endeca Workbench uses an EAC script to update MDEX Engines with new configuration each time the Save Changes button is pressed. With the preview Dgraph deployment approach, the default functionality would update each production Dgraph in addition to the preview Dgraph. There are two ways to override this default behavior.
<script id="EndecaMDEXUpdateScript">
<log-dir>./logs</log-dir>
<provisioned-script-command>
./control/runcommand.bat EndecaMDEXUpdateScript
</provisioned-script-command>
<bean-shell-script>
<![CDATA[
log.info("Applying config to Web Studio preview dgraph.");
// don't filter, apply all rules to preview dgraph
filterInactiveRules = false;
// download MDEX config from Web Studio to
// preview dgraph's input directory
getWsDgraphFiles = new GetWSDgraphFilesUtility(WSDgraph.getAppName(),
WSDgraph.getEacHost(), WSDgraph.getEacPort(),
WSDgraph.isSslEnabled(), WSDgraph.getDataPrefix());
getWsDgraphFiles.init(WSDgraph.getHostId(), ConfigManager.getWsHost(),
ConfigManager.getWsPort(), WSDgraph.getInputDir(),
filterInactiveRules, WSDgraph.getWorkingDir());
getWsDgraphFiles.run();
// trigger config update (and cache flush) in preview dgraph
WSDgraph.callDgraphConfigUpdateUrl();
log.info("Web Studio preview dgraph updated.");
]]>
</bean-shell-script>
</script>
Note that this script has the ID "EndecaMDEXUpdateScript." This is the reserved script name that must be used when provisioning the script, to ensure that Oracle Endeca Workbench recognizes and invokes the script when saving configuration changes. <dgraph id="WSDgraph" host-id="ITLHost" port="1">
<properties>
<property name="restartGroup" value="WebStudio" />
</properties>
<log-dir>./logs/dgraphs/WSDgraph</log-dir>
<input-dir>./data/dgraphs/WSDgraph/dgraph_input</input-dir>
<update-dir>./data/dgraphs/WSDgraph/dgraph_input/updates</update-dir>
<app-config-dir>./data/dgraphs/WSDgraph/dgraph_input</app-config-dir>
</dgraph>
<dgraph-cluster id="DgraphCluster" getDataInParallel="true"> <dgraph ref="WSDgraph" /> <dgraph ref="Dgraph1" /> <dgraph ref="Dgraph2" /> </dgraph-cluster>
<dgraph-defaults>
<properties>
...
<property name="WebStudioSkipConfigUpdate" value="true" />
</properties>
...
</dgraph-defaults>
Note that this property can also be set individually for each Dgraph, rather than in the defaults. Once set, the property must be set to “false” for the WSDgraph, to ensure it is updated by the Oracle Endeca Workbench. In addition, another property, “WebStudioMDEX” should be set on the WSDgraph to indicate to Oracle Endeca Workbench that this is the Dgraph to use when previewing the rules that have been triggered.<dgraph id="WSDgraph" host-id="ITLHost" port="1">
<properties>
<property name="restartGroup" value="WebStudio" />
<property name="WebStudioSkipConfigUpdate" value="false" />
<property name="WebStudioMDEX" value="true" />
</properties>
<log-dir>./logs/dgraphs/WSDgraph</log-dir>
<input-dir>./data/dgraphs/WSDgraph/dgraph_input</input-dir>
<update-dir>./data/dgraphs/WSDgraph/dgraph_input/updates</update-dir>
<app-config-dir>./data/dgraphs/WSDgraph/dgraph_input</app-config-dir>
</dgraph>
For details about these properties, refer to the Oracle Endeca Workbench Administrator's Guide.