// use default node type
nodeTypeName = definition.getDefaultPrimaryType();
}
// validation check are performed by item state manager
// NOTE: uuid is generated while creating new state.
Operation an = AddNode.create(getNodeState(), nodeName, nodeTypeName, null);
session.getSessionItemStateManager().execute(an);
// finally retrieve the new node
List addedStates = ((AddNode) an).getAddedStates();
ItemState nState = (ItemState) addedStates.get(0);