Page 1 of 1

[SOLVED] Advancing cases en masse only using MySQL (phpMyAdmin)

Posted: Fri Aug 26, 2016 5:35 am
by touhamm
Hi everybody!

I have been trying to mass advance cases (+300) to the next task in the process. It works more or less. But the more I want to electing about choosing the cases, the more things get hacky, especially because we use LDAP.

Probably the right solution in our case is to use plain SQL to manipulate the cases and probably a bit of PHP if cases forms need manipulation.

Here is our scenario:
A user complains he can't manage his inbox because it is flooded with 480 case while he only works on less than 100. He needs to advance, or simply get rid of the rest. How should we determine the unnecessary cases? Easy! They originate from a particular process, they have been assigned from a certain person, and have a case variable set to a determined value.

Easy to do in theory, but while on practice, this causes me many problems:
    [*] I cannot proceed to route the cases as an admin because LDAP [*] How do query I for cases both based on database columns and case variables? [*] The operation takes too much time and, past PHP execution timeout, the batch hangs out, may corrupt some cases and another batch is needed.
Given that I have a set of cases IDs, how can I force advance them only using SQL?

Thank you in advance.

Re: Advancing cases en masse only using MySQL (phpMyAdmin)

Posted: Wed Aug 31, 2016 3:15 am
by rundyz
Hi
I would consider cancelling the affected cases, there is documentation on doing that with sql.

One other way would be to remove the steps within the task and 'click through' so no data is recorded (which would be accurate)


Really a back log of 480 case isn't that bad as you say, only 4x normal workload, but some people choose to be difficult
right now in our production we don't close cases (leave them open indefinitely) because we may need to change the case data that we use for analytics. So that last user has 8000+ cases in her inbox.

Hope this helps.

Re: Advancing cases en masse only using MySQL (phpMyAdmin)

Posted: Wed Aug 31, 2016 7:07 pm
by amosbatto
To do this only in MySQL is definitely not recommended, because you would have to modify the existing entries in APPLICATION, APP_CACHE_VIEW, and APP_DELEGATION, plus add a new entry in APP_DELEGATION. You have to get lots of details right.

I have designed a "Manage Cases" process which queries the APPLICATION table in MySQL for the cases you want and displays them in a grid with a checkbox. Then mark the cases which should be routed to the next task. A trigger after the DynaForm calls PMFDerivateCase() for each of the cases.
Download:
(48.45 KiB) Downloaded 468 times
To use this process, assign your admin to the first task in the process and run a case in the "Manage Cases" process.

I haven't tested any of the other functions besides routing, so I commented them out in the trigger code. I'll try to test the other options when I have more time (cancel case, pause case, unpause case and reopen case) and make them work as well.

Note: in version 3.0.1.8, calling PMFDerivateCase() works, but it generates a warning message, just ignore the warning messages.

Re: Advancing cases en masse only using MySQL (phpMyAdmin)

Posted: Thu Sep 01, 2016 12:06 pm
by touhamm
Thank you for your answers.

I have chosen to go a simpler and dumber way:
    [*]Create a secondary account for the user [*]Dress a list of all cases minus desired ones in (desired list selected manually from reporting tool). [*]A simple reassigneCase() to the secondary user does the work.
Simple, Dumb, Safe. It can be done by an admin or the user himself, all cases stay in the same progress and there is no data loss.

Re: [SOLVED] Advancing cases en masse only using MySQL (phpMyAdmin)

Posted: Tue Jan 03, 2023 10:29 am
by mbmonline
please attached it again
@amosbatto

Re: Advancing cases en masse only using MySQL (phpMyAdmin)

Posted: Thu Feb 02, 2023 2:54 am
by mbmonline
amosbatto wrote: Wed Aug 31, 2016 7:07 pm To do this only in MySQL is definitely not recommended, because you would have to modify the existing entries in APPLICATION, APP_CACHE_VIEW, and APP_DELEGATION, plus add a new entry in APP_DELEGATION. You have to get lots of details right.

I have designed a "Manage Cases" process which queries the APPLICATION table in MySQL for the cases you want and displays them in a grid with a checkbox. Then mark the cases which should be routed to the next task. A trigger after the DynaForm calls PMFDerivateCase() for each of the cases.
Download: Manage_cases-1.pmx

To use this process, assign your admin to the first task in the process and run a case in the "Manage Cases" process.

I haven't tested any of the other functions besides routing, so I commented them out in the trigger code. I'll try to test the other options when I have more time (cancel case, pause case, unpause case and reopen case) and make them work as well.

Note: in version 3.0.1.8, calling PMFDerivateCase() works, but it generates a warning message, just ignore the warning messages.
please attach it again