Property disappears when trying to use created signal in works


I tried make my own task in works, but for some reason, when I want to test it, SignalName disappears from the list, when I type in component name. I tried to write the command in works manually, but then I got error that IfSignal is unknown task. The new task should read a signal of a component, and then do something when the signal is true, or something else when its false. Any help is greatly appreciated. Thanks in advance.

def WT_IfSignal(ComponentName, SignalName, Then, Else):
  _Signal = compsInWorld.get( ComponentName ).findBehaviour(SignalName)
    if _Signal.Value == 'True':
      return Then
      return Else

ifsignal-test.vcmx (357 KB)