Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the functionality to search process instances with like (and in) condition in variable value #312

Closed
magrawa opened this issue Jan 29, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@magrawa
Copy link
Collaborator

magrawa commented Jan 29, 2018

Looks like the latest upgrade in MDW has broken the search functionality in TOM.

When we initially developed the TOM Status Microservice (with MDW version 6.0.07), we had written code to filter MDW instances based on variable values using the Process Services API extended by MDW.
This is what the TOM code looked like-

          if ((USO_NUMBER).equalsIgnoreCase(entry.getKey())) {
                       variablesMap.put(USO_NUMBER, "like '%"+entry.getValue()+"%'");
                 }
   
          //Following filter is used to ignore the process instances used to GET the information                 
          variablesMap.put("Type", UPDATE);
          ProcessServices processServices = ServiceLocator.getProcessServices();

          //The following method lists out all processes based on the filters provided in the query.
          ProcessList processList = processServices.getInstances(criteria, variablesMap, 0,Query.MAX_ALL, "order by pis.create_dt desc");
          List<ProcessInstance> instancelist = processList.getProcesses();

With the recent update to mdw 6.0.10, this functionality stopped working as we no longer need to pass the conditional operator in the variablesMap that is passed to the API.
This is what the code looks like now-

   if ((USO_NUMBER).equalsIgnoreCase(entry.getKey())) {
                       variablesMap.put(USO_NUMBER, entry.getValue());
                 }
          variablesMap.put("Type", UPDATE);
          ProcessServices processServices = ServiceLocator.getProcessServices();
          //The following method lists out all processes based on the filters provided in the query.
          ProcessList processList = processServices.getInstances(criteria, variablesMap, 0,Query.MAX_ALL, "order by pis.create_dt desc");
          List<ProcessInstance> instancelist = processList.getProcesses();
@magrawa magrawa self-assigned this Jan 29, 2018
@magrawa
Copy link
Collaborator Author

magrawa commented Jan 29, 2018

We are going to check if the variable value starts with like or in keywords and based on that we build the SQL query. If those two words are not present then we assume = condition. if like or in is specified in variable value then it would be the responsibility of the caller to formulate the SQL query properly.
Example for like
like '%a%'
For in
in ('a','b')

@jbrojdeCTL
@donaldoakes

@magrawa magrawa added the defect label Jan 29, 2018
@magrawa magrawa added this to the 6.0.12 milestone Jan 29, 2018
magrawa added a commit that referenced this issue Jan 30, 2018
magrawa added a commit that referenced this issue Jan 30, 2018
@magrawa magrawa closed this as completed Jan 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant