-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore the functionality to create processes using ActiveMQ #4837
Comments
As I already explained in #5572 (comment) we need this functionality. I see active development regarding ActiveMQ over at #5657 but no prominent mention of the Process Creation Service. Will the service be restored as a byproduct of this development? If not, is there any documentation or even better an estimation why the service could not be restored in Kitodo 3? What are the hurdles and the expected amount of work necessary to restore it? |
After discussing the topic in the BarCamp at this year's Kitodo Practical Meeting, the following requirements emerged in detail:
Example: { "project": 88,
"template": 123,
"import": [
{ "importconfiguration": 7,
"value": "1234567X" },
{ "importconfiguration": 9,
"value": "Hs_sig_08.225.1234" }
],
"title": "LoremIpsum_1234567X",
"parent": 22,
"metadata": {
"singleDigCollection": ["Kollektion 1", "Kollektion 2"],
"person": [
{ "role": ["aut", "edt"],
"firstName": "Michael",
"lastName": "Schmidt"
},
{ "role": ["egr"],
"firstName": ["Johannes"],
"lastName": ["Römer"]
}
]
}
} Here, A separate map message must be sent using Active MQ for each process to be created. Successful process creation or error is reported on a results topic. General rule of thumb: If something doesn't fit together, no process is created, but a helpful error message is sent on the results topic. |
I am not exactly sure how complex ActiveMQ JMS message objects can be constructed using other languages than Java, but for anyone who wants to give it a try here is the general procedure for using python with the package stomp.py. (https://github.com/jasonrbriggs/stomp.py) import stomp
conn = stomp.Connection([("localhost", 61613)], auto_content_length=False)
conn.connect(
[username],
[password],
wait=True,
)
conn.send(
# hardcoded queue
destination="/queue/KitodoProduction.FinalizeStep.Queue",
body=to_map_json(
{
"id": [Kitodo_Task_id],
}
),
transformation="jms-map-json",
)
def to_map_json(obj):
return json.dumps(
{
"map": {
"entry": [
{"string": [str(key), str(value)]} for key, value in obj.items()
]
}
}
) |
It is even possible to create such ActiveMQ JMS messages in PHP. I'm using for this the stomp-php package and the code is relative to the python solution. So I think it is possible to use different languages to create the necessary ActiveMQ JMS message. |
Thanks a lot for writing this very clear summary. It fits the requirements quite well. Nontheless, I have a few remarks and questions or additions from my notes:
IIRC we did not explicitely discuss the case of no catalog import being specified or more than one being specified. Both seem welcome additions but, again from my notes, have not been discussed as requirements. Nontheless a few questions:
IIRC (I have no notes on this) we discussed that technically Kitodo would also prevent you from creating a process of the same title that is already in use by another client. Having the possibility to create processes of identical name for different clients would be nice and provide better multitenancy but is out of scope here. So if I'm not mistaken it should be “The process title must still be unused.” Since we decided that processes with errors in imports should not be created at all I would conclude that processes with a supplied process name that is already in use should also not be created at all, even if a process title that is not already in use could be derived through the configured rule.
According to the notes I made during the session we also explicitly decided that the first check should be on the process ID. I.e. if both a process ID and process name are provided, the lookup result for the process ID should be queried first. As I understood our decision from the workshop if a provided identifier could not be found in the system the process creation should be aborted. That means even a higher level identifier could be found ther would be no process created if a process name was provided but could not be found. We also discussed that in the case that a superordinate process was found but is part of another project it is possible that the process could not be created as subordinate process since access rights to the other project are missing. In this case a process should be created without connection to the supposed superordinate process. (In accordance with the current behaviour of the mass import feature.) I find that contradictory to the decision described above and would personally prefer that if a provided process id can not be found but a provided process name can be matched the process should be created as suordinate process to the process having the provided name. @BartChris @apiller since you were also part of the group maybe you could comment on this?
|
The |
Thank you for this explanation. We haven't discovered this feature yet and don't have a use case for it at the moment.
Yes, I think that the mechanics behind that were also discussed during the session. Anyway, you cannot create a process (via mass import) with a title that is already in use. I'm not really concerned right now if this is possible for different clients.
Good, I must have missed that.
I agree that this should be an error case if docType is a required field.
Yes, as with possible authentication systems we briefly discussed this but found it to be out of scope.
Sorry for being unclear about that. Let's assume than that a process ID is transmitted via the ‘parent’ field then and there is a metadata entry in the field that serves as higherLevelIdentifier. We decided that the ‘parent’ field should be checked first. But what happens if the ID cannot be found? Does the process creation service stop or will the higherLevelIdentifier be used? |
The process will not be created. The value from the higherLevelIdentifier will only be used if no ‘parent’ field is given. |
I'm okay with this behaviour. I just couldn't really make out the reasoning behind it and wanted to make sure I understood and summarized correctly. |
Hello,
it would be good if the functionality to create processes using Active MQ could be restored by reactivating and updating the old CreateNewProcessProcessor
https://github.com/kitodo/kitodo-production/blob/dc9f6fbf8636e884fc9a283a445cc04fab4d2d02/Kitodo/src/main/java/org/kitodo/production/interfaces/activemq/CreateNewProcessProcessor.java
The text was updated successfully, but these errors were encountered: