-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/7.0.0' into NAE-1989
- Loading branch information
Showing
55 changed files
with
1,267 additions
and
399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Resource Loading | ||
|
||
If you want to load resources, which are not included in JAR (for example large files), you can use the resource loader. | ||
ResourceLoader returns an InputStreamResource. You can turn it into an InputStream and load resources from the directory **resource/** in the working directory of the app. | ||
The prefix for ExternalResourceLoader is | ||
|
||
``` | ||
resource: | ||
``` | ||
|
||
For use you can use code like this in your runner: | ||
```java | ||
@Autowired | ||
private ResourceLoader resourceLoader; | ||
|
||
@Value("resource:nameOfFile.txt") | ||
private Resource customResource; | ||
|
||
@Override | ||
void run(String... strings) throws Exception { | ||
loadResources("resource:nameOfFile.txt"); | ||
} | ||
|
||
void loadResources(String resourceUrl) { | ||
var resource = resourceLoader.getResource(resourceUrl); | ||
var txt = new String(resource.getInputStream().readAllBytes()); | ||
System.out.println("File content: " + txt); | ||
} | ||
|
||
void getCustomResource() throws IOException { | ||
var txt = new String(customResource.getInputStream().readAllBytes()); | ||
System.out.println("Resource from property: " + txt); | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Shared roles | ||
Shared roles or global roles are roles that are only created once and can be used and referenced across Petri nets. | ||
To use a shared role in Petri nets first we must declare it. We can declare it as any other role with addition of ``global`` | ||
attribute set to ``true``: | ||
```xml | ||
<document xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' | ||
xsi:noNamespaceSchemaLocation='https://petriflow.com/petriflow.schema.xsd'> | ||
<id>nae_1927</id> | ||
... | ||
<role global="true"> | ||
<id>admin_global</id> | ||
<title>Global Administrator</title> | ||
</role> | ||
... | ||
</document> | ||
``` | ||
Then we can reference it as usual: | ||
```xml | ||
... | ||
<transition> | ||
<id>t1</id> | ||
<x>460</x> | ||
<y>180</y> | ||
<label>Global roles</label> | ||
<roleRef> | ||
<id>admin_global</id> | ||
<logic> | ||
<view>true</view> | ||
<perform>true</perform> | ||
</logic> | ||
</roleRef> | ||
</transition> | ||
... | ||
``` | ||
When importing a Petri net, the importer checks, whether the global role has already existed. | ||
If not, the importer creates one. If there has been already one, the importer passes it to a the newly created net. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.