Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Validation only FAST and NORMAL
Validation only FAST and NORMAL [message #1827026] Wed, 06 May 2020 09:02 Go to next message
Martin Jedlicka is currently offline Martin JedlickaFriend
Messages: 122
Registered: January 2016
Senior Member
Hi,

I have a question about validations in Sirius. I need that EXPENSIVE type validations are not validated (ie only NORMAL and FAST).

In xtext, this is done simply with CheckMode:
ValidationJob validationJob = new ValidationJob(resourceValidator, xtextDocument, issueProcessor, CheckMode.NORMAL_AND_FAST);


But I don't know how to do it in Sirius. I call validation:
ValidateAction.runValidation(((IDiagramWorkbenchPart) this).getDiagramEditPart(), this.getDiagram());


Thanks for any advice.

Martin
Re: Validation only FAST and NORMAL [message #1827107 is a reply to message #1827026] Thu, 07 May 2020 09:33 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 703
Registered: July 2009
Senior Member
Hi Martin,

I believe CheckMode is an Xtext-specific concept, and we do not provide an equivalent in Sirius.

I am not familiar enough with that part of Xtext to say how this could be supported. Sirius relies on EMF Validation to invoke the validation rules, and gets an IBatchValidator by calling

ModelValidationService.getInstance().newValidator(EvaluationMode.BATCH)


This is hard-coded at the moment, but if Xtext integrates with EMF Validation, maybe we could offer a variant of ValidateAction.runValidation(View) where you could provide one from Xtext with the proper CheckMode?

Regards,
Pierre-Charles


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Validation only FAST and NORMAL [message #1853874 is a reply to message #1827107] Wed, 20 July 2022 15:53 Go to previous message
Tim Duncan is currently offline Tim DuncanFriend
Messages: 21
Registered: November 2021
Junior Member
Hi Pierre,
I used IBatchValidator you mentioned to validate model and successfully got the IStatus,
Would you please give more guidance on how to deal with markers? My current code has problems: 1. error item(please see the image) is not removed after fix model and re-validate; 2. location is unknown so it can not positioning element in diagram; 3. there is no markers in diagram.
Thanks a lot!

IStatus status = validator.validate(dNode);
MarkerUtil.createMarkers(status);
MarkerUtil.updateMarkers(status);



index.php/fa/42327/0/
  • Attachment: 123.PNG
    (Size: 6.04KB, Downloaded 173 times)

[Updated on: Wed, 20 July 2022 22:51]

Report message to a moderator

Previous Topic:Validating all diagrams in a session
Next Topic:Is it possible to add a java extension in odesign model (for Property Value Description)?
Goto Forum:
  


Current Time: Mon May 20 14:59:58 GMT 2024

Powered by FUDForum. Page generated in 0.04032 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top