class CaseManagementCanvasHandler extends CanvasHandlerImpl<D, C> {

    public Optional<Element> getDiagramNode() {
        return this.getCanvas().getShapes().stream().map(Shape::getUUID).map(this::getElement)
                .filter(Optional::isPresent).map(Optional::get)
                .filter(n -> ((View) n.getContent()).getDefinition() instanceof CaseManagementDiagram)
                .findAny();
    }

    @Inject public  CaseManagementCanvasHandler(final ClientDefinitionManager clientDefinitionManager,
                                       final RuleManager ruleManager,
                                       final GraphUtils graphUtils,
                                       final GraphIndexBuilder<? extends MutableIndex<Node, Edge>> indexBuilder,
                                       final ShapeManager shapeManager,
                                       final TextPropertyProviderFactory textPropertyProviderFactory,
                                       final Event<CanvasElementAddedEvent> canvasElementAddedEvent,
                                       final Event<CanvasElementRemovedEvent> canvasElementRemovedEvent,
                                       final Event<CanvasElementUpdatedEvent> canvasElementUpdatedEvent,
                                       final Event<CanvasElementsClearEvent> canvasElementsClearEvent,
                                       final @CaseManagementEditor CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory);

}