Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ export default withMermaid({
text: "Overview",
link: "/examples/",
},
{
text: "DSL",
link: "/examples/dsl",
},
],
},
],
Expand Down
30 changes: 30 additions & 0 deletions docs/examples/dsl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# DSL Examples
## Modelling simple flow rules
Modelling a constraint matching flows from an originating node that has data properties A to a vertex with vertex properties B:
```
data A neverFlows vertex B
```

::: tip Examples
Sensitive Data never flows to a server outside of the EU:
```
data Type.Sensitive neverFlows vertex Location.nonEU
```

Internal Data never flows to the user:
```
data Type.Internal neverFlows vertex Role.User
```
:::

## Modelling Access Control
Modelling a constraint matching access control rules for RequiredRoles and AssignedRoles:
```
data AssignedRoles.$Assigned
neverFlows
vertex RequiredRoles.$Required
where
present $Assigned
present $Required
empty intersection($Assigned,$Required)
```
65 changes: 65 additions & 0 deletions docs/wiki/development/converter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Converter
In Addition to the analysis, a Converter can be used to convert between several different existing models to models that can be used in our analysis.
See the table below for all currently supported conversion.
Keep in mind that these conversions can be chained, e.g. PCM->DFD->WebDFD.

| Model | Description | Possible Conversion Targets |
| --------------- | --------------- | --------------- |
| DFD | The [Data Flow Diagram Model](/wiki/dfd/) developed for the analysis | WebDFD |
| PCM | The [Palladio Component Model](/wiki/pcm/)| DFD |
| WebDFD | The representation of [Data Flow Diagrams](/wiki/dfd/) for the WebEditor | DFD |
| MicroSecEnd | A model developed by TU Hamburg | DFD |
| PlantUML | A representation of UMl | MicroSecEnd |

## Usage
### 1. Creating a Converter Model
First, you will need to create a converter model for the origin model of your choice.
They follow the follwing naming scheme `<Model>ConverterModel` where `<Model>` denotes the name of the origin model.
As some Converter Model can be created from already loaded objects or from file paths, refer to the different constructors of the origin model for more information.

### 2a Determine the converter automatically
The `ConversionTable` class contains the different conversions that are supported.
First, create a new instance of the class, then use the `getConverter()` method.

As a Parameter you will need to provide a `ConversionKey` that denotes the desired origin and destination of your conversion.
A `ConversionKey` can be created with the static `of()` method with first the source `ModelType` and then the destination `ModelType`.

This will result in the following code, assuming `origin` holds the `ModelType` of the origin model and `destination` holds the `ModelType` of the destination model:
```java
ConversionTable conversionTable = new ConversionTable();
Converter converter = conversionTable.getConverter(ConversionKey.of(origin, destination);
```

### 2b Creating the converter directly
If you want to use the converters directly, you can also create a instance of the converter instead.
They follow this naming scheme `<Origin>2<Destination>Converter` while `<Origin>` and `<Destination>` are the abbriviated names of the desired models

### 3. Running the conversion
Each converter has a method `convert()` that takes a converter model and converts it.
The resulting model is returned as another instance of an `ConverterModel`

### Optional: 4. Saving the result
If desired the resulting model can be saved using the `save()` method all (persistable) converter model have.
For that the first parameter contains the relative or absolute path to the folder the model should be saved in.
The file name is specified by the second parameter.

## Examples
### PCM2DFD
The following example converts a pcm model in the current working directory named `input` to a data flow diagram model with the name `output` and saves it in the current working directory.
```java
PCMConverterModel input = new PCMConverterModel("input.usagemodel", "input.allocation", "input.nodecharacteristics");
ConversionTable conversionTable = new ConversionTable();
Converter converter = converterTable.getConverter(ConversionKey.of(ModelType.PCM, ModelType.DFD));
PersistableConverterModel output = converter.convert(input);
output.save(".", "output");
```

### DFD2Web
The following example converts a dfd model in the current working directory named `input` to a WebDFD json file named `output`:
```java
DataFlowDiagramAndDictionary input = new DataFlowDiagramAndDictionary("input.dataflowdiagram", "input.datadictionary");
ConversionTable conversionTable = new ConversionTable();
Converter converter = converterTable.getConverter(ConversionKey.of(ModelType.DFD, ModelType.WebDFD));
PersistableConverterModel output = converter.convert(input);
output.save(".", "output");
```
2 changes: 2 additions & 0 deletions docs/wiki/dsl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ They commonly consist of two parts:
A set of *source selectors* and a set of *destination selectors*.
Additionally, one can define some relationships between the two selectors using *conditional selectors*.

For examples, see the [DSL Examples](/examples/dsl).

## Source Selectors
A **source selector** describes the origin of a data flow through the system.
It can select nodes based on their node label or data labels flowing into the node.
Expand Down
8 changes: 6 additions & 2 deletions docs/wiki/tooling.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# xDECAF Tooling
The xDECAF data flow diagram analysis constraint framework provides several frameworks to interact with the analysis:

Our [Online Editor](/wiki/onlineeditor/) that allows for modelling [Data Flow Diagrams](/wiki/dfd/) online and provides functionality to analyze them as well.
The [Online Editor](/wiki/onlineeditor/) that allows for modelling [Data Flow Diagrams](/wiki/dfd/) online and provides functionality to analyze them as well.

Our [Command Line Interface](/wiki/cli/) that allows you to run the analysis within an binary locally.
The [Command Line Interface](/wiki/cli/) that allows you to run the analysis within an binary locally.

Or the [analysis frameworks](/wiki/development/running-locally) for both [Data Flow Diagrams](/wiki/dfd/) and the [Palladio Component Model](/wiki/pcm/)

Lastly, the provided [Converter](/wiki/development/converter) allows for conversions between several models and allows using more models for the analysis.