How to assign a specific batch instance to specific group or specific user

Issue Description:

We have observed that some customers want to assign batch instances to specific groups or specific users and would like to know whether this can be done in Ephesoft Transact. This wiki explains how this can be achieved in Ephesoft using custom scrips.

This information is provided in addition to the functionality description here.

Pre-requisites:

  • 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 groups.
  • It is always best to write this logic in ScriptDocumentAssembler.java as we would require the batch to be assigned to specific group/user in the Review state.
  • You need to have DOCUMENT_ASSEMBLER_SCRIPTING_PLUGIN added in the 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 visible to a group:

Refer here. All you will need to do is to use the custom script attached above to make an entry in the batch_instance_groups table in ephesoft database.

Make batch instance visible to a specific user:

  • Making use of the batch_instance_groups table: This will give capability for all users in a group who have been assigned the batch along with the superuser.
  • Making use of the batch_instance_users table: This will give capability for only that user for which the batch has been assigned to along with superuser. Both options together will not work as records in the batch_instance_groups table will override entries in the batch_instance_users table.

If you want the batch to be visible only for a specific user then please give option 2 a try where you can modify your script to add an entry to the 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 superuser.

Please note that batch_instance_users table is not available in all the Ephesoft 4.x.x versions.