Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
By snosov
#783823
Hi all. There has been some discussion about the Steps menu that appears at the top of the case when it is opened in classic skin. This menu shows all steps (dynaforms) accessible to the user at that time. Notably, if you use dynaform conditions, the menu will show only those steps for which the conditions resolve to true. (This is a very powerful feature.) I found this very helpful in the latest process I am building because I have a variable number of forms to fill out depending on a field.

I know that I could hide the menu by:
(1) editing base code in ..\workflow\engine\menus\caseOptions.php (comment out line 32), or
(2) using the following javascript previously documented in "Accessing the Interface" wiki:
Code: Select all
function hideSteps() {
  if (top.frames['casesFrame'] && top.frames['casesFrame'].frames['casesSubFrame'] && 
        top.frames['casesFrame'].frames['casesSubFrame'].document.getElementById("stepsMenu")) {
     top.frames['casesFrame'].frames['casesSubFrame'].document.getElementById("stepsMenu").style.display = "none";
     window.clearInterval(saveInterval);
  }
}
saveInterval = window.setInterval(hideSteps, 100);
What I want to do is to refresh/recalculate this menu after I derivate the case to a new task and open it using the following code in a trigger:
Code: Select all
  $caseId = @@APPLICATION;
  $nextId = @%INDEX+1;
  //$link = "Location: cases_Open?APP_UID=".$caseId."&DEL_INDEX=".$nextId."&action=draft";
  //G::SendMessageText($link, "WARNING");
  PMFDerivateCase(@@APPLICATION, @%INDEX);
  G::header("Location: cases_Open?APP_UID=$caseId&DEL_INDEX=$nextId&action=draft");
  die;
At this point, if a user opens the task from the inbox, the steps menu properly shows the accessible steps. However, when the case is derivated and opened automatically with the trigger, the steps menu retains info from the previous task, and if those tasks are clicked causes the following error:

Fatal error: Call to a member function getStepMode() on a non-object in C:\Program Files (x86)\Processmaker\processmaker\workflow\engine\methods\cases\cases_Step.php on line 266

Please Help!
By snosov
#783841
I did some research and found the following java script in

/extjs/cases_open.js in line 36 Ext.onReady(function(){
I think that's where the steps menu is recalculated. Can someone tell me what is the best way to call this function without casing too much overhead? Is there a php hook that will execute this code?

I really, want to do these refreshes when the new task begins after I automatically derivate the case. This same menu exists in v3.0, but I did not review the code in the newest version, but I suspect this may be an issue there too.

Ideally, I would like to see an option either in the task properties, or in the routing rules, or in the steps property that would: (1) refresh steps menu; (2) show or hide the steps menu. This is just a suggestion, I would be fully satisfied if I could do this type of refresh from code.

Please help.
By snosov
#783940
This issue is still not resolved.

A couple of pointers to designers who want to route the same user through multiple tasks without stopping over at the derivation form, or forcing the user to go to the inbox.

1. Create an empty dynaform and call it something like "Route to next task". Then add this screen as a last step in your task. Add a trigger "RouteToNextStepAndDie" to execute BEFORE "Route to next task" step with the following logic:
Code: Select all
  $caseId = @@APPLICATION;
  $nextId = @%INDEX+1;
  PMFDerivateCase(@@APPLICATION, @%INDEX);
  G::header("Location: cases_Open?APP_UID=$caseId&DEL_INDEX=$nextId&action=draft");
  die;
This strategy takes care of the issues with populating case variables in the triggers that immediately precede the RouteToNextStepAndDie trigger. I personally had many issues, root cause of which I don't fully understand.

2. The logic above will work if the task is properly assigned to the logged in user. Thus, in the assignment rules for the task you will need to select "Value Based Assignment" and set the "Variable for Value Based Assignment" to @@USER_LOGGED.

3. The outstanding issue is with the Steps menu. I have many steps (dynaforms) in my task. Depending on a case variable I need to have the user fill out a variable number number of forms. Furthermore, I do not force the user to do it in a specific sequence -- user is free to jump from one form (dynaform step) to another using some sort of navigation menu. The "Steps" menu available in the classic skin is exactly what I need because it pre-calculates which steps will be available to user by evaluating the steps' "Conditions". Imagine a process consisting of 2 tasks: (Task1) User must select a type of case he is working on, for example civil, criminal, family, immigration, or some other.
(Task2) Contains multiple dynaforms that need to be filled out for each type of case. For example, "Fee Agreement", "Contact Information", "I-130", "Complaint", "Rule 11 Motion", etc. Each form relates to one or multiple areas of law. To display only appropriate forms for the specific case type I create the following conditions:

"Contact Information" strpos('~civil~criminal~family~immigration~',"~".@@caseType."~") !== false
"Fee Agreement" strpos('~civil~criminal~family~immigration~',"~".@@caseType."~") !== false and @@proBono != 1
"I-130" strpos('~immigration~',"~".@@caseType."~") !== false
"Complaint" strpos('~civil~family~',"~".@@caseType."~") !== false
"Rule 11 Motion" strpos('~criminal~',"~".@@caseType."~") !== false

As a result, if the operator selects "civil" case type and not ProBono, s/he will be presented with the following set of the forms: Contact Information, Fee Agreement, Complaint.
Conversely, if the case is an "immigration" ProBono case, the operator will be presented with: Contact Information, I-130.

4. THE OUTSTANDING ISSUE
The Steps menu does not recalculate/refresh with the new set of steps when the user is routed to the next task using this logic. Has anyone solved it? I see this question was first posed a few years ago here:
http://forum.processmaker.com/viewtopic ... 35#p783935

Processmaker team, liliana, amosbatto, or anyone else:
there is an AjaxListener at:
../sysworkflow/en/neoclassic/cases/ajaxListener?action=steps. But I don't know how to invoke this so that my target (Steps Menu) gets refreshed. Help is urgently needed!

A 1xBet clone script is a customizable software so[…]

A Bustabit clone script is a pre-made software sol[…]

Are you looking for ways to pay someone to write m[…]

BC.Game Clone

BC.game clone is a replica of the original BC.game[…]