This discussion is archived
1 Reply Latest reply: Jan 22, 2013 3:01 PM by Daniel Atwood RSS

OnSubmit change currentComponentInstance variable

985611 Newbie
Currently Being Moderated
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 Oracle ACE
    Currently Being Moderated
    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

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points