cancel
Showing results for 
Search instead for 
Did you mean: 

Own validator without own export marshaller

christianelmer
Champ in-the-making
Champ in-the-making
Hello,

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;

        clearMarkers(getResource(diagram.eResource().getURI()));
       
        monitor.beginTask("Activiti Intellix Validation", 1);

        // Check correctness of the diagram

        return valid;
    }

Best regards,
Christian
22 REPLIES 22

tiesebarrell
Champ in-the-making
Champ in-the-making
Christian,

I can't see how the location was anything other than unknown in previous versions, because looking at the code it is never set in the marker and that code hasn't been touched for months. Sorry it doesn't work, but we need to figure out how to determine the line the marker should be linked to from the java object in the model.

Are you using a custom service task or a user task? I've noticed that problem myself: it looks like it doesn't "repaint" the task when the problem is added. We should fix that and I believe I already have an issue for doing that.

christianelmer
Champ in-the-making
Champ in-the-making
Hi Tiese,

Are you using a custom service task or a user task?

I'm only use custom service tasks and receive tasks.

By the way, the use of the BPMN2ExportMarshaller in my own ExportMashaller works perfectly. Thanks a lot for this feature.

Greetings,
Christian

tiesebarrell
Champ in-the-making
Champ in-the-making
Hi Christian,

I first came across the problem with custom service tasks myself. There are a couple of improvements lined up for those so I hope we'll be able to get that sorted.

Good to hear it's useful!