Instance

Description

Functions to create and modify instances of type Concept

Categories

NameDescription
PropertyArrayUtility Functions to Operate on PropertyArray types of Concepts
PropertyAtomUtility functions to operate on PropertyAtom properties
ReflectionReflection method for Concept
StateMachineUtility functions to operate on StateMachines

Functions

NameSignature and Synopsis
createInstanceConcept createInstance (String xslt-template)
Creates a new Concept instance based on the data provided in the XSLT Mapper and adds it to the working memory. Adding the instance to the working memory will cause any rule conditions that depend on the concept to be evaluated.
createInstanceFromJSONConcept createInstanceFromJSON (String uri, String json)
This function creates a new Concept instance by deserializing the JSON data provided. The form of of the JSON data provided is expected to be the same as the output from serialize(). The new Concept instance is added to the working memory. Adding the instance to the working memory will cause any rule conditions that depend on the concept to be evaluated.
createInstanceFromXMLConcept createInstanceFromXML (String uri, String xml)
This function creates a new Concept instance by deserializing the XML data provided. If uri is null, then the URI will be inferred from the namespace in xml. The form of of the XML data provided is expected to be the same as the output from serialize(). The new Concept instance is added to the working memory. Adding the instance to the working memory will cause any rule conditions that depend on the concept to be evaluated.
createTransientInstanceFromEventConcept createTransientInstanceFromEvent (String uri, SimpleEvent event)
This function returns a concept instance using the payload from the event passed in the event parameter. The payload must adhere to the XML schema corresponding to the concept definition. The concept instance is not asserted (hence it is $1transient$1). You can then, for example, use the transient concept's property values to update an asserted concept's properties.
createTransientInstanceFromJSONConcept createTransientInstanceFromJSON (String uri, String json)
This function creates a new Concept instance by deserializing the JSON data provided. The form of of the JSON data provided is expected to be the same as the output from serialize(). The newly created Concept instance is NOT added to the working memory.
createTransientInstanceFromXMLConcept createTransientInstanceFromXML (String uri, String xml)
This function creates a new Concept instance by deserializing the XML data provided. If uri is null, then the URI will be inferred from the namespace in xml. The form of of the XML data provided is expected to be the same as the output from serialize(). The newly created Concept instance is NOT added to the working memory.
deleteInstanceConcept deleteInstance (Concept instance)
Retracts instance from the working memory and deletes it. Contained concept instances are also deleted. Referenced concept instances must be explicitly deleted
filterAndSerializeUsingDefaultsString filterAndSerializeUsingDefaults (Concept instance, String propertyNameRegexFilter)
Serializes a Concept instance into an XML String with the default namespace URI for concepts, and with the inclusion of properties controlled by a regex filter.
getByExtIdConcept getByExtId (String extId)
Returns the Concept instance identified by extId. Note: This method should not be used to load cache-only concepts into working memory for modifications, especially if they have not already been loaded in a pre-processor.
getByExtIdByUriConcept getByExtIdByURI (String extId, String uri)
Returns the Concept instance identified by extId and with URI matching URI or null if not found. Note: This method should not be used to load cache-only concepts into working memory for modifications, especially if they have not already been loaded in a pre-processor.
getByIdConcept getById (long Id)
Returns the Concept instance Concept instance identified by id. Note: This method should not be used to load cache-only concepts into working memory for modifications, especially if they have not already been loaded in a pre-processor.
getByIdByUriConcept getByIdByURI (long id, String uri)
Returns the Concept instance identified by id and with URI matching URI or null if not found. Note: This method should not be used to load cache-only concepts into working memory for modifications, especially if they have not already been loaded in a pre-processor.
getExpandedNameString getExpandedName (Concept instance)
Returns the fully qualified namespace URI for instance.
getReverseReferenceslong[] getReverseReferences(Concept instance)
Returns ids of all concepts which have concept reference properties that refer to instance.
getStateMachineOwnerConcept getStateMachineOwner (Concept instance)
Returns the owner Concept instance with which a state machine is associated. Returns null if instance is not a state machine.
isModifiedboolean isModified (Concept instance)
This function returns true if instance has been modified by a currently running RTC. This function will return false again once any of the modifying RTCs has ended.
isNewboolean isNew (Concept instance)
This function returns true if instance was created by a currently running RTC. It also returns true if instance has been configured for cache-only mode and has not been loaded into any current RTC.
isStateMachineboolean isStateMachine (Concept instance)
Checks if a concept is a state machine. Concepts that have state machines are state machine owners but are not state machines themselves.
newInstanceConcept newInstance (String uri, String extId)
Creates a new Concept instance of the type specified by uri and adds it to the working memory. Adding the instance to the working memory will cause any rule conditions that depend on the concept to be evaluated.
newTransientInstanceConcept newTransientInstance (String uri)
Creates a new Concept instance of the type specified by uri without adding it to the working memory. Thus no rules will be evaluated when this concept is created. Should be used when concept is intended to be used only as data holder without need for it to participate in Rete cycle.
serializeString serialize (Concept instance, boolean changedOnly, String nameSpace, String root)
Serializes a Concept instance into an XML string.
serializeToJSONString serializeToJSON (Concept instance, boolean pretty, String root)
Serializes a Concept instance into an JSON string.
serializeUsingDefaultsString serializeUsingDefaults (Concept instance)
Serializes a Concept instance into an XML string using the default namespace URI for Concepts.
startStateMachinevoid startStateMachine(Concept instance, boolean startChildren)
Start a Concept instance's main state machine, and optionally, the main state machines of its contained concepts.
updateInstancevoid updateInstance (String xslt-template)
Updates a Concept instance based on the data provided in the XSLT Mapper. Modifying the instance in the working memory will cause any rule conditions that depend on the concept to be evaluated.
updateInstanceFromJSONConcept updateInstanceFromJSON (String uri, String json)
Update a Concept instance with data contained in an JSON serialization of concept data. The Concept instance to be updated is identified by an extId attribute in the serialized concept data. An Exception will be thrown if the extId provided does not match any existing Concept instance.
updateInstanceFromXMLConcept updateInstanceFromXML (String xml)
Update a Concept instance with data contained in an XML serialization of concept data. The Concept instance to be updated is identified by an extId attribute in the serialized concept data. An Exception will be thrown if the extId provided does not match any existing Concept instance.