appian and maps
Hello,
I am trying to represent the following structure using maps in Appian (for those familiar with C# or Java ... something equivalent to Dictionary<int, List<Object>):
So the list looks something like this:
{
{
taskId: 100,
dependsOnTaskId: 101
},
{
taskId: 100,
dependsOnTaskId: 121
},
{
taskId: 101,
dependsOnTaskId: 123
},
{
taskId: 103,
dependsOnTaskId: 0
},
{
taskId: 123,
dependsOnTaskId: 5
},
}
A task Id might have none or multiple unique dependencies (there are many other constrains but at this point I will just focus on the most basic structure)
After processing this list, I would like to have a map as follows:
{
{
taskId :100 dependencies: 101, 121
},
{
taskId :101 dependencies: 123
},
{
taskId :103 dependencies:
},
{
taskId :123 dependencies: 5
}
}
I am able to build this structure in a process model using a loop but performance seems to be an issue here since the node that calls the expression rule and then builds the map takes more than a minute to process a list with less than a hundred items. Moreover, there is the activity chaining... I often hit the maximum limit of chains(I know this is a configuration parameters and could potentially be increased, but since the list will be constantly growing, I don't think that is the ideal solution).
The thing is that moving the execution to an expression rule and using a for loop doesn't work: on each iteration, the for loop doesn't take into account any changes made on the previous iteration. Therefore, the result is a flat list of maps with the same structure as the initial list (tasks are not being grouped). I was hoping there will be a way to pass parameters "by reference" but this seems to be a foreign concept in Appian (except in process models I know).
Any advice /help would be greatly appreciated!
Thank you
