class CaseManagementDrawCommand extends AbstractCanvasCommand {

    @Override
    @SuppressWarnings("unchecked")
    public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) {
        final Diagram diagram = context.getDiagram();
        final String shapeSetId = context.getDiagram().getMetadata().getShapeSetId();

        this.sortNodes(diagram);

        final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder =
                new CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation>().forward();

        childrenTraverseProcessor
                .traverse(diagram.getGraph(),
                          new AbstractChildrenTraverseCallback<Node<View, Edge>, Edge<Child, Node>>() {

                              @Override
                              public void startNodeTraversal(final Node<View, Edge> node) {
                                  super.startNodeTraversal(node);
                                  commandBuilder.addCommand(new AddCanvasNodeCommand((Node) node, shapeSetId));
                              }

                              @Override
                              public boolean startNodeTraversal(final List<Node<View, Edge>> parents,
                                                                final Node<View, Edge> node) {
                                  super.startNodeTraversal(parents, node);

                                  if (isDrawable(parents.get(parents.size() - 1), node)) {
                                      commandBuilder.addCommand(new AddCanvasChildNodeCommand(parents.get(parents.size() - 1),
                                                                                              node,
                                                                                              shapeSetId));
                                  }

                                  return true;
                              }

                              @Override
                              public void endGraphTraversal() {
                                  super.endGraphTraversal();
                              }
                          });

        return executeCommands(context, commandBuilder);
    }

    public  CaseManagementDrawCommand(final ChildrenTraverseProcessor childrenTraverseProcessor);

}