@Override
protected Command getCreateCommand(CreateRequest request) {
Object newObject = request.getNewObject();
if (newObject instanceof Node) {
NodeCreateCommand createCommand = new NodeCreateCommand();
createCommand.setNode((Node) newObject);
createCommand.setParent((ProcessDefinition) getHost().getModel());
Rectangle newRect = getClosestRectangle((Rectangle) getConstraintFor(request));
createCommand.setConstraint(newRect);
return createCommand;
}
return null;
}