Skip to content

Commit

Permalink
make sure pre and post scripts are added to send/receive tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
essweine committed Jul 2, 2024
1 parent 7392ec6 commit 7e15a0b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions SpiffWorkflow/spiff/parser/event_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,18 @@ def create_task(self):

class SpiffSendTaskParser(SpiffEventDefinitionParser, SendTaskParser):
def create_task(self):
return SendTaskParser.create_task(self)
task = SendTaskParser.create_task(self)
# Duplicate this code from the SpiffTask parser because of parser limitations
extensions = self.parse_extensions()
task.prescript = extensions.get('preScript')
task.postscript = extensions.get('postScript')
return task

class SpiffReceiveTaskParser(SpiffEventDefinitionParser, ReceiveTaskParser):
def create_task(self):
return ReceiveTaskParser.create_task(self)
task = ReceiveTaskParser.create_task(self)
# I have given up trying to do any of this right
extensions = self.parse_extensions()
task.prescript = extensions.get('preScript')
task.postscript = extensions.get('postScript')
return task

0 comments on commit 7e15a0b

Please sign in to comment.