Exemplo n.º 1
0
    def get_cases(self, parameters=None):
        if parameters is None:
            parameters = {}
        list_logs = self.get_list_logs()
        for key in self.init_parameters:
            if key not in parameters:
                parameters[key] = self.init_parameters[key]
        parameters["filters"] = self.filters

        cases = parquet_handler.get_cases(".", self.distr_log_path, list_logs, parameters=parameters)

        return cases
Exemplo n.º 2
0
def get_cases():
    try:
        process = request.args.get('process', type=str)
        keyphrase = request.args.get('keyphrase', type=str)
        session = request.args.get('session', type=str)

        use_transition = request.args.get(PARAMETER_USE_TRANSITION,
                                          type=str,
                                          default=str(DEFAULT_USE_TRANSITION))
        no_samples = request.args.get(PARAMETER_NO_SAMPLES,
                                      type=int,
                                      default=DEFAULT_MAX_NO_SAMPLES)
        window_size = request.args.get(PARAMETER_WINDOW_SIZE,
                                       type=int,
                                       default=DEFAULT_WINDOW_SIZE)
        start = request.args.get(PARAMETER_START, type=int, default=0)

        if use_transition == "True":
            use_transition = True
        else:
            use_transition = False

        if keyphrase == configuration.KEYPHRASE:
            filters = get_filters_per_session(process, session)
            parameters = {}
            parameters["filters"] = filters
            parameters[PARAMETER_USE_TRANSITION] = use_transition
            parameters[PARAMETER_NO_SAMPLES] = no_samples
            parameters[PARAMETER_WINDOW_SIZE] = window_size
            parameters[PARAMETER_START] = start

            returned_dict = parquet_handler.get_cases(
                SlaveVariableContainer.conf,
                process,
                SlaveVariableContainer.managed_logs[process],
                parameters=parameters)

            return jsonify(returned_dict)
        return jsonify({"cases_list": [], "events": 0, "cases": 0})
    except:
        return traceback.format_exc()
Exemplo n.º 3
0
def get_cases():
    process = request.args.get('process', type=str)
    keyphrase = request.args.get('keyphrase', type=str)
    session = request.args.get('session', type=str)

    use_transition = request.args.get(PARAMETER_USE_TRANSITION,
                                      type=str,
                                      default=str(DEFAULT_USE_TRANSITION))
    no_samples = request.args.get(PARAMETER_NO_SAMPLES,
                                  type=int,
                                  default=DEFAULT_MAX_NO_SAMPLES)
    max_no_ret_items = request.args.get(PARAMETER_NUM_RET_ITEMS,
                                        type=int,
                                        default=DEFAULT_MAX_NO_RET_ITEMS)

    if use_transition == "True":
        use_transition = True
    else:
        use_transition = False

    if keyphrase == configuration.KEYPHRASE:
        filters = get_filters_per_session(process, session)
        parameters = {}
        parameters["filters"] = filters
        parameters[PARAMETER_USE_TRANSITION] = use_transition
        parameters[PARAMETER_NO_SAMPLES] = no_samples
        parameters[PARAMETER_NUM_RET_ITEMS] = max_no_ret_items

        returned_dict = parquet_handler.get_cases(
            SlaveVariableContainer.conf,
            process,
            SlaveVariableContainer.managed_logs[process],
            parameters=parameters)

        return jsonify(returned_dict)
    return jsonify({"cases_list": [], "events": 0, "cases": 0})