// add the environment block context
WireContext blockContext = new WireContext(blockWireDefinition, DefaultEnvironment.CONTEXTNAME_BLOCK, environment, true);
// add the environment block context to the environment
environment.addContext(blockContext);
// finish the creation of the environment wire context
blockContext.create();
// fire an open environment event
applicationWireContext.fire(DefaultEnvironment.EVENT_OPENENVIRONMENT, environment);
// if all went well, only then push the created environment