@classmethod
def from_activity(cls, activity, commit=None):
    """Create an instance from the activity."""
    from .agents import SoftwareAgent
    agent = SoftwareAgent.from_commit(activity.commit)
    return cls(plan=activity.__association_cls__(commit=commit or activity.
        commit, client=activity.client, path=activity.path, activity=
        activity), agent=agent, id=activity._id + '/association')
