I have a scenario,would like to know whether I am handling it in the best way or

I have a scenario,would like to know whether I am handling it in the best way or is there some other better approaches.
Scenario is like this
I have a rule which returns something like a table row [A:1,B:2,C:3,D:4] ,where A,B,C,D are column names and 1,2,3,4 are respective values.The rule is called in an activity node(script task);we need to save the value of each column to different process variables.
Approach followed
I am invoking the rule once,converting it into a datasubset and storing it in a activity class variable in the inputs section.On the output I am using index() function on the data part(i.e index(ac!datasubsetvar.data,"A",{}) and saving to respective process variables.
Kindly review this approach

OriginalPostID-161439

OriginalPostID-161439

  Discussion posts and replies are publicly visible