32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
<snippet>
|
|
<subclass>afryca.ase.Snippet</subclass>
|
|
<file></file>
|
|
<category>ASE-API</category>
|
|
<name>Execute module binding example</name>
|
|
<description></description>
|
|
<code>
|
|
var moduleBindingName = 'Consistency';
|
|
var moduleBinding = ase.getModuleBindingByName(moduleBindingName);
|
|
var moduleBindingFile = moduleBinding.getFile();
|
|
var state = ase.getModuleBindingStates().get(moduleBindingFile);
|
|
var bindings = moduleBinding.getBindings();
|
|
|
|
var result = bindings.toString();
|
|
if (state) {
|
|
result += ' -> [' + gdmp.getSimpleName() + ']\n';
|
|
var execution = ase.executeModuleBinding(moduleBindingName);
|
|
var moduleName = moduleBinding.getModule();
|
|
var module = ase.getModuleByName(moduleName);
|
|
var functions = ase.getModuleFunctions(moduleName);
|
|
for (var i = 0; i < functions.length; i++) {
|
|
result += functions[i] + ': ' + execution.get(functions[i]).get().getResult() + '\n';
|
|
}
|
|
result += 'Execution class: ' + execution.class.getName() + '\n';
|
|
result += 'Execution element class: ' + execution.get(functions[0]).class.getName();
|
|
} else {
|
|
result += ' -> [' + gdmp + ']\n';
|
|
result += 'None of the bindings can be null';
|
|
}
|
|
result;
|
|
</code>
|
|
</snippet> |