Closed aliokan closed 7 years ago
now with 0.16.0 is working with XmlReader + Preprocessor to set a unique context name at runtime, like:
var uuid = GUID.uuid();
var uniqueContextName = "context-" + uuid;
var preprocessor = new Preprocessor();
preprocessor.addProperty( "contextName", uniqueContextName );
var source = XmlReader.getXml("configuration/context.xml").toString();
var xml = Xml.parse( preprocessor.parse( source ) );
var contextParser = new ApplicationXMLParser();
contextParser.parse(_applicationAssembler, xml);
<root name="${contextName}">
…
Should add a solution with XmlCompiler.
Support since 0.28.0 : https://github.com/DoclerLabs/hexMachina/releases/tag/0.28.0
var code = StaticFlowCompiler.compile( assembler, "context/flow/dsl.flow" );
code.execute();
var clonedCode = code.clone( new ApplicationAssembler() );
clonedCode.execute();
Assert.isInstanceOf( code.locator.instance, MockClassWithoutArgument );
Assert.isInstanceOf( clonedCode.locator.instance, MockClassWithoutArgument );
Assert.notEquals( code.locator.instance, clonedCode.locator.instance );
We should be able to run app in some kind of sandbox to prevent all conflicts if we run the same application many times in the same HTML page.