src/main/java/me/paulbares/subscription/ApproverWorkflowRegistrar.java
private void unsubscribe(Subscription subscription) {
    CamundaUserDetails userDetails = subscription.getCamundaUserDetails();
    Subscriber<Notification> subscriber = subscription.getSubscriber();
    String userId = userDetails.getUser();
    writeExecute(userId, () -> {
      this.lastSubIdBySub.remove(subscriber);
      this.subscribersByUserId.removeSubscriber(userId, subscriber);
      userDetails.getGroups().forEach(groupId -> {
        Entry entry = this.subscribersByGroupId.get(groupId);
        if (entry != null) {
          entry.removeSubscriber(userId, subscriber);
          if (!entry.hasSubscriber()) {
            this.subscribersByGroupId.remove(groupId);
          }
        }
      });
    });
  }
/**
   * Unregistered the subscriber associated to this subscription.
   *
   * @param subscription the subscription
   */
Unregistered the subscriber associated to this subscription.
@param subscription the subscription
Unregistered the subscriber associated to this subscription . @param subscription the subscription
private void unsubscribe(Subscription subscription) {
    CamundaUserDetails userDetails = subscription.getCamundaUserDetails();
    Subscriber<Notification> subscriber = subscription.getSubscriber();
    String userId = userDetails.getUser();
    writeExecute(userId, () -> {
      this.lastSubIdBySub.remove(subscriber);
      this.subscribersByUserId.removeSubscriber(userId, subscriber);
      userDetails.getGroups().forEach(groupId -> {
        Entry entry = this.subscribersByGroupId.get(groupId);
        if (entry != null) {
          entry.removeSubscriber(userId, subscriber);
          if (!entry.hasSubscriber()) {
            this.subscribersByGroupId.remove(groupId);
          }
        }
      });
    });
  }
private void unsubscribe ( Subscription subscription ) { CamundaUserDetails userDetails = subscription . getCamundaUserDetails ( ) ; Subscriber < Notification > subscriber = subscription . getSubscriber ( ) ; String userId = userDetails . getUser ( ) ; writeExecute ( userId , ( ) -> { this . lastSubIdBySub . remove ( subscriber ) ; this . subscribersByUserId . removeSubscriber ( userId , subscriber ) ; userDetails . getGroups ( ) . forEach ( groupId -> { Entry entry = this . subscribersByGroupId . get ( groupId ) ; if ( entry != null ) { entry . removeSubscriber ( userId , subscriber ) ; if ( ! entry . hasSubscriber ( ) ) { this . subscribersByGroupId . remove ( groupId ) ; } } } ) ; } ) ; }
Unregistered the subscriber associated to this subscription.
Unregistered the subscriber associated to this subscription .