Passing a button value as PV to a Process

Hello All,

I am using an interface to invoke a Process Model to download my claim report. I am able to invoke the process and download the report successfully. But the problem is, when I am trying to invoke a condition such as If the button pressed is Download, I should download the file and if it is Email, I should email the report instead.

For this scenario, I am using Button Widget to save the information of the form and filters. And the button value, I am saving into the variable local!buttonValue. Now, my questions are

1. I am not able to access the values from save!into in the process I am invoking. How can I access these variables?

2. How can I access the buttonValue as a PV inside the process I have designed?

3. I have tried doing this  saveInto: {local!export, a!save(ac!buttonValue, cons!CLAIMREP_BUTTON_VALUES[2])}. But when I am using the condition if ac!buttonValue = 1, I am getting the error, variable not found ac!buttonValue.

can you please suggest?

 

Edit: To add to this, I cannot use ri variable to share the data. Adding the ri variable is invalidating the interface with an error "Expected 1 parameter, passed 0 parameters"

 

Thanks,

Adi

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to AdirajuB
    Can you please try the below code and see if this returining you the required outcome?

    a!linkField(
    links: a!dynamicLink(
    label: "Download",
    saveInto: a!startProcess(
    processModel: cons!YOUR_PROCESS_MODEL,
    processParameters: {
    parameterNameClaimID: local!ClaimId,
    parameterNameClaimantID: local!ClaimantID,
    parameterNameButtonValue: "Download"
    }
    )
    )
    )
  • 0
    Certified Lead Developer
    in reply to vimalkumars

    Hi AdirajuB,

    I have updated the code for startprocesswrite as below. Please see whether this helps you.

    load(
      local!export: bind(
        null(),
        startprocesswrite(
          cons!ClaimReport_Process_ID,
          _
        )
      ),
      a!linkField(
        links: a!submitLink(
          label: "Download",
          saveInto: a!save(
            local!export,
            {
              parameterNameClaimID: local!ClaimId,
              parameterNameClaimantID: local!ClaimantID,
              parameterNameButtonValue: "Download"/*Recommended to use the constant*/  
            }
          )
        )
      )
    )

  • Hi Vimalkumars,

    Thank you very much for your inputs. I have tried them all, and all of them work in the sense, I am able to invoke the process. But the process variables I defined are always showing null. Is there something I am doing wrong in defining the process variables or is there some error in the way I am accessing them?

    I have even defined my interface as the start form in the Start activity and because there are no ri variables, it doesn't show any input fields. 

    Do I have to define any specific variable in Process for me to be able to access the saved values from the interface?

     

    Thanks,

    Adi

  • Hi Adi,

    If you are using UI as start form for process model, then you can have ri variable.

    What I have done.

    1) In UI,defined ri varible ri!button. Below is the code.

    load(
      local!export: bind(
        null(),
        startprocesswrite(80115,
          _
        )
      ),
      a!linkField(
        links: a!submitLink(
          label: "Download",
          value: "Download",
          saveInto: {
            a!save(ri!button,"Download")
          }
        )
      )
    )
    screenshots.docx

     

    2) In Process Model, created PV as paramater (buttonValue)

    3) Under Process Start form, mapped PV (under value drop down) to an interface ri variable.

    The same is working fine for me. I have tried to attached the screenshots.

  • 0
    Certified Lead Developer
    in reply to AdirajuB

    It looks like you've moved away from using a start form (which is often a good idea), but just in case it helps you for clarification (or others in the future), I'm attaching a small demo app (1 process model and 2 interfaces) which shows how to properly configure a start form to receive data from the user and pass it into the process.

    4274.SAIL Start Form Demo App.zip