Array as parameter to a!startprocess

 Hi,

I have an array of cdt as below and i am using 
saveInto: a!startProcess(
processModel: cons!Part_Updates_Const,
processParameters: ri!partInfo,
onSuccess: a!httpResponse(body:{"Well done"})
),
style: "NORMAL"
)
}

in a button to kick a process model.

Question 1: How can i send an array instead of just the dictionary as parameter? I am currently getting error: Could not cast from myType?list to Dictionary. Details: CastInvalid.

Question 2: Can the process model be started at click of the button ? Currently i have an input task that notifies me of the task and then i log in to select rows from the editable grid and click the button to start my process model which in turn kicks off other sub-processes that write to the database.

 

Array of cdt:

local!var:{type!{urn:com:appian:types:TYPES}myType(
Id:1,
StatusId: 23,
ParteId: 21,
partNumber: 3500,
partTypeId: PMAC560,
folderId:20,
createdBy: index(local!partInfo.data,"createdBy",{}),
createdDate:index(local!partInfo.data,"createdDate",{}),
modifiedBy: loggedInUser(),
modifiedDate: now()
),

type!{urn:com:appian:types:TYPES}myType(
Id:1,
StatusId: 23,
ParteId: 21,
partNumber: 3500,
partTypeId: PMAC560,
folderId:20,
createdBy: index(local!partInfo.data,"createdBy",{}),
createdDate:index(local!partInfo.data,"createdDate",{}),
modifiedBy: loggedInUser(),
modifiedDate: now()

),

type!{urn:com:appian:types:TYPES}myType(
Id:1,
StatusId: 24,
ParteId: 23,
partNumber: 3900,
partTypeId: PMAC560,
folderId:22,
createdBy: index(local!partInfo.data,"createdBy",{}),
createdDate:index(local!partInfo.data,"createdDate",{}),
modifiedBy: loggedInUser(),
modifiedDate: now()

)

}

  Discussion posts and replies are publicly visible

Parents
  • Hello Parveen,

    1) For your first question, when using the functions startProcess, startProcessLink and startProcess smart service you have to pass in the processParameter a dictionary as Vimal showed in his example, the dictionary needs to include the names of each parameter so the engine will be able to map them.
    Specifically to send the array you just need to map it , and set the variable as multiple, seems like you Are near to the solution.
    processParameters:{array:local!var}

    2) you can start a process from a link, but you need to decide what is next after clicking the button.

    If you need start a proces and then trigger another task (to show the result) using activity chain, then you need the function startProcessLink. I don’t remember been able to trigger from a Button qhich doesn’t submit the page.

    If you just need to trigger the process asynchronous then you can use the function startProcess. Inside a button. Since this does not refresh and chain the page this can be easily incorporated to the buttons.

    It is up to you which one matches your use case.


    Jose
Reply
  • Hello Parveen,

    1) For your first question, when using the functions startProcess, startProcessLink and startProcess smart service you have to pass in the processParameter a dictionary as Vimal showed in his example, the dictionary needs to include the names of each parameter so the engine will be able to map them.
    Specifically to send the array you just need to map it , and set the variable as multiple, seems like you Are near to the solution.
    processParameters:{array:local!var}

    2) you can start a process from a link, but you need to decide what is next after clicking the button.

    If you need start a proces and then trigger another task (to show the result) using activity chain, then you need the function startProcessLink. I don’t remember been able to trigger from a Button qhich doesn’t submit the page.

    If you just need to trigger the process asynchronous then you can use the function startProcess. Inside a button. Since this does not refresh and chain the page this can be easily incorporated to the buttons.

    It is up to you which one matches your use case.


    Jose
Children