-
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 pull request #281 from netgrif/dev
Release/6.4.0
- Loading branch information
Showing
278 changed files
with
9,668 additions
and
2,369 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
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,25 @@ | ||
# Frontend Actions | ||
Frontend actions are type of actions that are executed on frontend. The action implementation is done as part of | ||
frontend code and they can be called from inside data or transition events. | ||
|
||
## Calling an action from process code | ||
|
||
A frontend action is being called from inside events. The syntax is as follows: | ||
``` | ||
Frontend.<action_name>(Object args...) | ||
``` | ||
|
||
Example: | ||
``` | ||
<event type="set"> | ||
<id>data_set_event</id> | ||
<actions phase="post"> | ||
<action id="action_0"> | ||
Frontend.redirect("login") | ||
</action> | ||
</actions> | ||
</event> | ||
``` | ||
|
||
This code is sent to frontend as an attribute of `outcome` object, then frontend parses it | ||
and calls the required action. |
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. |
Oops, something went wrong.