Custom Function Plugin

Certified Lead Developer

Hello,


I see the below error while executing the custom plugin function. I verified the connection and third-party credentials, and it all looks correct.

Could anyone please help me understand what the issue could be?

Error: (Expression evaluation error in rule 'cbg_po_eds_addmerchant' at function fn!cmpo_eds_ws_getbotwinstitution [line 3]: Unable to find a required instance of SecureCredentialsStore.) (Data Outputs)

Server Log: 

2022-05-20 21:36:25,659 [Appian Work Item - 173086 - execution05 : ExpressionGroupRequest] ERROR com.appiancorp.process.engine.ExpressionGroup - An error occurred while evaluating expression: addMerchantResponse:rule!CBG_PO_EDS_addMerchant(requestId_int: pv!requestId_int, billingAccount: pv!billingAccount, customer:pv!customer, customerMailAddress: pv!customerMailAddress, appianPrdId: pv!appianPrdId ) (Expression evaluation error in rule 'cbg_po_eds_addmerchant' at function fn!cmpo_eds_ws_getbotwinstitution [line 3]: Unable to find a required instance of SecureCredentialsStore.) com.appiancorp.core.expr.exceptions.ExpressionRuntimeException$AppianExceptionProvider: Expression evaluation error in rule 'cbg_po_eds_addmerchant' at function fn!cmpo_eds_ws_getbotwinstitution [line 3]: Unable to find a required instance of SecureCredentialsStore. (APNX-1-4198-000) at com.appiancorp.core.expr.exceptions.ExpressionRuntimeException.<init>(ExpressionRuntimeException.java:105) at com.appiancorp.core.expr.exceptions.AppianScriptException.<init>(AppianScriptException.java:28) at com.appiancorp.core.expr.exceptions.ParseException.<init>(ParseException.java:23) at com.appiancorp.core.expr.exceptions.FunctionException.<init>(FunctionException.java:18) at com.appiancorp.core.expr.exceptions.FunctionException.create(FunctionException.java:30) at com.appiancorp.core.expr.exceptions.FunctionException.create(FunctionException.java:27) at com.appiancorp.core.expr.FunctionCallDelegate$ExternalFunctionCallWithContext.eval(FunctionCallDelegate.java:338) at com.appiancorp.core.expr.FunctionCallDelegate.evalCacheableFunctionCall(FunctionCallDelegate.java:138) at com.appiancorp.core.expr.FunctionCallDelegate.evalFunctionCall(FunctionCallDelegate.java:103) at com.appiancorp.core.expr.AppianScriptContextTop.evalExternalFunction(AppianScriptContextTop.java:499) at com.appiancorp.core.expr.AppianScriptContextChild.evalExternalFunction(AppianScriptContextChild.java:294) at com.appiancorp.core.expr.tree.FunctionCall$ExternalEvaluable.eval0(FunctionCall.java:798) at com.appiancorp.core.expr.DefaultEvaluable.eval(DefaultEvaluable.java:207) at com.appiancorp.core.expr.FunctionCallDelegate$InternalFunctionCallWithContext.eval(FunctionCallDelegate.java:282) at com.appiancorp.core.expr.FunctionCallDelegate.evalFunctionCall(FunctionCallDelegate.java:105) at com.appiancorp.core.expr.AppianScriptContextTop.evalInternalFunction(AppianScriptContextTop.java:476) at com.appiancorp.core.expr.AppianScriptContextChild.evalInternalFunction(AppianScriptContextChild.java:282) at com.appiancorp.core.expr.tree.FunctionCall.evalImmediate(FunctionCall.java:579) at com.appiancorp.core.expr.tree.FunctionCall.evalEvaluable(FunctionCall.java:529) at com.appiancorp.core.expr.tree.FunctionCall.evalWrapped(FunctionCall.java:639) at com.appiancorp.core.expr.Tree.eval(Tree.java:360) at com.appiancorp.core.expr.Tree.eval0(Tree.java:345) at com.appiancorp.core.expr.Tree.eval(Tree.java:322) at com.appiancorp.core.expr.Tree.evalAndAllowBind(Tree.java:404) at com.appiancorp.core.expr.tree.LoadAssignment.evalLet(LoadAssignment.java:121) at com.appiancorp.core.expr.tree.AbstractLetAssignment.eval(AbstractLetAssignment.java:72) at com.appiancorp.core.expr.tree.AbstractLetFunction.executeSerial(AbstractLetFunction.java:365) at com.appiancorp.core.expr.tree.AbstractLetFunction.processBindings(AbstractLetFunction.java:351) at com.appiancorp.core.expr.tree.AbstractLetFunction.eval00(AbstractLetFunction.java:92) at com.appiancorp.core.expr.tree.Load.eval0(Load.java:104) at com.appiancorp.core.expr.tree.TreeEvaluable.evalWrapped(TreeEvaluable.java:107) at com.appiancorp.core.expr.Tree.eval(Tree.java:360) at com.appiancorp.core.expr.tree.SpecialFunction.eval0(SpecialFunction.java:108) at com.appiancorp.core.expr.Tree.eval(Tree.java:322) at com.appiancorp.core.expr.rule.Rule.evalBody(Rule.java:1441) at com.appiancorp.core.expr.rule.Rule.doEval(Rule.java:838) at com.appiancorp.core.expr.rule.Rule.eval(Rule.java:724) at com.appiancorp.core.expr.rule.Rule.eval(Rule.java:618) at com.appiancorp.core.expr.rule.Rule.evalWithMetrics(Rule.java:606) at com.appiancorp.core.expr.rule.Rule.eval(Rule.java:592) at com.appiancorp.core.expr.tree.FreeformRule.evalWrapped(FreeformRule.java:159) at com.appiancorp.core.expr.Tree.eval(Tree.java:360) at com.appiancorp.core.expr.tree.FreeformRule.eval0(FreeformRule.java:132) at com.appiancorp.core.expr.Tree.eval(Tree.java:322) at com.appiancorp.core.expr.Parse.evalInner(Parse.java:385) at com.appiancorp.core.expr.Parse.eval(Parse.java:344) at com.appiancorp.core.expr.Parse.eval(Parse.java:329) at com.appiancorp.core.expr.AppianScriptEngine.eval(AppianScriptEngine.java:79) at com.appiancorp.process.engine.ExpressionGroup.eval(ExpressionGroup.java:273) at com.appiancorp.process.engine.ExpressionGroup.eval(ExpressionGroup.java:332) at com.appiancorp.process.engine.ExpressionGroupRequest.execute0(ExpressionGroupRequest.java:106) at com.appiancorp.common.persistence.data.AppianDataUserContextProvider.executeWithConsistentDataReads(AppianDataUserContextProvider.java:116) at com.appiancorp.process.engine.ProcessContinuationRequest.executeOuter(ProcessContinuationRequest.java:68) at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:124) at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36) at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:94) at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:239) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: com.appiancorp.suiteapi.common.exceptions.AppianException: Unable to find a required instance of SecureCredentialsStore. (APNX-1-4158-006) at com.appiancorp.process.expression.CustomFunction.evaluate(CustomFunction.java:709) at com.appiancorp.process.expression.CustomFunction.evalDynamic0(CustomFunction.java:246) at com.appiancorp.process.expression.CustomFunction.lambda$evalDynamic$0(CustomFunction.java:238) at com.appiancorp.plugins.PluginUsageLogger.callWithPluginInformation(PluginUsageLogger.java:39) at com.appiancorp.process.expression.CustomFunction.evalDynamic(CustomFunction.java:237) at com.appiancorp.process.expression.CustomFunction.eval0(CustomFunction.java:206) at com.appiancorp.core.expr.DefaultEvaluable.eval(DefaultEvaluable.java:207) at com.appiancorp.process.expression.ExpressionEvaluator.evaluate(ExpressionEvaluator.java:314) at com.appiancorp.core.expr.FunctionCallDelegate$ExternalFunctionCallWithContext.evaluateCustomerPluginFunction(FunctionCallDelegate.java:385) at com.appiancorp.core.expr.FunctionCallDelegate$ExternalFunctionCallWithContext.lambda$doCallWithMetrics$0(FunctionCallDelegate.java:359) at com.appiancorp.sail.ServerTracer.traceOperationWithCheckedException(ServerTracer.java:45) at com.appiancorp.core.expr.FunctionCallDelegate$ExternalFunctionCallWithContext.doCallWithMetrics(FunctionCallDelegate.java:357) at com.appiancorp.core.expr.FunctionCallDelegate$ExternalFunctionCallWithContext.eval(FunctionCallDelegate.java:330)

Snippet where it is failing: 

public static void main(String[] args) {

 

             ServiceContext sc = null;

             SecureCredentialsStore credentialStore = null;

             String authenticationKey = null;

             String serviceURL = "">">test:8080.asmx";  --> Dummy URL here

             CMPO_GetBoTWInstitution obj = new CMPO_GetBoTWInstitution();

             BWCMPOEDSDGConfigInstitution botwInstitute = obj

                          .CMPO_EDS_WS_GetBoTWInstitution(sc, credentialStore,

                                       authenticationKey, serviceURL, "TEST");

             System.out.println("BoTW Institutiion id is "

                          + botwInstitute.getInstitutionId());

  

Thank You.

  Discussion posts and replies are publicly visible