snippets/liferay/camunda-bpm-liferay-process-application/src/main/java/org/camunda/bpm/engine/cdi/impl/context/PortalContextAssociationManager.java
private void checkTaskSelectedViaBridge() {
    String bridgeTaskId = (String) getSharedSessionAttribute(BRIDGE_TASK_ID);
    String selectedTaskId = (String) getSharedSessionAttribute(ASSOCIATED_TASK_ID);

    if (selectedTaskId == null && bridgeTaskId != null) {
      switchTaskId(bridgeTaskId);
    }
    if (selectedTaskId != null && bridgeTaskId != null && !selectedTaskId.equals(bridgeTaskId)) {
      // task switched, TODO: think about if correct like this
      switchTaskId(bridgeTaskId);
    }
  }
private void checkTaskSelectedViaBridge() {
    String bridgeTaskId = (String) getSharedSessionAttribute(BRIDGE_TASK_ID);
    String selectedTaskId = (String) getSharedSessionAttribute(ASSOCIATED_TASK_ID);

    if (selectedTaskId == null && bridgeTaskId != null) {
      switchTaskId(bridgeTaskId);
    }
    if (selectedTaskId != null && bridgeTaskId != null && !selectedTaskId.equals(bridgeTaskId)) {
      // task switched, TODO: think about if correct like this
      switchTaskId(bridgeTaskId);
    }
  }
"lazy" load task if bridge state has changed in the meantime