@@ -487,7 +487,7 @@ def clear(self) -> bool:
487487 """
488488 return core .BNWorkflowClear (self .handle )
489489
490- def insert (self , activity : ActivityType , activities : List [str ]) -> bool :
490+ def insert (self , activity : ActivityType , activities : Union [ List [str ], str ]) -> bool :
491491 """
492492 ``insert`` Insert the list of ``activities`` before the specified ``activity`` and at the same level.
493493
@@ -496,11 +496,29 @@ def insert(self, activity: ActivityType, activities: List[str]) -> bool:
496496 :return: True on success, False otherwise
497497 :rtype: bool
498498 """
499+ if isinstance (activities , str ):
500+ activities = [activities ]
499501 input_list = (ctypes .c_char_p * len (activities ))()
500502 for i in range (0 , len (activities )):
501503 input_list [i ] = str (activities [i ]).encode ('charmap' )
502504 return core .BNWorkflowInsert (self .handle , str (activity ), input_list , len (activities ))
503505
506+ def insert_after (self , activity : ActivityType , activities : Union [List [str ], str ]) -> bool :
507+ """
508+ ``insert_after`` Insert the list of ``activities`` after the specified ``activity`` and at the same level.
509+
510+ :param str activity: the Activity node for which to insert ``activities`` after
511+ :param list[str] activities: the list of Activities to insert
512+ :return: True on success, False otherwise
513+ :rtype: bool
514+ """
515+ if isinstance (activities , str ):
516+ activities = [activities ]
517+ input_list = (ctypes .c_char_p * len (activities ))()
518+ for i in range (0 , len (activities )):
519+ input_list [i ] = str (activities [i ]).encode ('charmap' )
520+ return core .BNWorkflowInsertAfter (self .handle , str (activity ), input_list , len (activities ))
521+
504522 def remove (self , activity : ActivityType ) -> bool :
505523 """
506524 ``remove`` Remove the specified ``activity``.
0 commit comments