diff options
| author | Brian Potchik <brian@vector35.com> | 2024-10-28 15:07:46 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2024-10-28 15:07:46 -0400 |
| commit | f15994bbbd4b15d2bff354657cbd326b2a512c93 (patch) | |
| tree | a4c2b05ff39ed19dd3e8aa8770ee6ec31a0908c7 /python/workflow.py | |
| parent | fc5ffbbcfbc16402583a9e05d7db3036ad587066 (diff) | |
Properly wrap the Activity object returned from 'register_activity'.
Diffstat (limited to 'python/workflow.py')
| -rw-r--r-- | python/workflow.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/python/workflow.py b/python/workflow.py index 7989d6bd..8213a6b6 100644 --- a/python/workflow.py +++ b/python/workflow.py @@ -342,7 +342,7 @@ class Workflow(metaclass=_WorkflowMetaclass): :param Activity activity: the Activity to register :param list[str] subactivities: the list of Activities to assign - :return: True on Success, False otherwise + :return: the registered Activity :rtype: Activity """ if activity is None: @@ -350,7 +350,10 @@ class Workflow(metaclass=_WorkflowMetaclass): input_list = (ctypes.c_char_p * len(subactivities))() for i in range(0, len(subactivities)): input_list[i] = str(subactivities[i]).encode('charmap') - return core.BNWorkflowRegisterActivity(self.handle, activity.handle, input_list, len(subactivities)) + handle = core.BNWorkflowRegisterActivity(self.handle, activity.handle, input_list, len(subactivities)) + if handle is None: + return None + return activity def contains(self, activity: ActivityType) -> bool: """ |
