Legacy Knowledge Base
Published Jun. 30, 2025

Issue with DynamicQuery for KaleoInstanceToken and DDMFormInstanceRecordVersion

Written By

Apsara Raheja

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • Below error was encountered while trying to use the 'Dynamic Query' in custom code:
    ERROR [http-nio-9090-exec-9][DynamicQueryFactoryImpl:83] Unable find model com.liferay.portal.workflow.kaleo.model.impl.KaleoInstanceTokenImpl
    java.lang.ClassNotFoundException: com.liferay.portal.workflow.kaleo.model.impl.KaleoInstanceTokenImpl
  • Usage of Dynamic Query in KaleoInstanceToken:
    // Create a dynamic query for KaleoInstanceToken
    DynamicQuery kaleoQuery = DynamicQueryFactoryUtil.forClass(KaleoInstanceToken.class, "kaleoInstanceToken", PortalClassLoaderUtil.getClassLoader());
    kaleoQuery.add(PropertyFactoryUtil.forName("classPK").eq(formInstanceRecordVersionId));
    kaleoQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId));

Environment

  • Liferay DXP 7.4

Resolution

  • There is no method declared related to the use of dynamic Query in the KaleoInstanceTokenUtil.java class.
    Refer: KaleoInstanceTokenUtil.java
  • To create the dynamic query, use the below method, which is present in this class (KaleoTaskInstanceLocalServiceUtil.java):
    public static DynamicQuery dynamicQuery() {
    return getService().dynamicQuery();
    }
    Refer: KaleoTaskInstanceTokenLocalServiceUtil.java

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base