Getting the following error while trying to execute a Query Rule, Exp

Getting the following error while trying to execute a Query Rule,

Expression evaluation error in rule 'ct_getcustomercommunicationdetails' at function 'queryruleexec': Error evaluating function 'queryruleexec' : Unexpected error executing query (type: [CTCustomerCommunicationDetailsDT1367], query: [CT_getCustomerCommunicationdetails], order by: [[]], filters:[((active = TypedValue[it=1,v=1]) AND (customerEmail.email = TypedValue[it=3,v=random@google.com]) AND (customerPhone.phoneNumber = TypedValue[it=3,v=34567890]) AND (customerAddress.partyAddress.streetName = TypedValue[it=3,v=Collingwood]) AND (customerAddress.partyAddress.suburb = TypedValue[it=3,v=Birkdale]))])

Server log,
Caused by: com.appiancorp.suiteapi.common.exceptions.AppianRuntimeException: com.appiancorp.suiteapi.common.exceptions.AppianException

Please provide your suggestions...

OriginalPostID-127769

OriginalPostID-127769

  Discussion posts and replies are publicly visible

  • Please attach the full application-server.log
  • Hi, Please find below,

    ERROR com.appiancorp.suiteapi.content.ContentAccess - An error occurred while trying to test the rule: [Content:id=null,name=asdasd,type=32,subtype=1,visibility=35,security=143,attributes={dep_functions=[Ljava.lang.String;@535426f6, dep_rules=[Ljava.lang.Long;@39ca0b37, definition==#"bcdd6a6e-ac66-4fc9-af76-76ac99112480"(1,"random@google.com","34567890","Collingwood","Birkdale","","",""), dep_types=[Ljava.lang.String;@7fa66584, dep_variables=[[Ljava.lang.String;@552fe95}]
    13:22:01,063 INFO [stdout] (ajp-/0.0.0.0:8009-6) com.appiancorp.process.expression.ExpressionRuntimeException$AppianExceptionProvider: Expression evaluation error in rule 'ct_getcustomercommunicationdetails' at function 'queryruleexec': Error evaluating function 'queryruleexec' : Unexpected error executing query (type: [CTCustomerCommunicationDetailsDT1367], query: [CT_getCustomerCommunicationdetails], order by: [[]], filters:[((active = TypedValue[it=1,v=1]) AND (customerEmail.email = TypedValue[it=3,v=random@google.com]) AND (customerPhone.phoneNumber = TypedValue[it=3,v=34567890]) AND (customerAddress.partyAddress.streetName = TypedValue[it=3,v=Collingwood]) AND (customerAddress.partyAddress.suburb = TypedValue[it=3,v=Birkdale]) AND (customerAddress.partyAddress.addressLine1 = TypedValue[it=3,v=]) AND (customerAddress.partyAddress.addressLine2 = TypedValue[it=3,v=]) AND (customerAddress.partyAddress.addressLine3 = TypedValue[it=3,v=]))]) (APNX-1-4198-000)
    13:22:01,063 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.process.expression.ExpressionRuntimeException.<init>(ExpressionRuntimeException.java:65)
    13:22:01,063 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.exceptions.AppianScriptException.<init>(AppianScriptException.java:24)
    13:22:01,063 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.exceptions.ParseException.<init>(ParseException.java:20)
    13:22:01,063 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.exceptions.FunctionException.<init>(FunctionException.java:13)
    13:22:01,063 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.AppianScriptContextTop.evalExternalFunction(AppianScriptContextTop.java:437)
    13:22:01,063 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.AppianScriptContextChild.evalExternalFunction(AppianScriptContextChild.java:211)
    13:22:01,063 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.tree.FunctionCall$ExternalEvaluable.eval0(FunctionCall.java:500)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.Evaluable.eval(Evaluable.java:165)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.tree.FunctionCall.evalEvaluable(FunctionCall.java:286)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.tree.FunctionCall.eval0(FunctionCall.java:328)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.Tree.eval(Tree.java:183)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.rule.Rule.eval(Rule.java:322)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.rule.Rule.eval(Rule.java:251)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.rule.Rule.eval(Rule.java:239)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.tree.FreeformRule.eval(FreeformRule.java:84)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.tree.FreeformRule.eval0(FreeformRule.java:43)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.Tree.eval(Tree.java:183)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.Parse.evalInner(Parse.java:271)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.Parse.eval(Parse.java:232)
    13:22:01,064 INFO [stdout] (ajp-/0.0.0.0:8009-6)           at com.appiancorp.core.expr.Parse.eval(Parse.java:217
  • Can you also attach your XSD please?

    The relevant cause by is the one below and seems to be associated with your annotations in the XSD

    13:22:01,074 INFO [stdout] (ajp-/0.0.0.0:8009-6) Caused by: org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags
  • I believe you will need to use the @JoinColumn annotation with the @OneToOne annotation, rather than @OneToMany. From our documentation:

    The @JoinColumn annotation is used in conjunction with the @OneToOne annotation for two reasons:

    1) To give an explicit name to the column in the Employee table that references the SecurityAccessCard.
    2) To indicate that value in that column must be unique, which establishes the bi-directional, one-to-one relationship. Without the uniqueness constraint, one SecurityAccessCard could belong to more than one Employee.
    @JoinColumn(name="card_id", nullable=false, unique=true)

    Please take a look here for more information:
    forum.appian.com/.../Defining_a_Custom_Data_Type.html
  • Got the same error . cannot simultaneously fetch multiple bags .Communication details Cdt changed. attached the error log and XSD of the cdt. So Please provide your suggestions.

    CTCustomerCommunicationDetails.xsd

    logerroronnov06.txt

  • That CDT is also using the @JoinColumn annotation with the @OneToMany annotation, which will cause issues as I mentioned above. I do not think these two annotations will be compatible