diff --git a/crc/services/workflow_processor.py b/crc/services/workflow_processor.py
index d29c3a0e..55100afd 100644
--- a/crc/services/workflow_processor.py
+++ b/crc/services/workflow_processor.py
@@ -53,10 +53,17 @@ class CustomBpmnScriptEngine(BpmnScriptEngine):
super().execute(task, script, data, externalMethods=augmentMethods)
except SyntaxError as e:
- raise ApiError.from_task('syntax_error',
- f'If you are running a pre-defined script, please'
- f' proceed the script with "#!", otherwise this is assumed to be'
- f' pure python: {script}, {e.msg}', task=task)
+ del(task.data['task'])
+ raise ApiError('syntax_error',
+ f'Something is wrong with your python script '
+ f'please correct the following:'
+ f' {script}, {e.msg}')
+ except NameError as e:
+ del(task.data['task'])
+ raise ApiError('name_error',
+ f'something you are referencing does not exist:'
+ f' {script}, {e.name}')
+
# else:
# self.run_predefined_script(task, script[2:], data) # strip off the first two characters.
diff --git a/crc/static/bpmn/data_security_plan/data_security_plan.bpmn b/crc/static/bpmn/data_security_plan/data_security_plan.bpmn
index 3bf309b7..87b931b9 100644
--- a/crc/static/bpmn/data_security_plan/data_security_plan.bpmn
+++ b/crc/static/bpmn/data_security_plan/data_security_plan.bpmn
@@ -453,7 +453,7 @@ Indicate all the possible formats in which you will transmit your data outside o
SequenceFlow_0k2r83n
SequenceFlow_0t6xl9i
SequenceFlow_16kyite
- complete_template('NEW_DSP_template.docx','Study_DataSecurityPlan')/bpmn:script>
+ complete_template('NEW_DSP_template.docx','Study_DataSecurityPlan')
##### Instructions
diff --git a/crc/static/bpmn/research_rampup/research_rampup.bpmn b/crc/static/bpmn/research_rampup/research_rampup.bpmn
index 5703daaf..eaa1dab7 100644
--- a/crc/static/bpmn/research_rampup/research_rampup.bpmn
+++ b/crc/static/bpmn/research_rampup/research_rampup.bpmn
@@ -598,7 +598,7 @@ Use the EHS [Lab Safety Plan During COVID 19 template](https://www.google.com/ur
This step is internal to the system and do not require and user interaction
Flow_11uqavk
Flow_0aqgwvu
- complete_template('ResearchRampUpPlan.docx','RESEARCH_RAMPUP')/bpmn:script>
+ complete_template('ResearchRampUpPlan.docx','RESEARCH_RAMPUP')
@@ -755,7 +755,7 @@ Notify the Area Monitor for
This step is internal to the system and do not require and user interaction
Flow_0j4rs82
Flow_07ge8uf
- #!RequestApproval ApprvlApprvr1 ApprvlApprvr2
+ request_approval('ApprvlApprvr1','ApprvlApprvr2')
#### Script Task
diff --git a/tests/data/docx/docx.bpmn b/tests/data/docx/docx.bpmn
index e5b0cdcf..fe11b7c5 100644
--- a/tests/data/docx/docx.bpmn
+++ b/tests/data/docx/docx.bpmn
@@ -27,7 +27,7 @@
SequenceFlow_1i7hk1a
SequenceFlow_11c35oq
- complete_template('Letter.docx AD_CoCApp')/bpmn:script>
+ complete_template('Letter.docx','AD_CoCApp')
SequenceFlow_11c35oq
diff --git a/tests/data/multi_instance_parallel/multi_instance_parallel.bpmn b/tests/data/multi_instance_parallel/multi_instance_parallel.bpmn
index 0c4ff40c..0c31670e 100644
--- a/tests/data/multi_instance_parallel/multi_instance_parallel.bpmn
+++ b/tests/data/multi_instance_parallel/multi_instance_parallel.bpmn
@@ -11,7 +11,7 @@
# Please provide addtional information about:
-## Investigator ID: {{investigator.user_id}}
+## Investigator ID: {{investigator.user_id}}
## Role: {{investigator.type_full}}
diff --git a/tests/data/random_fact/random_fact.bpmn b/tests/data/random_fact/random_fact.bpmn
index 234dd160..6bee51b7 100644
--- a/tests/data/random_fact/random_fact.bpmn
+++ b/tests/data/random_fact/random_fact.bpmn
@@ -132,7 +132,7 @@ Autoconverted link https://github.com/nodeca/pica (enable linkify to see)
SequenceFlow_0641sh6
SequenceFlow_0t29gjo
- fact_service()
+ FactService = fact_service()
# Great Job!
diff --git a/tests/workflow/test_workflow_spec_validation_api.py b/tests/workflow/test_workflow_spec_validation_api.py
index 0c17892e..da389168 100644
--- a/tests/workflow/test_workflow_spec_validation_api.py
+++ b/tests/workflow/test_workflow_spec_validation_api.py
@@ -89,7 +89,7 @@ class TestWorkflowSpecValidation(BaseTest):
self.load_example_data()
errors = self.validate_workflow("invalid_script")
self.assertEqual(2, len(errors))
- self.assertEqual("error_loading_workflow", errors[0]['code'])
+ self.assertEqual("workflow_validation_exception", errors[0]['code'])
self.assertTrue("NoSuchScript" in errors[0]['message'])
self.assertEqual("Invalid_Script_Task", errors[0]['task_id'])
self.assertEqual("An Invalid Script Reference", errors[0]['task_name'])
@@ -99,7 +99,7 @@ class TestWorkflowSpecValidation(BaseTest):
self.load_example_data()
errors = self.validate_workflow("invalid_script2")
self.assertEqual(2, len(errors))
- self.assertEqual("error_loading_workflow", errors[0]['code'])
+ self.assertEqual("workflow_validation_exception", errors[0]['code'])
self.assertEqual("Invalid_Script_Task", errors[0]['task_id'])
self.assertEqual("An Invalid Script Reference", errors[0]['task_name'])
self.assertEqual("invalid_script2.bpmn", errors[0]['file_name'])