Title: | Support for BPMN (Business Process Management Notation) Models |
---|---|
Description: | Creating, rendering and writing BPMN diagrams <https://www.bpmn.org/>. Functionalities can be used to visualize and export BPMN diagrams created using the 'pm4py' and 'bupaRminer' packages. Part of the 'bupaR' ecosystem. |
Authors: | Alessio Nigro [aut], Gert Janssenswillen [cre], Ivan Esin [ctb], Hasselt University [cph] |
Maintainer: | Gert Janssenswillen <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1 |
Built: | 2024-11-07 03:27:17 UTC |
Source: | https://github.com/cran/bpmnR |
Support for BPMN models
Maintainer: Gert Janssenswillen [email protected]
Authors:
Alessio Nigro [email protected]
Other contributors:
Ivan Esin [contributor]
Hasselt University [copyright holder]
Control Flow Complexity (CFC) ——————————————-
calculate_CFC(bpmn)
calculate_CFC(bpmn)
bpmn |
bpmn-object. |
Control-Flow-Complexity. Numeric vector of length 1
library(dplyr) nodes <- tibble(id = "task", name = "Task name", objectType = "task", gatewayDirection = NA) events <- tibble(id = c("start","end"), name = c("Start event","End event"), objectType = c("startEvent","endEvent")) flows <- tibble(id = c("flow1","flow2"), name = c("flow1","flow2"), sourceRef = c("start","task"), targetRef = c("task","end"), objectType = c("sequenceFlow","sequenceFlow")) model <- create_bpmn(nodes, flows, events) calculate_CFC(model)
library(dplyr) nodes <- tibble(id = "task", name = "Task name", objectType = "task", gatewayDirection = NA) events <- tibble(id = c("start","end"), name = c("Start event","End event"), objectType = c("startEvent","endEvent")) flows <- tibble(id = c("flow1","flow2"), name = c("flow1","flow2"), sourceRef = c("start","task"), targetRef = c("task","end"), objectType = c("sequenceFlow","sequenceFlow")) model <- create_bpmn(nodes, flows, events) calculate_CFC(model)
This creates a BPMN object by specifying a set of tasks, sequence flows, gateways, and a start and end event.
create_bpmn(nodes, flows, events)
create_bpmn(nodes, flows, events)
nodes |
A data.frame of all nodes, with minimal columns id, name, objectType, gatewayDirection |
flows |
A data.frame of all flows, with minimal columns id, sourceRef, targetRef and objectType |
events |
A data.frame of all events, with minimal columns id, name, objectType |
A BPMN object as a list of data.frames for the BPMN elements and an XML document for the XML-based interchange format for the BPMN process.
Alessio Nigro
library(dplyr) nodes <- tibble(id = "task", name = "Task name", objectType = "task", gatewayDirection = NA) events <- tibble(id = c("start","end"), name = c("Start event","End event"), objectType = c("startEvent","endEvent")) flows <- tibble(id = c("flow1","flow2"), name = c("flow1","flow2"), sourceRef = c("start","task"), targetRef = c("task","end"), objectType = c("sequenceFlow","sequenceFlow")) create_bpmn(nodes, flows, events)
library(dplyr) nodes <- tibble(id = "task", name = "Task name", objectType = "task", gatewayDirection = NA) events <- tibble(id = c("start","end"), name = c("Start event","End event"), objectType = c("startEvent","endEvent")) flows <- tibble(id = c("flow1","flow2"), name = c("flow1","flow2"), sourceRef = c("start","task"), targetRef = c("task","end"), objectType = c("sequenceFlow","sequenceFlow")) create_bpmn(nodes, flows, events)
This creates an XML document based on a BPMN object.
create_xml(bpmn, ...) ## S3 method for class 'bpmn' create_xml(bpmn, ...)
create_xml(bpmn, ...) ## S3 method for class 'bpmn' create_xml(bpmn, ...)
bpmn |
A BPMN object as a list of data.frames for the BPMN elements. |
... |
Additional arguments passed to methods. |
An XML document for the XML-based interchange format for the BPMN process.
create_xml(bpmn)
: Create xml
Alessio Nigro
library(dplyr) nodes <- tibble(id = "task", name = "Task name", objectType = "task", gatewayDirection = NA) events <- tibble(id = c("start","end"), name = c("Start event","End event"), objectType = c("startEvent","endEvent")) flows <- tibble(id = c("flow1","flow2"), name = c("flow1","flow2"), sourceRef = c("start","task"), targetRef = c("task","end"), objectType = c("sequenceFlow","sequenceFlow")) model <- create_bpmn(nodes, flows, events) create_xml(model)
library(dplyr) nodes <- tibble(id = "task", name = "Task name", objectType = "task", gatewayDirection = NA) events <- tibble(id = c("start","end"), name = c("Start event","End event"), objectType = c("startEvent","endEvent")) flows <- tibble(id = c("flow1","flow2"), name = c("flow1","flow2"), sourceRef = c("start","task"), targetRef = c("task","end"), objectType = c("sequenceFlow","sequenceFlow")) model <- create_bpmn(nodes, flows, events) create_xml(model)
Contains 5 attributes (tasks, sequenceFlows, gateways, startEvent, endEvent) each one as a dataframe
bpmn_instance
bpmn_instance
Eventlog containing 500 patient cases
Print xml part of bpmn
print_bpmn(x, ...)
print_bpmn(x, ...)
x |
A bpmn object from create_bpmn function |
... |
Any additional arguments |
No return value, only print model.
Alessio Nigro
This renders a BPMN diagram based on a BPMN object.
render_bpmn( bpmn, viewer.suppress = FALSE, width = NULL, height = NULL, elementId = NULL, xml_version_number = "1.0", xml_encoding_declaration = "UTF-8", ... ) ## S3 method for class 'bpmn' render_bpmn( bpmn, viewer.suppress = FALSE, width = NULL, height = NULL, elementId = NULL, xml_version_number = "1.0", xml_encoding_declaration = "UTF-8", ... )
render_bpmn( bpmn, viewer.suppress = FALSE, width = NULL, height = NULL, elementId = NULL, xml_version_number = "1.0", xml_encoding_declaration = "UTF-8", ... ) ## S3 method for class 'bpmn' render_bpmn( bpmn, viewer.suppress = FALSE, width = NULL, height = NULL, elementId = NULL, xml_version_number = "1.0", xml_encoding_declaration = "UTF-8", ... )
bpmn |
A BPMN object as a list of data.frames for the BPMN elements and an XML document for the XML-based interchange format for the BPMN process. |
viewer.suppress |
Never display the widget within the RStudio Viewer (useful for widgets that require a large amount of space for rendering). Defaults to FALSE. |
width |
Fixed width for widget (in css units). The default is NULL, which results in intelligent automatic sizing based on the widget's container. |
height |
Fixed height for widget (in css units). The default is NULL, which results in intelligent automatic sizing based on the widget's container. |
elementId |
Use an explicit element ID for the widget (rather than an automatically generated one). Useful if you have other JavaScript that needs to explicitly discover and interact with a specific widget instance. |
xml_version_number |
The version of the XML standard used. |
xml_encoding_declaration |
The character encoding used in the XML declaration. ‘UTF-8’ is the default encoding used. |
... |
Additional arguments passed to methods. |
Rendered BPMN model in htmlwidget.
Alessio Nigro
library(dplyr) nodes <- tibble(id = "task", name = "Task name", objectType = "task", gatewayDirection = NA) events <- tibble(id = c("start","end"), name = c("Start event","End event"), objectType = c("startEvent","endEvent")) flows <- tibble(id = c("flow1","flow2"), name = c("flow1","flow2"), sourceRef = c("start","task"), targetRef = c("task","end"), objectType = c("sequenceFlow","sequenceFlow")) model <- create_bpmn(nodes, flows, events) render_bpmn(model)
library(dplyr) nodes <- tibble(id = "task", name = "Task name", objectType = "task", gatewayDirection = NA) events <- tibble(id = c("start","end"), name = c("Start event","End event"), objectType = c("startEvent","endEvent")) flows <- tibble(id = c("flow1","flow2"), name = c("flow1","flow2"), sourceRef = c("start","task"), targetRef = c("task","end"), objectType = c("sequenceFlow","sequenceFlow")) model <- create_bpmn(nodes, flows, events) render_bpmn(model)
Output and render functions for using render_bpmn within Shiny applications and interactive Rmd documents.
render_bpmnOutput(outputId, width = "100%", height = "400px") renderRender_bpmn(expr, env = parent.frame(), quoted = FALSE)
render_bpmnOutput(outputId, width = "100%", height = "400px") renderRender_bpmn(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width , height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a render_bpmn |
env |
The environment in which to evaluate |
quoted |
Is |
Rendered BPMN model in Shiny widget.
Rendered BPMN model in Shiny widget.
Alessio Nigro
This writes out both XML and normalised HTML. The default behavior will output the same format which was read. If you want to force output pass 'option = "as_xml"' or 'option = "as_html"' respectively.
write_bpmn(bpmn, file, ...) ## S3 method for class 'bpmn' write_bpmn(bpmn, file, ...)
write_bpmn(bpmn, file, ...) ## S3 method for class 'bpmn' write_bpmn(bpmn, file, ...)
bpmn |
A BPMN object as a list of data.frames for the BPMN elements and an XML document for the XML-based interchange format for the BPMN process. |
file |
Path to file or connection to write to. |
... |
Additional arguments passed to methods. |
Writes file to system.
write_bpmn(bpmn)
: Write bpmn to .bpmn file
Alessio Nigro