Entity (Base Server)

An entity is the fundamental business object in IFS Cloud. It maps to an Oracle database table and generates:

  • An Oracle view (<ENTITY_NAME> in uppercase snake_case)
  • A PL/SQL API package (<EntityName>_API)
  • A PL/SQL implementation package body (<EntityName>_SVC in IFS Cloud generation)

The entity model file (.entity) is edited in IFS Developer Studio. It is displayed in a text-like editor but stored as XML. Do not edit the file outside the IDE.

Syntax Skeleton

[@Final]
entityname  <EntityName>;
component   <COMPONENT>;
[layer      <Ext|Cust>;]
[basedOn    <OtherEntity>;]
[description "<text>";]
[validity   <ValidityMethod>;]
 
[codegenproperties {
   <Property> "<value>";
}]
 
attributes {
   key        <Name>  <Datatype>[(<size>)]  <Flags>;
   [parentkey <Name>  <Datatype>[(<size>)]  <Flags>;]
   public     <Name>  <Datatype>[(<size>)]  <Flags>;
   private    <Name>  <Datatype>[(<size>)]  <Flags>;
}
 
[associations {
   parent    <RefName>  <ToEntity>(<FK_Columns>)[/<DeleteBehaviour>] { }
   reference <RefName>  <ToEntity>(<FK_Columns>)[/<DeleteBehaviour>] { }
}]
 
[states {
   startstate { always transitionTo <FirstState>; }
   state <StateName> {
      on <Event> transitionTo <NextState>;
   }
   endstate <StateName> { }
}]

Header Keywords

KeywordRequiredDescription
@FinalNoPrevents other entities from extending this one. Place before entityname.
entitynameYesThe LU name. Must match the filename without .entity. PascalCase.
componentYesThe IFS component that owns this LU (e.g., SHPORD, CONFIG).
layerCust onlyExt or Cust for customization files. Omit for Core.
basedOnNoIndicates this entity inherits conceptually from another. Limited runtime effect β€” mostly a documentation marker.
extendsNoExtends another entity as a parent in the hierarchy.
permitsNoDeclares that another entity is permitted as a child.
descriptionNoAppears in Business Object tooling. No runtime effect.
validityNoControls how record validity is determined (e.g., for date-range validity).

attributes Block

Every attribute in the entity maps to a column in the generated view and table.

attributes {
   key        ActorId    NUMBER(10)   KMI-L;
   parentkey  CountryCode TEXT(2)     KMI-L;
   public     FirstName  TEXT(100)    AMIUL;
   public     LastName   TEXT(100)    A-IUL;
   public     BirthDate  DATE         A-IUL;
   public     IsActive   TEXT(1)      A;
   private    InternalRef NUMBER(10)  --I--;
}

Attribute Visibility

KeywordGenerated asDescription
keyPrimary key columnMust be unique and non-null. Usually a NUMBER(10) sequence.
parentkeyPart of a composite key from a parent entityKey column that comes from a parent association.
publicRegular column, exposed via the APIThe most common type. Accessible from projections.
privateColumn that exists but is not exposed by defaultInternal use; requires explicit API exposure.

Attribute Data Types

TypeOracle equivalentUsage
TEXT(n)VARCHAR2(n)Most common. Use for all string data.
NUMBER(n) or NUMBER(n,d)NUMBER(n) or NUMBER(n,d)Integer or decimal.
DATEDATEDate without time. IFS stores times in DATE columns despite the type name.
BOOLEANVARCHAR2(5)Stored as 'TRUE' or 'FALSE' strings.
BINARYBLOBBinary large object.
CLOBCLOBCharacter large object for long text.

Attribute Control Flags

The flag string (e.g., AMIUL, KMI-L) controls read/write behaviour. See Attribute Control Flags for the full reference.

Common patternMeaning
KMI-LKey β€” Mandatory, Insert, not Updateable, LOV
AMIULAlter β€” Mandatory, Insert, Update, LOV (fully editable required field)
A-IULAlter β€” optional, Insert, Update, LOV (fully editable optional field)
A----Alter (display only β€” set programmatically)
--I--Insert only β€” never displayed or updated

associations Block

Associations define foreign key relationships to other entities.

associations {
   parent    CountryRef     IsoCountry(CountryCode)/CASCADE          { }
   reference AgencyRef      Agency(AgencyId)/NOCHECK                 { }
   reference DirectorRef    Actor(ActorId)/CUSTOM=(Validate_Dir__,)  { }
   reference GenreRef       MovieGenre(GenreCode)/CUSTOMLIST=(Check_Genre,Remove_Genre) { }
}

Association Types

KeywordDescription
parentMandatory FK to a parent entity. Cascade behaviour controls what happens when the parent is deleted.
referenceOptional FK to another entity. Used for lookups and LOV dropdowns in the projection/client layer.
viewreferenceReference to a view rather than a full entity.

Delete Behaviour Suffixes

SuffixDescription
/CASCADEDeletes child records when the referenced parent is deleted.
/NOCHECKNo referential integrity check. The FK is advisory only.
/RESTRICTPrevents deletion of the parent if children exist.
/CUSTOM=(ProcName,)Calls a custom PL/SQL procedure to validate the reference.
/CUSTOMLIST=(CheckProc,RemoveProc)Calls separate procedures to check and remove.

states Block

The state machine controls the lifecycle of the entity’s records.

states {
   startstate {
      always transitionTo Active;        -- first created record always goes to Active
   }
 
   state Active {
      on Suspend transitionTo Suspended;
      on Retire  transitionTo Retired;
   }
 
   state Suspended {
      on Resume  transitionTo Active;
      on Retire  transitionTo Retired;
   }
 
   superstate Released {                 -- superstate wraps multiple sub-states
      substate Printed  { }
      substate Invoiced { }
      on Cancel transitionTo Cancelled;  -- transition applies to all sub-states
   }
 
   endstate Retired  { }                 -- end states cannot be left
   endstate Cancelled { }
}

State Keywords

KeywordDescription
startstateThe pseudo-state at creation time. Use always transitionTo <State> to set the initial state.
stateA regular state. Uses on <Event> transitionTo <State> for transitions.
superstateA parent state that contains substate blocks. Transitions on the superstate apply to all sub-states.
substateA state nested inside a superstate.
endstateA terminal state. Records in an end state cannot be transitioned further.

State Field in the Database

The state is stored as a VARCHAR2 column named ROWSTATE in the database table. The PL/SQL API generates Finite_State_Machine___ and transition procedures automatically from the model.


codegenproperties Block

An optional block that passes hints to the code generator.

codegenproperties {
   DbObjversionStyle "number";    -- use a number for optimistic locking instead of string
   TitleText "Actor Management";  -- display title for this entity
}

Example β€” Complete Entity

entityname  Movie;
component   APPS8;
layer       Core;
description "Motion picture entity";
 
attributes {
   key       MovieId        NUMBER(10)    KMI-L;
   public    Title          TEXT(200)     AMIUL;
   public    ReleaseDate    DATE          A-IUL;
   public    DirectorId     NUMBER(10)    A;
   public    Duration       NUMBER(5)     A;
   public    Budget         NUMBER(15,2)  A;
   public    BoxOffice      NUMBER(15,2)  A;
   public    Synopsis       TEXT(2000)    A;
   public    IsReleased     TEXT(1)       A;
}
 
associations {
   parent    StudioRef     Studio(StudioId)/CASCADE                          { }
   reference DirectorRef   Actor(ActorId)/CUSTOM=(Validate_Director__,)      { }
   reference GenreRef      MovieGenre(GenreCode)/CUSTOMLIST=(Check_Genre,Remove_Genre) { }
}
 
states {
   startstate { always transitionTo PreProduction; }
   state PreProduction { on StartProduction transitionTo InProduction; }
   state InProduction  { on Finish transitionTo PostProduction; }
   state PostProduction {
      on Approve transitionTo Released;
      on Reject  transitionTo InProduction;
   }
   endstate Released  { }
   endstate Archived  { }
}

What Gets Generated

When you build the entity, Developer Studio generates:

Generated fileContent
<EntityName>.plsqlThe <EntityName>_API package specification and skeleton body
<ENTITY_NAME>.viewsThe <ENTITY_NAME> Oracle view definition
<EntityName>.storageThe <ENTITY_NAME_TAB> table DDL

You hand-code the business logic inside the generated .plsql skeleton. The generated code establishes the contract; your code implements it.


Patterns & Tips

Key Attributes Are Always NUMBER(10) with a Sequence

By IFS convention, every entity has a single key ActorId NUMBER(10) KMI-L; backed by an Oracle sequence named <ENTITY_NAME>_SEQ. Composite natural keys are expressed via parentkey (for inherited FK keys) plus the local key column.

TEXT(1) for Boolean-like Flags

IFS stores boolean flags as TEXT(1) with values 'Y'/'N' or TEXT(5) as 'TRUE'/'FALSE'. The BOOLEAN data type in the model generates VARCHAR2(5) in the database.

Do Not Edit .entity Files Outside the IDE

The file is XML. Opening it in a text editor shows angle-bracket XML, not the clean text-like syntax shown in the Developer Studio editor. Editing the raw XML will corrupt the model.

Difference from Projection Entity

The base server entity (.entity file) is the source of truth for the Logical Unit. The projection entity (inside a .projection file) is a client-facing view of that LU β€” it exposes only the attributes the Aurena UI needs and adds computed attributes, references for LOVs, and inline actions. They are different things with the same keyword.


See Also