Alfresco In workflow form one fields values. I need to check values already exist in DB or not if exists don't save if not save different values. Is this possible?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
You are saying "DB" but I will assume you mean "properties on an object stored in the Alfresco repository". If so, from JavaScript embedded in your workflow you can check a property value. If a property is named "foo:someProperty" then you can get it using doc.properties['foo:someProperty']. And you can get the object from the workflow package. All of the documents in your workflow are in an array which is accessible with bpm_package.children.
The code would look something like:
For more info on the Alfresco JavaScript API, see the docs.
If you did not mean an object in the repository and you really did mean a relational database, then you'll have to implement a custom task listener using Java, and from there use JDBC or some other API to query your database and update records in the database.
If that's what you need to do, then you might take a look at this workflow tutorial. There is a class called ExternalReviewNotification that shows how to implement a custom task listener in Java. You could implement your own task listener that makes the JDBC call to your database.