Add additional properties to an Asset or Asset's Field
The ol set property command lets you manually assign a property to an asset metadata model. In the usual case, the parser automatically generates all the asset model properties by parsing the data source. However, if a required property is not included in the data source, you can add it to the asset metadata model with the help of this command.Â
The command inserts the added properties wrapped in the additionalAttributes object at one of two possible locations within the asset metadata model hierarchy: at the asset level or the input or output entity definitions under a specified field.
At the asset or entity level:Â
{
"id": "f54e33df-6ec4-4e5f-96d4-ad9f9fa71636",
"name": "oactcs9",
"path": "OACTCS9",
"additionalAttributes": {
"param-1": "value1",
"param-2": "value2",
},
"inputEntityDefinition": {
...
},
"inputEntityDefinition": {
...
},
}
At the input or output entities under a specified field:
{
"id": "f54e33df-6ec4-4e5f-96d4-ad9f9fa71636",
"name": "oactcs9",
"path": "OACTCS9",
"inputEntityDefinition": {
"class": "org.openlegacy.core.model.entity.RpcEntityDefinitionImpl",
"id": "7b2846af-36ea-42a0-ac5f-d5fa6b08fea4",
"name": "Oactcs9",
"qualifiedName": "com.openlegacy.entity.oactcs9.Oactcs9",
"fieldDefinitions": {
"dfhcommarea": {
"class": "org.openlegacy.core.model.field.RpcClassFieldDefinition",
"name": "dfhcommarea",
"javaType": "com.openlegacy.entity.dfhcommarea.Dfhcommarea",
"displayName": "Dfhcommarea",
"originalName": "DFHCOMMAREA",
"fields": {
"inPut": {
"class": "org.openlegacy.core.model.field.RpcClassFieldDefinition",
"name": "inPut",
"javaType": "InPut",
"displayName": "Input",
"originalName": "IN-PUT",
"fields": {
"actiAccountId": {
"class": "org.openlegacy.core.model.field.RpcStringFieldDefinition",
"name": "actiAccountId",
"displayName": "Actiaccountid",
"length": 11,
"originalName": "ACTI-ACCOUNT-ID",
"legacyType": "org.openlegacy.core.model.legacy.type.MainFrameLegacyTypes.Char",
"additionalAttributes": {
"param-1": "value1",
"param-2": "value2",
}
},
"actiCustomerId": {
...
},
Syntax
ol set property [OPTIONS]
Options
--property
The key and value of the assigned property
--property test foo
--asset (required)
The name of the asset to which the property is assigned.
--asset oactcs9
--field
The full-path asset field under which the property is added. If omitted, the properties will be added to the asset level.
--field oactcs9.dfhcommarea.input.actiAccountId
--direction
For asset only, sets the direction for property lookup: INPUT, OUTPUT or BOTH (default: BOTH).
--direction input
--outputStatusCode
The status code under which to add a property under the outputEntityDefinitionMap of the asset metadata model. For Operation asset only, sets output status code for OUTPUT/BOTH direction. The default status code is 200, but the property is helpful when the asset can have multiple status codes.
--outputStatusCode 406
Adding a property under the default 200 status code:
{
"id": "f54e33df-6ec4-4e5f-96d4-ad9f9fa71636",
"name": "oactcs9",
"path": "OACTCS9",
"inputEntityDefinition": {
...
},
"outputEntityDefinitionMap": {
"200": {
"class": "org.openlegacy.core.model.entity.RpcEntityDefinitionImpl",
"id": "7b2846af-36ea-42a0-ac5f-d5fa6b08fea4",
"name": "Oactcs9",
"qualifiedName": "com.openlegacy.entity.oactcs9.Oactcs9",
"fieldDefinitions": {
"dfhcommarea": {
...
"fields": {
"inPut": {
"class": "org.openlegacy.core.model.field.RpcClassFieldDefinition",
"name": "inPut",
"javaType": "InPut",
"displayName": "Input",
"originalName": "IN-PUT",
"fields": {
"actiAccountId": {
"class": "org.openlegacy.core.model.field.RpcStringFieldDefinition",
"name": "actiAccountId",
"displayName": "Actiaccountid",
"length": 11,
"originalName": "ACTI-ACCOUNT-ID",
"legacyType": "org.openlegacy.core.model.legacy.type.MainFrameLegacyTypes.Char",
"additionalAttributes": {
"param-1": "value1",
"param-2": "value2",
}
},
Examples
Setting the property on the input entity
[module-name]> ol set property --asset oactcs9 --direction input --field oactcs9.dfhcommarea.inPut.actiAccountId --property input_param 1
[module-name]$ ol set property --asset oactcs9 --direction input --field oactcs9.dfhcommarea.inPut.actiAccountId --property input_param 1
Setting the properties on the asset level
[module-name]> ol set property --asset oactcs9 --property param-1 --property param-2
[module-name]$ ol set property --asset oactcs9 --property param-1 --property param-2
Setting the properties on both the input and output entities
[module-name]> ol set property --asset oactcs9 --field oactcs9.dfhcommarea.inPut.actiAccountId --property input_param 1
[module-name]$ ol set property --asset oactcs9 --field oactcs9.dfhcommarea.inPut.actiAccountId --property input_param 1