We have observed that few customers wants to assign batch instances to specific groups or specific users and would like to know if this is achievable in Ephesoft or not. This wiki will provide you an understanding on how this can be achieved in Ephesoft using custom scrips.
This is an improvement to already existing wiki link: http://wiki.ephesoft.com/batch-instance-group
- You are required to write your own custom logic on the basis of which you would like to assign the batch instances to users or to specific group.
- It is always best to write this logic in ScriptDocumentAssembler.java as we would require the batch to assign to specific group / user in review state.
- You need to have DOCUMENT_ASSEMBLER_SCRIPTING_PLUGIN added in Workflow.
What needs to be written in Script ?
Generic design is as below:
- Write a logic to get username from batch.xml.
- Write a logic to get Batch Instance Identifier from batch.xml.
- Write a logic to get role-name either from database or properties file using the username extracted from batch.xml.
- Use the already written logic to insert data in ephesoft database in batch_instance_group table.
For reference purpose please find the script where some part of above functionality is already implemented.
Make batch instance visibility to a group:
Refer wiki link: http://wiki.ephesoft.com/batch-instance-group. All you will need to do is to make use of the above attached custom script to make an entry in batch_instance_groups table in ephesoft database.
Make batch instance visibility to a specific user:
- Making use of batch_instance_group table : This will give capability for all users to in a group who have been assigned the batch along with the super user.
- Making use of batch_instance_user table : This will give capability for only that user for which the batch has been assigned to along with super user. Both options together will not work as records in batch_instance_group table will override the entries in batch_instance_users table.
If you only want the batch to be visible for specific user then please give Option 2 a try where you can modify your script to add an entry into batch_instance_users table in ephesoft database. Doing so the user who has been assigned a batch should only be able to view the mapped BI along with super user.
Please note that batch_instance_users table is not available in all the ephesoft 4..x versions. This functionality has been added in Transact versions and above.