Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Commit

Permalink
Update to version 0.3.7, updating readme with new ArchetypeValidator
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterbos committed Apr 11, 2017
1 parent 8adc025 commit a63676e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In gradle, include this dependency in your build.gradle:

```gradle
dependencies {
compile 'com.nedap.healthcare:archie:0.3.6'
compile 'com.nedap.healthcare:archie:0.3.7'
}
```

Expand All @@ -24,7 +24,7 @@ or if you use maven, in your pom.xml
<dependency>
<groupId>com.nedap.healthcare</groupId>
<artifactId>archie</artifactId>
<version>0.3.6</version>
<version>0.3.7</version>
</dependency>
```

Expand Down Expand Up @@ -72,6 +72,24 @@ CAttribute attribute = archetype.getDefinition()
attribute.getLogicalPath(); // is 'context[systolic]/items'
```

### Archetype Validation

After parsing you can check if you archetype is valid. The parser will try to continue parsing as much as possible without throwing Exceptions. This means you will have to check the errors manually. This happens even with some syntax errors, so checking errors is important!

```
if(!parser.getErrors().hasNoErrors()) {
parser.getErrors().logToLogger();
}
```

The second round of checks comes after parsing, in the form of running the ArchetypeValidator:

```
List<ValidationMessage> messages = new ArchetypeValidator().validate(archetype);
```

This runs some basic checks agains the archetype, such as id-code uniqueness, completeness of translations and existence of constrained properties in the reference model. It does not yet check specialization.

### Serializing

Archetype models can be serialized to ADL thanks the the serializer written by @markopi64. To use:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ apply plugin: 'org.owasp.dependencycheck'

//apply plugin: 'io.codearte.nexus-staging'

version = '0.4.0-SNAPSHOT'
version = '0.3.7'
group = 'com.nedap.healthcare'
archivesBaseName = 'archie'

Expand Down

0 comments on commit a63676e

Please sign in to comment.