CLOUDIFY-2370 use new decorators for tasks and add some protective code