07-27-2011 05:15 AM
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);
}
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;
    }
08-09-2011 09:45 AM
 
					
				
		
08-09-2011 01:59 PM
 
					
				
			
			
				
			
			
			
			
			
			
			
		08-10-2011 09:10 AM
 
					
				
		
08-10-2011 02:57 PM
08-11-2011 09:35 AM
addProblemToDiagram(diagram,"[…]",((FlowNode)object).getId());
 
					
				
		
08-11-2011 09:42 AM
08-11-2011 10:17 AM
[…]
public class ProcessValidator extends AbstractProcessValidator {
    […]
    
    public final boolean validateDiagram(final Diagram diagram, final IProgressMonitor monitor) {
        this.diagram = diagram;
        this.monitor = monitor;
        boolean valid = false;
        // Clear markers for this diagram first
        clearMarkers(getResource(diagram.eResource().getURI()));
        monitor.beginTask(VALIDATOR_NAME, 1);
        valid = checkGetJob();
        return valid;
    }
  
    /**
     * Checks if an receive task with the id "getjob" is in front of every end event.
     * 
     * @return The correctness of the diagram.
     */
    private boolean checkGetJob() {
        boolean valid = true;
        final EList<EObject> contents = getResourceForDiagram(diagram).getContents();
        for (final EObject object : contents) {
            if (object instanceof EndEvent) {
                final List<SequenceFlow> incomingFlows = ((EndEvent)object).getIncoming();
                for (SequenceFlow flow : incomingFlows) {
                    if (!flow.getSourceRef().getId().equals("getjob")) {
                        addProblemToDiagram(diagram,
                                "The last task before an EndEvent have to be a receive task with the Id \"getjob\"",
                                ((FlowNode)object).getId());
                        valid = false;
                    }
                }
            }
        }
        monitor.worked(1);
        return valid;
    }
}
 
					
				
		
08-11-2011 10:24 AM
 
					
				
		
08-11-2011 04:06 PM
08-12-2011 04:19 AM
 
					
				
				
			
		
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.