Hi all,
I have a pickerFieldUsers field in my interface that I use to store a username into a local variable "local!userToTransferTo" which looks like this:
a!pickerFieldUsers( label: "New Owner", labelPosition: "ABOVE", saveInto: local!userToTransferTo, value: local!userToTransferTo, required: true, validations: {}, placeholder: "--Start typing officer name--" ),
The interface that contains this field is a Process Start form for a process model. The process model [also] has a process variable of type "User" which is called "PVUserToTransferTo".
Back in my interface, I have a buttonWidget inside a buttonArrayLayout that looks like this:
a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Transfer", style: "NORMAL", saveInto: { a!forEach( local!dataGridSelection, a!save( target: null, value: local!dataGridSelection ) ) /*, a!save( pv!PVUserToTransferTo, local!userToTransferTo )*/ } ) }, align: "START" )
There's actually two problems I'm trying to solve here. The first problem - the one that I am asking at this time - is how to get the value that gets stored in local!userToTransferTo from the pickerFieldUsers object into the process variable PVUserToTransferTo where I can subsequently use the data in the rest of my process model. When I un-comment out the code:
a!save(pv!PVUserToTransferTo,local!userToTransferTo)
The form fails to render/compile, so this code is clearly wrong in some way.
Can someone advise how I get the value that is entered into the pickerFieldUsers object into a process variable that I can use in my process model?
thanks heaps,
David
In my process model properties
Discussion posts and replies are publicly visible
Hello David,
It is important to understand the execution context, when you are in the process context(domain) you have access to the process variables pv!. When you are in a smart service or process node you are on the activity class context ac! (domain) and when you are on a rule ( expression, interface, or so) you are on the rule context (domain) where you have rule inputs so you have ri!.
You should map the values between the context you create a node data input variable ac! That you will map and set up the value that comes from the process and later you have a rule input (the same type always, that will receive the activity class variable.
pv! -> ac! -> ri!
And you have to do the same when you want to receive a value from the interface.
ri! -> ac! -> pv!
The rrror you are experiencing is that you are trying to access a process variable that is not visible on the interface just because you are not in the context.
Here you can find a discussion about the same
Hope this helps
Jose