Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [ECP] org.eclipse.emf.ecp.validation causes hang while making modification to ECPProject
[ECP] org.eclipse.emf.ecp.validation causes hang while making modification to ECPProject [message #1419507] Mon, 08 September 2014 18:20 Go to next message
Pouya Bozorgmehr is currently offline Pouya BozorgmehrFriend
Messages: 10
Registered: June 2014
Junior Member
HI,

I have some model instances in ECP project when I modify them, it causes a hang inside org.eclipse.emf.ecp.validation module in validate method:

Two questions:
1.what is this validation module doing and why?
2. Any ideas on why it would hang?

Some info on the model:
it has about 70-200k sub items there are some circular references.

	public IValidationService getValidationService(final Object validationServiceObject) {
		if (!mapping.containsKey(validationServiceObject)) {
			IValidationService validationService = new ValidationService(new IExcludedObjectsCallback() {
				
				public boolean isExcluded(Object object) {
					if(InternalProject.class.isInstance(validationServiceObject)){
						return ((InternalProject)validationServiceObject).isModelRoot(object);
					}
					return false;
				}
			});
			mapping.put(validationServiceObject, validationService);
			if (validationServiceObject instanceof ECPProject) {
				ECPProject project = (ECPProject) validationServiceObject;
				validationService.[b]validate[/b](getAllChildEObjects(project));
			}
			return validationService;
		}
		
		return mapping.get(validationServiceObject);
	}


Which then calls update
	/**
	 * Updates the cached entry for the given {@link EObject} with the given value.<br/>
	 * If the cached entry does not yet exist, it will be created.
	 * 
	 * @param eObject
	 *            the {@link EObject}
	 * @param value
	 *            the value associated with the {@link EObject}
	 * @return set of affected eobjects
	 */
	public Set<EObject> update(EObject eObject, T value) {

		if (excludedCallback.isExcluded(eObject)) {
			return Collections.emptySet();
		}

		final CachedTreeNode<T> node = createNodeIfNecessary(eObject, value);
		node.setOwnValue(value);

		updateNodeObject(eObject);

		rootValue.putIntoCache(eObject, node.getOwnValue());

		final Set<EObject> affectedElements = removeOutdatedParentCacheIfNeeded(eObject);
		// propagate upwards
		EObject parent = eObject.eContainer();

		while (parent != null && !excludedCallback.isExcluded(parent)) {// !isExcludedType(excludedTypes,
																		// parent.getClass())
			updateParentNode(parent, eObject, nodes.get(eObject).getDisplayValue());
			eObject = parent;
			parent = parent.eContainer();
			affectedElements.add(eObject);
		}
		return affectedElements;
	}


My guess the while condition becomes an infinite loop.

Thanks,

Pouya

[Updated on: Mon, 08 September 2014 20:58]

Report message to a moderator

Re: [ECP] org.eclipse.emf.ecp.validation causes hang while making modification to ECPProject [message #1420059 is a reply to message #1419507] Tue, 09 September 2014 12:58 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi Pouya,

this component does the live validation in the tree view (model
explorer) shown as a decoration. If you do not need this live
validation, you can remove the bundle from your run configuration and
you should be fine.
Can you provide a test case to reproduce this behavior and report it as
a BR?

Best Regards

Jonas

Am 08.09.2014 20:20, schrieb Pouya Bozorgmehr:
> HI,
>
> I have some model instances in ECP project when I modify them, it causes
> a hang inside org.eclipse.emf.ecp.validation module in validate method:
>
> Two questions:
> 1.what is this validation module doing and why?
> 2. Any ideas on why it would hang?
>
> Some info on the model:
> it has about 70-200k sub items there are some circular references.
>
> public IValidationService getValidationService(final Object
> validationServiceObject) {
> if (!mapping.containsKey(validationServiceObject)) {
> IValidationService validationService = new
> ValidationService(new IExcludedObjectsCallback() {
>
> public boolean isExcluded(Object object) {
>
> if(InternalProject.class.isInstance(validationServiceObject)){
> return
> ((InternalProject)validationServiceObject).isModelRoot(object);
> }
> return false;
> }
> });
> mapping.put(validationServiceObject, validationService);
> if (validationServiceObject instanceof ECPProject) {
> ECPProject project = (ECPProject) validationServiceObject;
> validationService.validate(getAllChildEObjects(project));
> }
> return validationService;
> }
>
> return mapping.get(validationServiceObject);
> }
>
> Thanks,
>
> Pouya
Re: [ECP] org.eclipse.emf.ecp.validation causes hang while making modification to ECPProject [message #1421119 is a reply to message #1420059] Thu, 11 September 2014 00:30 Go to previous messageGo to next message
Roza Ghamari is currently offline Roza GhamariFriend
Messages: 82
Registered: January 2013
Member
Hi Jonas,

Is it possible to turn this validation off for specific projects or models? Do we have any control on running the validation?
Also, is we disable the validation does it mean the model explorer wouldn't show the * sign next to the modified projects?
I would like to know what would be the consequence of disabling the validation.

Thanks,
Roza
Re: [ECP] org.eclipse.emf.ecp.validation causes hang while making modification to ECPProject [message #1421321 is a reply to message #1421119] Thu, 11 September 2014 07:57 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

there is currently no way to turn the validation on and off in the UI
(would be quite simple to implement). If you disable the validation,
there will be no validation markers in the model explorer anymore. The *
sign is added by EMFStore, so it will still be there.

Best Regards

Jonas

Am 11.09.2014 02:30, schrieb Roza Ghamari:
> Hi Jonas,
>
> Is it possible to turn this validation off for specific projects or
> models? Do we have any control on running the validation? Also, is we
> disable the validation does it mean the model explorer wouldn't show the
> * sign next to the modified projects? I would like to know what would be
> the consequence of disabling the validation.
>
> Thanks,
> Roza
>
Previous Topic:Call for Submissions: Modeling Symposium ECE 2014
Next Topic:[Edapt] Handling evolution of metamodel with mutliple packages
Goto Forum:
  


Current Time: Thu Apr 02 13:27:26 GMT 2020

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

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

Back to the top