How do you define condition in flowchart gateways?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • murugappan
    Active Community Member
    • Aug 2017
    • 483

    How do you define condition in flowchart gateways?

    Hi,

    I am having a great deal of trouble in defining the condition for a gateway in flowcharts. Main reason is that there is no documentation or examples for defining them. What i am doing is defined in the main process flowchart (refer to screencap). In the exclusive gateway, i trying to check if one variable is less then another variable. If it is, then execute the "Increment days" script task otherwise take the default path(which is "End"). See screencap for gateway definition. When i run the process it always executes the default path. I am not sure if I have defined the condition correctly. The other definition is tried was and did not work was:

    ifThen($extend_dayscntl < $extend_days, true);

    Also, i do not know a way to debug the contents of the variable (which i could do using echo in php).

    Please help.
    Attached Files
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hello,
    You also need to provide the screenshots of the "Store extension info" and the "Increment days" blocks' logic.

    Comment


    • murugappan
      murugappan commented
      Editing a comment
      I have attached all the screencaps as requested. I know you are a very busy person but your assistance and early attention would be appreciated. Thank you.
  • murugappan
    Active Community Member
    • Aug 2017
    • 483

    #3
    Maximus Hi,

    Thank you for responding. I have attached all the artifacts for the process. Please help.

    Attached Files

    Comment

    • murugappan
      Active Community Member
      • Aug 2017
      • 483

      #4
      Maximus hi,

      Any help, please?

      Comment

      • dimyy
        Active Community Member
        • Jun 2018
        • 573

        #5
        Try to remove semicolon in function
        Attached Files

        Comment

        • murugappan
          Active Community Member
          • Aug 2017
          • 483

          #6
          Hi dimyy

          Thank you for the valuable help.

          I removed the semicolon and it worked but it generated 2000 records and timed out. This was due to the "Increment Days" Script task. The code in there was:

          $extend_runday++;
          $day_number = string\concatenate('D', number\round($extend_runday, 2));
          $extend_dayscntl++;



          Somehow, the increment operator did not work. So i change the code to:

          $extend_runday = $extend_runday + 1;
          $day_number = string\concatenate('D', number\round($extend_runday, 2));
          $extend_dayscntl = $extend_dayscntl + 1;


          Then it worked great.

          I have 2 questions:

          (1) if the semicolon is removed, how do i define 2 condition? Do i code as:

          " $extend_dayscntl < $extend_days && $extend_dayscntl != 0" OR
          " ($extend_dayscntl < $extend_days) && ($extend_dayscntl != 0)"

          (2) Why does the increment operator not work?

          You advice most appreciated.

          Comment

          • dimyy
            Active Community Member
            • Jun 2018
            • 573

            #7
            1. Faster to try than ask. I guess both options are correct
            2. Script is not php script? it's internal espo script language (https://docs.espocrm.com/administration/formula/)

            Comment

            • murugappan
              Active Community Member
              • Aug 2017
              • 483

              #8
              Hi dimyy

              Thank you so much. Both worked as you have stated.

              Comment

              Working...