def dependent_operations(operation)
      operations.select do |top|
        top.dependencies.select do |dp|
          dp['id'] == operation.template.id &&
            dp['statuses'].include?(operation.status)
        end.present?
      end
    end
def dependent_operations(operation)
      operations.select do |top|
        top.dependencies.select do |dp|
          dp['id'] == operation.template.id &&
            dp['statuses'].include?(operation.status)
        end.present?
      end
    end
here we calculate template operations that depends on
 given process operation status and template id