Hi everyone,
I'm building a REST integration on IFS 10 for a leave management application. I wanted to share an issue I'm running into and the steps I've taken so far, and hopefully get some input from anyone who has dealt with a similar setup.
Scenario
I created a custom view (EMPLOYEE_SUMMARY) that joins employee data from COMPANY_PERSON_CFV with leave data from TRIFM_IZINLER4. The view also exposes a custom field I added, CF$_SUPERVISOR_NO, which is defined as a Reference type.
I then exposed this view through a projection query as a REST endpoint.
Problem
- After deploying the projection, the endpoint works for a while and returns correct results.
- After some time, the same endpoint stops responding entirely — the request hangs and eventually times out.
- When this happens, I checked
v$sessionand there's no active query hitting Oracle at all — so the request is getting stuck somewhere in the middleware layer. - Redeploying brings it back temporarily, but the same cycle repeats.
Additionally, filtering on SupervisorNo (the Reference custom field) seems to be what triggers the hang — when I call the endpoint with ?$filter=SupervisorNo eq 'XXXXXXX', no response comes back at all (the request just hangs). Filtering on other attributes like EmployeeNo works fine. Running the exact same filter directly against the view in Oracle returns the correct rows in seconds.
What I've tried so far
- Marked the custom field as "Indexed" via IFS Solution Manager. The index was created on
COMPANY_PERSON_CFTas expected. - Analyzed the execution plan. Since
CF$_SUPERVISOR_NOis a Reference type, the column actually stores a rowkey (hex UUID), and theREF_CF$_SUPERVISOR_NOwrapper function resolves it to the human-readable value at runtime. This function is notDETERMINISTIC, so a function-based index isn't allowed either. - Rewrote the view with
COMPANY_PERSON_CFVas the driving table — query time in Oracle dropped to around 2 seconds. - Collapsed the three PL/SQL function calls (
Get_Total_Leave_Entitlement,Get_Total_Leave_Used,Get_Remaining_Leave) into a single LEFT JOIN againstTRIFM_IZINLER4, since all three were querying the same table with the same predicate.
So the database side looks fine. Something is happening on the projection/middleware side.
Query and View
Projection query:
query QryEmployeeSummary {
from = "EMPLOYEE_SUMMARY";
attribute FirstName Text;
attribute LastName Text;
attribute EmployeeNo Text;
attribute SupervisorNo Text;
attribute CompanyName Text;
attribute DepartmentName Text;
attribute PositionName Text;
attribute Entitlement Number;
attribute Used Number;
attribute Remaining Number;
}View:
sql
VIEW Employee_Summary IS
SELECT a.FNAME AS FIRST_NAME,
a.LNAME AS LAST_NAME,
a.EMP_NO AS EMPLOYEE_NO,
a.CF$_SUPERVISOR_NO AS SUPERVISOR_NO,
company_api.get_name(a.COMPANY_ID) AS COMPANY_NAME,
COMPANY_ORG_API.Get_Org_Name(a.company_id, a.ORG_CODE) AS DEPARTMENT_NAME,
COMPANY_POSITION_API.Get_Position_Title(a.company_id, a.POS_CODE) AS POSITION_NAME,
iz.toplam_hakettigi_izin AS ENTITLEMENT,
iz.toplam_kullandigi_izin * -1 AS USED,
iz.kalan_izin AS REMAINING
FROM IFSAPP.COMPANY_PERSON_CFV a
LEFT JOIN IFSAPP.TRIFM_IZINLER4 iz
ON iz.company_id = a.COMPANY_ID
AND iz.emp_no = a.EMP_NO
AND iz.rapor_tarihi = TRUNC(SYSDATE);Questions
- Is it better practice to define a Custom Logical Unit first and expose the projection through that, rather than pointing the projection at a raw view? Could this "works for a while, then breaks" behavior be related to metadata caching when the underlying view isn't tied to an LU?
- Is filtering on Reference-type custom fields actually supported through projections out of the box, or is there something special I need to declare in the attribute definition to make it filterable?
- Has anyone got a similar setup working (custom view + custom field + REST endpoint)? What's the recommended pattern?
Environment: IFS 10.
Thanks in advance for any input.