Questions and discussion about using ProcessMaker 2: user interface, running cases and functionality

Moderator: amosbatto

Forum rules: Please search to see if a question has already been asked before posting. Please don't ask the same question in multiple forums.
By Sage12
I'm looking to migrate a substantial amount of historical data into a new process in PM so users only have one source to work with. In order to use PM as a future production system, we will need a method to migrate existing data for cases into the tool and ensure each case is at the appropriate state and assigned to the appropriate task.

It seems straight forward to collect the old system information, and walk though the various values, creating the APP_DATA array, and a simple insert into the database. (straight forward because I have not tried yet :) ).

So, has anyone tried this yet?

If so what have been your difficulties?

The first hurdle I see - -Does the assignment of a new APP_UID have a specific method? I see that the system pretty much depends on APP_UID and APP_NUMBER to be unique values, but neither is defined as unique in the table definition.
User avatar
By amosbatto
The G::generateUniqueID() function is used to create the unique IDs. There is a very tiny chance that it will generate the same UID twice. The UID fields in the database should be unique. If they aren't, then you should write code to check that you are not inserting a duplicate UID in a table.

This post will help you get started:

Here is how I would do it:
Code: Select all
$newStartingTaskId = 'ZZZZZZZZZZZZZZZZZZ';

//look up all the existing cases from the old process:
$aCases = executeQuery($sql);

foreach ($aCases as $aCase) {
    $aCaseData = unserialize($aCase['APP_DATA']);
    PMFNewCaseImpersonate($newProcessId, $aCases['USR_UID'], $aCaseData, $newStartingTaskId);
However, that will only create new cases in their starting tasks with the data from the old cases. If you want to clone the cases, so they have the same number of completed tasks and the same users assigned to each task, then you need to see my clone_case2.pmx process:

Hi, Is there any way to show my custom column only[…]

Send for clarification

Hi, I know this is an old post but i could not fin[…]

add dropdown to search process

Please replay if there is any solution!!!!

Amosbatto, is down.

Hi Amos, I appreciate you setting up a tips and t[…]