Forum Stats

  • 3,839,758 Users
  • 2,262,532 Discussions
  • 7,901,052 Comments

Discussions

How can we set instance variables using PAPI ?

672935
672935 Member Posts: 20

Hi,

How can we set instance variables using PAPI ?
Tagged:

Answers

  • 650310
    650310 Member Posts: 128
    One way of doing this is to execute the current activity of the instance and pass in the arguments.
    On the BPM side, you can map these arguments to the instance variables.

    HTH
  • 680319
    680319 Member Posts: 1
    edited Jan 16, 2009 10:14AM
    hi,

    /***********Setting Instance variable value********************/

    In ALBPM U can create a Global activity with Has Instance Access as true(checked) under general Option

    there u can assign all instance variable to corresponding argument variable
    e.g,here request_name, request_nameArg both are of type String

    if request_nameArg !=null && request_nameArg != "" && length(request_nameArg)>0 then
    request_name=request_nameArg
    end

    and Using PAPAI you can execute that activity...


    /***********Getting Instance variable value********************/
    Using PAPI you can get a ProcessServiceSession say mySession
    ...........pass String myInstanceId, e.g, "/MyCustomerProcess#Default-1.0/1000/0"

    String myInstancevaribleName="customerId"
    InstanceInfo myInstnceInfo= mySession.processGetInstance(myInstanceId);
    String myInstancevaribleNameVal = mySession.instanceGetVariable(myInstnceInfo,myInstancevaribleName);

    .............

    Thanks,
    Subrata

    Edited by: user10816575 on Jan 16, 2009 7:07 AM
  • 657759
    657759 Member Posts: 25
    Does this also apply to External Variables? Or is there an easier way to set from Papi without having to call a Global activity?

    Todd
This discussion has been closed.