Skip to content

Commit

Permalink
LPD-34312 Execute the function object action on commit callback
Browse files Browse the repository at this point in the history
  • Loading branch information
carolmariaabb authored and brianchandotcom committed Aug 26, 2024
1 parent f74da96 commit ce6cbdc
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.liferay.portal.configuration.metatype.bnd.util.ConfigurableUtil;
import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.service.CompanyLocalService;
import com.liferay.portal.kernel.transaction.TransactionCommitCallbackUtil;
import com.liferay.portal.kernel.util.Http;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.UnicodeProperties;
Expand Down Expand Up @@ -47,13 +48,19 @@ public void execute(
JSONObject payloadJSONObject, long userId)
throws Exception {

_portalCatapult.launch(
_companyId, Http.Method.POST,
_functionObjectActionExecutorImplConfiguration.
oAuth2ApplicationExternalReferenceCode(),
payloadJSONObject,
_functionObjectActionExecutorImplConfiguration.resourcePath(),
userId);
TransactionCommitCallbackUtil.registerCallback(
() -> {
_portalCatapult.launch(
_companyId, Http.Method.POST,
_functionObjectActionExecutorImplConfiguration.
oAuth2ApplicationExternalReferenceCode(),
payloadJSONObject,
_functionObjectActionExecutorImplConfiguration.
resourcePath(),
userId);

return null;
});
}

@Override
Expand Down

0 comments on commit ce6cbdc

Please sign in to comment.