Removing redundancies when using fml40
The current fml40 reference implementation follows the approach to include functionalities as features.
A typical directory entry with the functionality fml40::AcceptsFellingJobs
would then look like the following:
{
"thingId": "s3i:1234",
"policyId": "s3i:1234",
"attributes": {
"ownedBy": "abcde",
"allEndpoints": [
"s3ibs://s3i:1234",
],
"name": "Chainsaw",
"thingStructure": {
"class": "ml40::Thing",
"links": [
{
"association": "roles",
"target": {
"class": "fml40::Chainsaw"
}
},
{
"association": "features",
"target": {
"class": "fml40::AcceptsFellingJobs"
}
}
]
}
}
}
These functionalities essentially act as services of the DT. Yet, this description only allows for an understanding among DT which use the fml40 reference implementation. In order to be conform with other DT in the S3I which are not based on fml40, there had to be a mapping to a S3I::Service.
I see the requirement to map fml40 functionalities to appropiate S3I services, when updating the directory entry from the fml40 reference implementation. Of course, this makes the feature of the functionality itself redundant. IMO this can be left out. Due to current discussions about S3I Events (#2, #4), this should also be applied to events in the future.
In fml40 we functionalites may include various methods (see here). As of my understanding each method would represent an individual service in the s3i directory. The functionality acts as a namespace in this case.
Following the example from above, the correct directory entry without redundant features would look like the following.
{
"thingId": "s3i:1234",
"policyId": "s3i:1234",
"attributes": {
"ownedBy": "abcde",
"allEndpoints": [
"s3ibs://s3i:1234",
],
"name": "Chainsaw",
"thingStructure": {
"class": "ml40::Thing",
"services": [
{
"serviceType": "fml40::AcceptsFellingJobs/acceptJob",
"endpoints": [
"s3ibs://s3i:1234"
],
"parameterTypes": {
"job": "fml40::FellingJob"
},
"resultTypes": {
"result": "boolean"
}
},
{
"serviceType": "fml40::AcceptsFellingJobs/queryJobStatus",
"endpoints": [
"s3ibs://s3i:1234"
],
"parameterTypes": {
"identifier": "string"
},
"resultTypes": {
"result": "fml40::JobStatus"
}
},
{
"serviceType": "fml40::AcceptsFellingJobs/removeJob",
"endpoints": [
"s3ibs://s3i:1234"
],
"parameterTypes": {
"identifier": "string"
},
"resultTypes": {
"result": "boolean"
}
},
]
"links": [
{
"association": "roles",
"target": {
"class": "fml40::Chainsaw"
}
}
]
}
}
}
Still to be discussed at this point would be the description of resultTypes in fml40. The description of resultTypes in the S3I directory assumes the result to be sent in a json e.g. like this example:
{
"sender": "s3i;123",
"identifier": "s3i:123abc",
"serviceType": "fml40:AcceptsFellingJobs/acceptJob",
"results": {
"result": true,
},
"messageType": "serviceReply"
}