Sets is_status flag on new workflow spec files

This commit is contained in:
Aaron Louie 2020-03-13 14:57:28 -04:00
parent 902dba7191
commit 0da07ad9e7
1 changed files with 5 additions and 3 deletions

View File

@ -95,13 +95,15 @@ class ExampleDataLoader:
for file_path in files:
noise, file_extension = os.path.splitext(file_path)
filename = os.path.basename(file_path)
is_primary = filename.lower() == id + ".bpmn"
is_status = filename.lower() == 'status'
is_primary = filename.lower() == id + '.bpmn'
try:
file = open(file_path, "rb")
file = open(file_path, 'rb')
data = file.read()
content_type = CONTENT_TYPES[file_extension[1:]]
file_service.add_workflow_spec_file(workflow_spec=spec, name=filename, content_type=content_type,
binary_data=data, primary=is_primary)
binary_data=data, primary=is_primary, is_status=is_status)
except IsADirectoryError as de:
# Ignore sub directories
pass