Not 100% sure about this - if this is a when action do you want different targetIndexes for the main action and the conditional action?

I suspect this should actually say

    addActionConnection(ctx, associatedActivity, instance, dependencyAtom, label, 1, when);

What do you think?