1 Reply Latest reply: Jan 22, 2013 5:01 PM by Daniel Atwood RSS

    OnSubmit change currentComponentInstance variable

    985611
      Hello,

      I have a BPM object where there are 2 variables of type string with static list values and a variable of type int.
      My variables are named question1,question2,correctanswers
      The variables question1,question2 are filled from user input in an interactive activity which are displayed in comboboxes.

      When the user presses submit I want to save the variable correctanswers depending on the values from question1,question2

      I have written this code in my object's method
      -----
      totalcorrect as Integer
      totalcorrect = 0

      if question1 = "Lorem" then
      totalcorrect = totalcorrect + 1
      end

      if question2 = "Ipsum" then
      totalcorrect = totalcorrect + 1
      end

      correctanswers = totalcorrect
      -----
      However when I access correctanswers from my process (with an argument mapping) it does not have the desired value.

      Can you please guide me through to implement this?

      Thank you,
      Elina
        • 1. Re: OnSubmit change currentComponentInstance variable
          Daniel Atwood
          Hi Elina,

          Guessing you might have already done this, but try throwing in a few logMessage statements.

          At the top, add:
          >
          logMessage process.name + "; " + activity.name + " - question1: " + question1 using severity = DEBUG
          logMessage process.name + "; " + activity.name + " - question2: " + question2 using severity = DEBUG
          >

          At the bottom, add:
          >
          logMessage process.name + "; " + activity.name + " - totalcorrect: " + totalcorrect using severity = DEBUG
          logMessage process.name + "; " + activity.name + " - correctanswers : " + correctanswers using severity = DEBUG
          >

          Make sure that your logging level has been set to "Debug".

          Dan