code: @SuppressWarnings("unchecked")
      public boolean evaluate(List<String> completedActivities, List<VariableInstance> variableInstances)
      throws SynchronizationException {
          if (syncedActivityIds == null || syncedActivityIds.length == 0)
              return true;
  
          try {
              Expression e = ExpressionFactory.createExpression(syncExpression);
              // create a context
              JexlContext jc = JexlHelper.createContext();
              if (syncedActivityIds != null && completedActivities != null) {
                  // set the sync values
                  for (String syncedActivityId : syncedActivityIds) {
                      Boolean isCompleted = completedActivities.contains(syncedActivityId);
                      jc.getVars().put(syncedActivityId, isCompleted);
                      // the following is for backward compatibility where escaped activity names are used
                      String escapedName = idToEscapedName.get(syncedActivityId);
                      if (escapedName!=null) jc.getVars().put(escapedName, isCompleted);
                  }
              }
              if (variableInstances != null) {
                  // set the variables
                  for (VariableInstance variableInstance : variableInstances) {
                      jc.getVars().put(variableInstance.getName(), variableInstance.getData());
                  }
              }
              
              // evaluate the expression
              Boolean b = (Boolean) e.evaluate(jc);
              return b.booleanValue();
          }
          catch (Exception ex) {
              logger.severeException(ex.getMessage(), ex);
              throw new SynchronizationException(ex.getMessage(), ex);
          }
      }
docs: Checks whether the synchronization criteria can be considered to be met
  by evaluating the expression versus the list of completed activities.
  @param completedActivities logical ids of completed activities
  @param variableInstances variable instances to use in evaluation
  @return result of the evaluation