Skip to main content
May 3, 2021
Question

Consecutive expressions inside a same Script task

  • May 3, 2021
  • 3 replies
  • 0 views

Hi,

I've read that input ou output expressions inside a script tasks are not consecutives,

and the fact that Developer must not count on this.

If I have to create and use a custom counter, and then get a CDT value from this array at the index counter,

is there a way to do it from the same Script Task or I'm obligated to use 2 consecutive script tasks ?

Ex : 

- pv!counter  = myCounter +1

- pv!data = index(pv!myData, pv!counter, null)

3 replies

May 3, 2021

After reading this POST I have some additional informations.
https://community.appian.com/discussions/f/process/18720/evaluation-order-of-inputs-saveinto-s-and-outputs-in-process-model

If I can be sure Input nodes are executed before Output Nodes, can you confirm I could do this please ?

New Input : pv!counter  = myCounter +1

New Output : pv!data = index(pv!myData, pv!counter, null)

stefanhelzle0001
Brainy
May 3, 2021

You cannot store data to PV in an input. I know the there is a "save into", but that is just a short cut and evaluated at the same time as any output definitions. The way you would do this is

INPUT:

ac!counter = pv!myCounter + 1

OUTPUT:

pv!myCounter = ac!counter

pv!data = index(pv!myData, ac!counter, null)

May 3, 2021

Thank you Stefan, this seems logical.