Date: Fri, 29 Mar 2024 06:59:32 -0500 (CDT) Message-ID: <1454986505.39673.1711713572926@kodak01.contegix.mgmt> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_39672_1183378898.1711713572923" ------=_Part_39672_1183378898.1711713572923 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
To read RBA variable values from custom code you must specify wh= ich variables you will be reading and then fetch their values and assign th= em to local VB variables:
' --- declare local variables object ---
Dim variables As Creo.PWS.Automation.Base=
DataModel.Variables =3D action.Variables
=
'
' --- identify the variables to read =
---
variables.Reading("$prinergyPri=
maryServerName")
variables.Reading("$Boo=
kletPageFactor4")
variables.Reading("$op=
tionAutomaticCoverProcessing")
'
' --- fetch the values ---
&nbs=
p; variables.Fetch
' --- assign each fetched values to a local variables --- Dim Global_prinergyPrimaryServerName As Cr=
eo.PWS.Automation.BaseDataModel.ScalarVariable(Of String)
&=
nbsp; =3D variables("$prinergyPrim=
aryServerName")
Dim Global_BookletPageFa=
ctor4 As Creo.PWS.Automation.BaseDataModel.ScalarVariable(Of Integer)
=
code> =3D variables("$=
BookletPageFactor4")
Dim Global_optionAu=
tomaticCoverProcessing As Creo.PWS.Automation.BaseDataModel.ScalarVariable(=
Of Boolean)
 =
;=3D variables("$optionAutomaticCoverProcessing")
To update RBA variables from custom code you must specify which variable= s are going to be updated, assign values to the variables, and then, if not= being done from within a Set Variables action, indicate you are done updat= ing them:
' --- declare variables ---
Dim variables As Creo.PWS.Automation.Base=
DataModel.Variables =3D action.Variables
=
'
' --- variables to be updated ---
=
variables.Updating("@userDefinedErrorM=
sg")
variables.Updating("@userDefinedErr=
orCode")
variables.Updating("@emailAdmin=
istrator")
'
 =
; ' --- declare each variable being used for the update ---
Dim Temp_userDefinedErrorMsg As Creo.PWS.Aut=
omation.BaseDataModel.ScalarVariable(Of String)
 =
; =3D variables("@userDefinedErrorMsg")<=
br>
Dim Temp_userDefinedErrorCode As Creo.PW=
S.Automation.BaseDataModel.ScalarVariable(Of Integer)
 =
; =3D variables("@userDefinedError=
Code")
Dim Temp_emailAdministrator As Cr=
eo.PWS.Automation.BaseDataModel.ScalarVariable(Of Boolean)
=
=3D variables("@emailAdmini=
strator")
'
=
' --- Update the temporary variable values with appropriate values -=
--
Temp_UserDefinedErrorMsg.Value =
=3D "Some error message to be reported to the user"
&=
nbsp; Temp_userDefinedErrorCode.Value =3D 4857
=
Temp_emailAdministrator.Value =3D true
&n=
bsp; '
' --- Signal that you=
done updating the variables (not required if being done within a Set Varia=
bles action) ---
variables.AccessDone(ac=
tion.Context.ToString)
Variables can be read and updated from the same custom code if all the a= ppropriate Reading, Fetch, Updating, and AccessDone calls are made.