// allocate
services.getVariableService().allocateVariableState(createDesc.getVariableName(), VariableService.NOCONTEXT_AGENTINSTANCEID, statementContext.getExtensionServicesContext());
final CreateVariableView createView = new CreateVariableView(statementContext.getStatementId(), services.getEventAdapterService(), services.getVariableService(), createDesc.getVariableName(), statementContext.getStatementResultService());
services.getVariableService().registerCallback(createDesc.getVariableName(), 0, createView);
statementContext.getStatementStopService().addSubscriber(new StatementStopCallback() {
public void statementStopped()
{
services.getVariableService().unregisterCallback(createDesc.getVariableName(), 0, createView);
}
});