AnsweredAssumed Answered

Own validator without own export marshaller

Question asked by christianelmer on Jul 27, 2011
Latest reply on Aug 13, 2011 by tiesebarrell

can I write my own validating diagram class without using my own export marshaller? Because I want define rules for the diagrams, but I want use the standard BPMN export marshaller to export the diagrams.

Now my own validator extension only works if I write also an export marshaller with this code:

final boolean validDiagram = invokeValidator(IntellixProcessValidator.VALIDATOR_ID, diagram, monitor);
if (!validDiagram) {
        addProblemToDiagram(diagram, "Marshalling to " + getFormatName()
                + " format was skipped because validation of the diagram failed.", null);
} else {
        InputStream stream = getInputStreamForDiagram(diagram);
        saveResource(getRelativeURIForDiagram(diagram, FILENAME_PATTERN), stream, monitor);

The validateDiagram method of the validator has this code:

public boolean validateDiagram(Diagram diagram, IProgressMonitor monitor) {
        boolean valid = false;

        monitor.beginTask("Activiti Intellix Validation", 1);

        // Check correctness of the diagram

        return valid;

Best regards,