Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Sphinx/digests"
< Sphinx
Line 1: | Line 1: | ||
− | =Dynamic workflows= | + | ==Dynamic workflows== |
* Based on MWE2 workflows | * Based on MWE2 workflows | ||
Line 7: | Line 7: | ||
* Execution of binary workflows located in workflow contributor plug-ins | * Execution of binary workflows located in workflow contributor plug-ins | ||
− | + | '''Extras''' | |
* Command line execution | * Command line execution | ||
* Workflow handlers (pre/post run hooks) | * Workflow handlers (pre/post run hooks) | ||
* Support of metamodels without Sphinx integration | * Support of metamodels without Sphinx integration | ||
− | ==How-tos== | + | ===How-tos=== |
− | ===Create a new dyamic/binary workflow=== | + | ====Create a new dyamic/binary workflow==== |
* Create a plug-in project in runtime/development workspace | * Create a plug-in project in runtime/development workspace | ||
* Add a dependency to the '''org.eclipse.sphinx.emf.mwe.dynamic''' plug-in | * Add a dependency to the '''org.eclipse.sphinx.emf.mwe.dynamic''' plug-in | ||
Line 19: | Line 19: | ||
* Create Java or Xtend classes that extend '''AbstractWorkspaceWorkflowComponent''' or '''AbstractModelWorkflowComponent''' | * Create Java or Xtend classes that extend '''AbstractWorkspaceWorkflowComponent''' or '''AbstractModelWorkflowComponent''' | ||
* Add workflow components to workflow | * Add workflow components to workflow | ||
− | ===Contribute a binary workflow=== | + | ====Contribute a binary workflow==== |
* Use '''org.eclipse.sphinx.emf.mwe.dynamic.workflowContributors''' extension point | * Use '''org.eclipse.sphinx.emf.mwe.dynamic.workflowContributors''' extension point | ||
− | ===Run a dynamic or binary workflow interactively=== | + | ====Run a dynamic or binary workflow interactively==== |
* Right-click on workflow file to execute or model file(s)/element(s) to operate on | * Right-click on workflow file to execute or model file(s)/element(s) to operate on | ||
* Select '''Run Workflow > Run...''' | * Select '''Run Workflow > Run...''' | ||
− | ===Run a dynamic or binary workflow from the command line=== | + | ====Run a dynamic or binary workflow from the command line==== |
* Use '''org.eclipse.sphinx.emf.mwe.dynamic.headless.WorkflowRunner''' application | * Use '''org.eclipse.sphinx.emf.mwe.dynamic.headless.WorkflowRunner''' application | ||
* Specify workspace-relative workflow path or qualified workflow class name using '''-workflow''' option | * Specify workspace-relative workflow path or qualified workflow class name using '''-workflow''' option | ||
* Specify absolute/relative model file/element URI using '''-model''' option | * Specify absolute/relative model file/element URI using '''-model''' option | ||
− | ===Create a workflow handler=== | + | ====Create a workflow handler==== |
* Use '''org.eclipse.sphinx.emf.mwe.dynamic.workflowHandlers''' extension point | * Use '''org.eclipse.sphinx.emf.mwe.dynamic.workflowHandlers''' extension point | ||
− | =Check validation= | + | ==Check validation== |
* Lightweight approach to model validation | * Lightweight approach to model validation | ||
Line 41: | Line 41: | ||
* Dedicated '''Check Validation''' view | * Dedicated '''Check Validation''' view | ||
− | + | '''Extras''' | |
* Navigation from '''Check Validation''' view entries to related model element in | * Navigation from '''Check Validation''' view entries to related model element in | ||
** Double-click → associated editor | ** Double-click → associated editor | ||
Line 48: | Line 48: | ||
* Execution of check validations in workflows | * Execution of check validations in workflows | ||
− | ==How-tos== | + | ===How-tos=== |
− | ===Create a new check validator=== | + | ====Create a new check validator==== |
* Create a Java or Xtend class that extends AbstractCheckValidator | * Create a Java or Xtend class that extends AbstractCheckValidator | ||
* Create check method(s) that have | * Create check method(s) that have | ||
Line 56: | Line 56: | ||
* Implement check logic and issue findings using protected '''error()'''/'''warning()'''/'''info()'''/'''issue()''' methods | * Implement check logic and issue findings using protected '''error()'''/'''warning()'''/'''info()'''/'''issue()''' methods | ||
* Contribute check validator using '''org.eclipse.sphinx.emf.check.checkvalidators''' extension point | * Contribute check validator using '''org.eclipse.sphinx.emf.check.checkvalidators''' extension point | ||
− | ===Run a check validation interactively=== | + | ====Run a check validation interactively==== |
* Right-click on model file(s)/element(s) to be checked | * Right-click on model file(s)/element(s) to be checked | ||
* Select '''Validate > Check-based Validation''' | * Select '''Validate > Check-based Validation''' | ||
* View result in '''Check Validation''' view | * View result in '''Check Validation''' view | ||
− | ===Create and use a check catalog=== | + | ====Create and use a check catalog==== |
* Create a copy of /org.eclipse.sphinx.emf.check.catalog/model/samples/Empty.checkcatalog and open it in '''Sample Reflective Ecore Model Editor''' | * Create a copy of /org.eclipse.sphinx.emf.check.catalog/model/samples/Empty.checkcatalog and open it in '''Sample Reflective Ecore Model Editor''' | ||
* Edit '''Catalog''' properties and add '''Category''' and '''Constraint''' children as appropriate | * Edit '''Catalog''' properties and add '''Category''' and '''Constraint''' children as appropriate | ||
Line 68: | Line 68: | ||
* Contribute check catalog and associate it with contributed check validators using '''org.eclipse.sphinx.emf.check.checkvalidators''' extension point | * Contribute check catalog and associate it with contributed check validators using '''org.eclipse.sphinx.emf.check.checkvalidators''' extension point | ||
− | ==Reference information== | + | ===Reference information=== |
− | ===Diagnostic usage=== | + | ====Diagnostic usage==== |
* severity → Constraint severity as per '''error()'''/'''warning()'''/'''info()''' method invocation or check catalog | * severity → Constraint severity as per '''error()'''/'''warning()'''/'''info()''' method invocation or check catalog | ||
* source → Qualified check validator class name | * source → Qualified check validator class name | ||
Line 79: | Line 79: | ||
** optional user-defined data as per '''error()'''/'''warning()'''/'''info()''' method invocation on subsequent positions | ** optional user-defined data as per '''error()'''/'''warning()'''/'''info()''' method invocation on subsequent positions | ||
− | ===Check Problem marker usage=== | + | ====Check Problem marker usage==== |
* EValidator.URI_ATTRIBUTE → URI of affected model object | * EValidator.URI_ATTRIBUTE → URI of affected model object | ||
* IMarker.LOCATION → Name of affected model object class and feature extracted from diagnostic data | * IMarker.LOCATION → Name of affected model object class and feature extracted from diagnostic data | ||
Line 86: | Line 86: | ||
* IMarker.SOURCE_ID → Constraint id or name of underlying check validator class and method extracted from diagnostic data if available or diagnostic source otherwise | * IMarker.SOURCE_ID → Constraint id or name of underlying check validator class and method extracted from diagnostic data if available or diagnostic source otherwise | ||
− | =EMF-IncQuery integration= | + | ==EMF-IncQuery integration== |
* Fast queries on big models | * Fast queries on big models | ||
* Fast index-based resolution of proxy objects representing cross-document references | * Fast index-based resolution of proxy objects representing cross-document references | ||
− | =Model search= | + | ==Model search== |
* Search for model elements with a given name or name pattern | * Search for model elements with a given name or name pattern | ||
Line 97: | Line 97: | ||
* Matches shown in Eclipse '''Search''' view | * Matches shown in Eclipse '''Search''' view | ||
− | + | '''Extras''' | |
* Uses Java-based model search service implementation by default | * Uses Java-based model search service implementation by default | ||
* Can be overridden to use an alternative or EMF-IncQuery-based implementation on a per-metamodel basis | * Can be overridden to use an alternative or EMF-IncQuery-based implementation on a per-metamodel basis | ||
Line 104: | Line 104: | ||
** Show-In menu → '''Model Explorer''', '''Project Explorer''', '''Properties''' view | ** Show-In menu → '''Model Explorer''', '''Project Explorer''', '''Properties''' view | ||
− | ==How-tos== | + | ===How-tos=== |
− | ===Perform a model search=== | + | ====Perform a model search==== |
* Select '''Search > Search... > Model Search''' | * Select '''Search > Search... > Model Search''' | ||
* Enter model element name or name pattern | * Enter model element name or name pattern | ||
* Optionally choose additional search options | * Optionally choose additional search options | ||
* Click on '''Search''' and see matches in '''Search''' view | * Click on '''Search''' and see matches in '''Search''' view | ||
− | ===Contribute a custom search service for a given metamodel=== | + | ====Contribute a custom search service for a given metamodel==== |
* TODO | * TODO |
Revision as of 04:45, 9 July 2015
Dynamic workflows
- Based on MWE2 workflows
- Can be written in Java or Xtend
- Can operate on EMF models (handed in and out via slots)
- Dymamic execution of workflows located in workspace (i.e., within same JVM instance)
- Execution of binary workflows located in workflow contributor plug-ins
Extras
- Command line execution
- Workflow handlers (pre/post run hooks)
- Support of metamodels without Sphinx integration
How-tos
Create a new dyamic/binary workflow
- Create a plug-in project in runtime/development workspace
- Add a dependency to the org.eclipse.sphinx.emf.mwe.dynamic plug-in
- Create a Java or Xtend class that extends WorkspaceWorkflow
- Create Java or Xtend classes that extend AbstractWorkspaceWorkflowComponent or AbstractModelWorkflowComponent
- Add workflow components to workflow
Contribute a binary workflow
- Use org.eclipse.sphinx.emf.mwe.dynamic.workflowContributors extension point
Run a dynamic or binary workflow interactively
- Right-click on workflow file to execute or model file(s)/element(s) to operate on
- Select Run Workflow > Run...
Run a dynamic or binary workflow from the command line
- Use org.eclipse.sphinx.emf.mwe.dynamic.headless.WorkflowRunner application
- Specify workspace-relative workflow path or qualified workflow class name using -workflow option
- Specify absolute/relative model file/element URI using -model option
Create a workflow handler
- Use org.eclipse.sphinx.emf.mwe.dynamic.workflowHandlers extension point
Check validation
- Lightweight approach to model validation
- Based on EMF's EValidator and Diagnostician
- Constraint logic in Java or Xtend classes with @Check annotated methods
- Optional externalization of severities, messages, etc. to EMF-based check catalog
- Organization of checks in categories
- Produces EMF Diagnostics and Eclipse problem markers
- Dedicated Check Validation view
Extras
- Navigation from Check Validation view entries to related model element in
- Double-click → associated editor
- Show-In menu → Model Explorer, Project Explorer, Properties view
- Execution of EMF's intrinsic model integrity constraints (EObjectValidator)
- Execution of check validations in workflows
How-tos
Create a new check validator
- Create a Java or Xtend class that extends AbstractCheckValidator
- Create check method(s) that have
- an @Check annotation
- precisely one parameter through which the model element to be checked can be passed
- Implement check logic and issue findings using protected error()/warning()/info()/issue() methods
- Contribute check validator using org.eclipse.sphinx.emf.check.checkvalidators extension point
Run a check validation interactively
- Right-click on model file(s)/element(s) to be checked
- Select Validate > Check-based Validation
- View result in Check Validation view
Create and use a check catalog
- Create a copy of /org.eclipse.sphinx.emf.check.catalog/model/samples/Empty.checkcatalog and open it in Sample Reflective Ecore Model Editor
- Edit Catalog properties and add Category and Constraint children as appropriate
- Associate check methods in check validators with constraints by adding a constraint field to the check method's @Check annotation that refers to the id of the corresponding constraint in the check catalog
- Optionally restrain applicability of the check method by adding a categories field to @Check annotation that lists only a subset of the categories referenced by corresponding constraint in the check catalog
- Issue check findings using protected issue() method rather than error()/warning()/info() methods
- Contribute check catalog and associate it with contributed check validators using org.eclipse.sphinx.emf.check.checkvalidators extension point
Reference information
Diagnostic usage
- severity → Constraint severity as per error()/warning()/info() method invocation or check catalog
- source → Qualified check validator class name
- code → not used, always 0
- message → Constraint message as per error()/warning()/info() method invocation or check catalog
- data →
- DiagnosticLocation referencing affected model object and feature in first position
- SourceLocation referencing underlying check validator class, check method and constraint id in second position
- optional user-defined data as per error()/warning()/info() method invocation on subsequent positions
Check Problem marker usage
- EValidator.URI_ATTRIBUTE → URI of affected model object
- IMarker.LOCATION → Name of affected model object class and feature extracted from diagnostic data
- IMarker.SEVERITY → Diagnostic severity
- IMarker.MESSAGE → Diagnostic message
- IMarker.SOURCE_ID → Constraint id or name of underlying check validator class and method extracted from diagnostic data if available or diagnostic source otherwise
EMF-IncQuery integration
- Fast queries on big models
- Fast index-based resolution of proxy objects representing cross-document references
Model search
- Search for model elements with a given name or name pattern
- New Model Search tab in Eclipse Search dialog
- Matches shown in Eclipse Search view
Extras
- Uses Java-based model search service implementation by default
- Can be overridden to use an alternative or EMF-IncQuery-based implementation on a per-metamodel basis
- Navigation from Search view entries to related model element in
- Double-click → associated editor
- Show-In menu → Model Explorer, Project Explorer, Properties view
How-tos
Perform a model search
- Select Search > Search... > Model Search
- Enter model element name or name pattern
- Optionally choose additional search options
- Click on Search and see matches in Search view
Contribute a custom search service for a given metamodel
- TODO