``register_activity`` Register an Activity with this Workflow. :param Activity activity: the Activity to register :param list[str] subactivities: the list of Activities to assign :return: the registered Activity :rtype: Activity
(self, activity: Activity, subactivities: List[ActivityType] = [])
| 365 | return Workflow(handle=workflow) |
| 366 | |
| 367 | def register_activity(self, activity: Activity, subactivities: List[ActivityType] = []) -> Optional[Activity]: |
| 368 | """ |
| 369 | ``register_activity`` Register an Activity with this Workflow. |
| 370 | |
| 371 | :param Activity activity: the Activity to register |
| 372 | :param list[str] subactivities: the list of Activities to assign |
| 373 | :return: the registered Activity |
| 374 | :rtype: Activity |
| 375 | """ |
| 376 | if activity is None: |
| 377 | return None |
| 378 | input_list = (ctypes.c_char_p * len(subactivities))() |
| 379 | for i in range(0, len(subactivities)): |
| 380 | input_list[i] = str(subactivities[i]).encode('charmap') |
| 381 | handle = core.BNWorkflowRegisterActivity(self.handle, activity.handle, input_list, len(subactivities)) |
| 382 | if handle is None: |
| 383 | return None |
| 384 | return activity |
| 385 | |
| 386 | def contains(self, activity: ActivityType) -> bool: |
| 387 | """ |
no test coverage detected