On Failure, the Provisioning Transaction goes into Pending state and tries to Retry the transaction every 60 mins (by default). The retry happens as desired.
On Fixing the Configuration and Retried, the Transaction also gets success but the duplicate transaction which got created which has Identity Populated Still remains in Pending state.
@nihar_chaware Could you please click on Action button and see what all additional requests are there? Also, what is the source value in both provisioning transaction?
The Requests are for provisioning policy identity attributes like firstname, lastname, etc. in both provisioning transactions but the one which was success has result committed for that attribute while the one still in pending shows retry.
Also the source value is empty in both provisioning transaction.
Yes for testing I did manually retried but as I said the provisioning transactions were created twice with Pending status and only one of them showed retry option which on retry goes to success while the second one doesnt have retry option and stays in Pending status
Based on the code, I would focus on the Provisioner.execute(newPlan) call inside the AfterProvisioning rule.
The OOTB LCM flow manages retries through the Provision with Retries subprocess, where the retry project is merged back into the original provisioning project. Here you are creating and executing another plan separately, so it may not be tracked and merged with the original LCM project correctly. That would also explain why only one pending row has the Retry action.
I would create both application requests in the original plan before it is compiled. If the second application must run only after the first succeeds, launch it through a separate workflow and track it as a separate request. Before changing anything in the database, compare the project, request and workflow details of both transactions