Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Overriding Validation Through Constraint(Way to figure out to override the BPMN Model Validation.)
Overriding Validation Through Constraint [message #1733594] Mon, 30 May 2016 11:04 Go to next message
Rakesh Kumar Shah is currently offline Rakesh Kumar ShahFriend
Messages: 9
Registered: April 2016
Junior Member
Hi,
I created an extension of the Task and ManualTask using my own model.
I added my customized validation adding the
<extension
point="org.eclipse.emf.validation.constraintProviders">
<category
name="Core Validation Overrides"
id="org.eclipse.bpmn2.modeler.core.validation.category.override"/>
<constraintProvider cache="true">
<package namespaceUri="http://www.omg.org/spec/BPMN/20100524/MODEL-XMI"/>
<constraints categories="com.opentext.bpmn2.modeler.core.validation.category">
<constraint
class="com.opentext.bpmn2.validation.WemValidationConstraint"
id="com.opentext.bpmn2.modeler.core.live.validation.error"
isEnabledByDefault="false"
lang="Java"
mode="Live"
name="Task Element"
severity="ERROR"
statusCode="3">
<message>Test Task Element</message>
<target class="Task" />
</constraint>

<!-- Batch validation constraints -->
<constraint
class="com.opentext.bpmn2.validation.WemValidationConstraint"
id="com.opentext.bpmn2.modeler.core.validation.error"
isEnabledByDefault="true"
lang="Java"
mode="Batch"
name="Base Element"
severity="ERROR"
statusCode="0"
>
<description>Wem Validation on the extension of model.</description>
<message>My Message</message>
<target class="Task"/>
</constraint>
</constraints>
</constraintProvider>
</extension>


I am getting call back in my code for all Task object related validation call. But It is not showing my messages. It shows only BPMN2.0 core model messages. I want to override this behaviour and want to suppress the BPMN2.0 messages.

Following method I override to manage my extension model and hooked up my validator.

protected boolean doValidation(IValidationContext ctx, EObject eObj) {
System.out.println("eObj :"+eObj.getClass().getSimpleName());
String object = getWemType(eObj);
for (String wemType : wemTypes) {
if (object.equals(wemType))
return true;
}
return false;
}


Please let me know if there is a way to override the bpmn core validation.
Re: Overriding Validation Through Constraint [message #1733747 is a reply to message #1733594] Tue, 31 May 2016 11:08 Go to previous message
Rakesh Kumar Shah is currently offline Rakesh Kumar ShahFriend
Messages: 9
Registered: April 2016
Junior Member
OK I found the solution.
<category
name="Core Validation Overrides"
id="com.opentext.bpmn2.modeler.core.validation.category.override"/>
<constraintProvider cache="true">
<package namespaceUri="http://www.omg.org/spec/BPMN/20100524/MODEL-XMI"/>
<constraints categories="org.eclipse.bpmn2.modeler.core.validation.category.override">
<constraint

target class="Task"/>
>
</constraint>

Add Target Class for which you want to over ride the validator.

Thanks
-Rakesh

Previous Topic:Neon M2 build is not available
Next Topic:Help save the BPMN2 Modeler Project from extinction!
Goto Forum:
  


Current Time: Wed May 23 22:59:24 GMT 2018

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

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

Back to the top