Datatype classes are used to define object properties, they allow to:

  • Validate values both generic (for example any defined %Integer property by default checks that it's value is an integer) and based on datatype parameters (for example you can have an %Integer(MINVAL=0, MAXVAL=9) property which in addition to checking that it's value is an integer would check that integer value is between 0 and 9)
  • Provide different representations based on context, specifically:
    • Logical (what's stored in globals)
    • Display (what's shown in object)
    • XSD (for XML export/import)
    • ODBC (returned in SQL)
  • Provide generators for utility methods. Article on some examples.

Docs.

Here's an example:

Class User.Assert Extends Ens.BusinessProcess [ ClassType = persistent, Language = objectscript ]
{

Method OnRequest(pRequest As Ens.Request, Output pResponse As Ens.Response) As %Status
{
    Set pResponse = ##class(Ens.Response).%New()
    
    $$$LOGINFO("$$$ASSERT(1)")
    $$$ASSERT(1) // skipped
    
    $$$LOGINFO("$$$LOGASSERT(1)")
    $$$LOGASSERT(1)
    
    $$$LOGINFO("$$$ASSERT(0)")
    $$$ASSERT(0)
    
    $$$LOGINFO("$$$LOGASSERT(0)")
    $$$LOGASSERT(0)

    Quit $$$OK
}
}

This way then:

<call name='To application Rest' target='To application REST' async='0'>
  <request type='EnsLib.REST.GenericMessage' >
    <assign property="callrequest.Stream" value='##class(%Stream.GlobalCharacter).%New()'/>
    <assign property="status"  value='callrequest.Stream.CopyFrom(request.StreamFC)' action="set" />
    <assign property="status"  value='callrequest.HTTPHeaders.SetAt("application/xml", "Content-Type")' action="set" />
    <assign property="status"  value='callrequest.HTTPHeaders.SetAt(callrequest.Stream.Size, "Content-Length")' action="set" />
    <assign property="status"  value='callrequest.HTTPHeaders.SetAt("POST", "HttpRequest")' action="set" />
  </request>
</call>

I would like to know if I can move only user database or default databases as well??

All databases can be moved

what sort of permission do I need to change for new directory path

irisusr should have RW access to the folder. The easiest way is to check what access (owner, group, permissions) is set for existing files/folders and then recreate the same in a new location.

and what all files I need to copy at new location??

IRIS.DAT and stream subfolder if it exist.

Please suggest if modification in iris.cpf file can do this all operation  

Absolutely.

1. Install InterSystems IRIS.

2. Shut it down.

3. Open <iris>/iris.cpf, there you will find:

[Databases]
USER=C:\InterSystems\IRIS\Mgr\user\

[Journal]
AlternateDirectory=C:\InterSystems\IRIS\Mgr\journal\
CurrentDirectory=C:\InterSystems\IRIS\Mgr\journal\

[config]
wijdir=C:\InterSystems\IRIS\Mgr\WIJ

4. Edit this file as you wish and move the corresponding directories.

5. Start InterSystems IRIS.