return execute(properties);
}
public T execute(PropertyMap attributes) throws FrameworkException {
GraphDatabaseService graphDb = (GraphDatabaseService) arguments.get("graphDb");
Principal user = securityContext.getUser(false);
T node = null;
if (graphDb != null) {
Date now = new Date();
// Determine node type
PropertyMap properties = new PropertyMap(attributes);
Object typeObject = properties.get(AbstractNode.type);
Class nodeType = typeObject != null ? SchemaHelper.getEntityClassForRawType(typeObject.toString()) : StructrApp.getConfiguration().getFactoryDefinition().getGenericNodeType();
NodeFactory<T> nodeFactory = new NodeFactory<>(securityContext);
boolean isCreation = true;
// Create node with type
node = (T) nodeFactory.instantiateWithType(graphDb.createNode(), nodeType, isCreation);
if(node != null) {
TransactionCommand.nodeCreated(node);
// set type