Hi Team,
I have a requirement to call a process model inside the button saveInto using a!startprocess function. But when i am using the function the variables declared inside the button saveInto are not updating.
Any Idea on how to fix this issue.
Thanks in Advance
Discussion posts and replies are publicly visible
Can you share your code?
Hi Stefan,
Please find the below sample code. Actually the issue is happening whenever is interface is called from top parent rule.
Actually in the start process we are passing the document data to some external system.
But when the start process is using inside the button save Into then the button value (ri!buttonAction) is not getting updated but whenever i try to test the same interface by commenting the start process function the button saveInto are updating properly
Please let me know if any other extra information is required
a!buttonWidget( label: "SUBMIT", value: "SUBMIT", saveInto: { ri!buttonAction, rule!SK_UpdateCaseData( caseDataControls: ri!lockScreenDetails ), a!startProcess( processModel: cons!SK_PM_LOCK_SCREEN_DETAILS, processParameters: { lockScreenDetails: ri!lockScreenDetails, lockScreenId: ri!lockScreenId } ), a!save( target: { ri!buttonAction, ri!lockScreenDetails, ri!lockScreenId }, value: null ) })
Jepp ... you are overwriting the value.
Next time, please ...
Before clicking on the button the value is "NEXT" and it is still holding the same value "NEXT" after clicking on the button as well. The value is not updating to "SUBMIT" or null.
If i comment the startprocess function inside the button saveInto then the value is updating to null as per the code.
I am facing the issue whenever the a!startprocess function is added inside the button saveInto.
What is this SK_UpdateCaseData expression doing?
It is updating the status, updatedBy, updatedDate and some other fields inside the CDT. Actually if i comment only the startprocess function and keep rest all other logic as it is the code works fine.
The way you use this expression seems weird. I would expect something like:
saveInto: { ri!buttonAction, a!save( target: ri!lockScreenDetails, value: rule!SK_UpdateCaseData( caseDataControls: ri!lockScreenDetails ) ), a!startProcess(
Actually the a!save(ri!lockScreenDetails, type!SK_case()) is added in the expression rule(SK_UpdateCaseData). Actually the problem is not with the expression rule it is with the start process. I can remove the SK_UpdateCaseData but the issue still exist with the code. I feel like since the process is making integration calls it might be the reason but not completely sure
Did you try to put the a!save following the a!startProcess() into the onSuccess parameter of a!startProces()?
No. But the process is triggered and completed without any errors when i check the instances.