Created
July 25, 2022 10:29
-
-
Save hlucasfranca/db648cd37f4bcf009ef8d5ec20b953b2 to your computer and use it in GitHub Desktop.
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
from bs4 import BeautifulSoup | |
attributes = [ | |
"camunda:class", | |
"camunda:topic", | |
"camunda:type" | |
] | |
with open('process.bpmn', 'r') as f: | |
contents = f.read() | |
soup = BeautifulSoup(contents, features='xml') | |
print(";".join(attributes)) | |
for ob in soup.find_all("bpmn:serviceTask"): | |
props = [] | |
for attribute in attributes: | |
if(ob.has_attr(attribute)): | |
props.append(ob[attribute]) | |
else: | |
props.append("") | |
print(";".join(props)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment