Foros de discusión

Kaleo Scripted Assignment

Naomi T, modificado hace 7 años.

Kaleo Scripted Assignment

New Member Mensajes: 4 Fecha de incorporación: 12/12/16 Mensajes recientes
I have a business need for authors to assign specific users for approval at the point of workflow initiation. It has been suggested to me that this might be possible with the scripted assignment feature. Please see use case below.

Use Case: User 1 creates Document 1. User 1 would like User 2 to approve Document 1. User 1 sends Document 1 through Workflow 1. Workflow 1 prompts User 1 to select which user they would like to approve Document 1. User 1 selects User 2 for approval. Document 1 is sent to User 2 for approval through Workflow 1. Later that day, User 1 creates Document 2. They would like User 3 to approve Document 2. User 1 sends Document 2 through the exact same Workflow 1. Workflow 1 prompts User 1 to select which user they would like to approve Document 2. User 1 selects User 3 for approval. Document 2 is sent to the User 3 for approval through Workflow 1.

1) Is this feasible with scripted assignment?

2) Has anyone been able to create this functionality before?

Thanks.
thumbnail
David H Nebinger, modificado hace 7 años.

RE: Kaleo Scripted Assignment

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
No, scripted assignment does not have a UI for the user to select an approver.

Besides, this is commonly considered bad practice. What happens when User 2 is on vacation or paternity/maternity leave or just leaves the company? Binding things to specific users means your workflow can grind to a halt during such absences.

Don't overthink the workflow management process, it overly complicates task assignments and completions. KISS is the best option with respect to workflow definitions.

I prefer the role assignment. Authors do not have to worry about who gets the doc and admins can change the role assignments when there are outages.
Naomi T, modificado hace 7 años.

RE: Kaleo Scripted Assignment

New Member Mensajes: 4 Fecha de incorporación: 12/12/16 Mensajes recientes
Thanks so much, David.

The company I work for is in life sciences. As such, there are some very strict regulations that we have to work within. This is where the need comes from to have specific users to provide approval as opposed to a generic role. I realize that this is not necessary best practice, but I it might be a necessity for our particular group. Is there any way at all that you can think of that I can accomplish this in the portal?

I also have a question for you. I apologize in advance if it is a a dumb question! emoticon

My understanding of workflows in the portal: When you create a workflow in the portal, you have to assign a specific role to that workflow. You then have to assign that specific workflow to a document type. Let's say I have two levels of approvals in each of my departments. This departments have to work within themselves to approve things, as well as with other departments to approve things. I very quickly have an impossible list of approvals to manage.... QA 1 and QA 2, QA 1 and SM 1, QA 1 and SM 2, SM 1 and SM 2, PM 1 and PM 2, PM 1 and SM 1... And so on. I have trouble even thinking about the full list. I then need corresponding document types for each workflow.

How is that simpler than having one Single Approval workflow (where users can select the specific user they want to approval), one Dual Approval workflow (where users can select the specific user they want to approve), and one corresponding document type for each approval?
thumbnail
Amos Fong, modificado hace 7 años.

RE: Kaleo Scripted Assignment

Liferay Legend Mensajes: 2047 Fecha de incorporación: 7/10/08 Mensajes recientes
If your workflow must do this, I think it should be possible. Basically if you can get that approver's userId into the workflowContext before it gets to the scripted assignment, you can retrieve in your groovy assignment script and then return that user for assignment.

If your document is a custom object, it should be pretty easy. You can just inject it in the workflowContext before you run WorkflowHandlerRegistryUtil.startWorkflowInstance(companyId, creatorUserId, objectClassName, objectClassPK, object, serviceContext, workflowContext).

If you're using portal's document library object, it may be more difficult. I think workflowContext also includes the serviceContext, so you may be able to look in there if you add it as a parameter on the form, but I'm not sure about that.
Naomi T, modificado hace 7 años.

RE: Kaleo Scripted Assignment

New Member Mensajes: 4 Fecha de incorporación: 12/12/16 Mensajes recientes
Amos Fong:
If your workflow must do this, I think it should be possible. Basically if you can get that approver's userId into the workflowContext before it gets to the scripted assignment, you can retrieve in your groovy assignment script and then return that user for assignment.

If your document is a custom object, it should be pretty easy. You can just inject it in the workflowContext before you run WorkflowHandlerRegistryUtil.startWorkflowInstance(companyId, creatorUserId, objectClassName, objectClassPK, object, serviceContext, workflowContext).

If you're using portal's document library object, it may be more difficult. I think workflowContext also includes the serviceContext, so you may be able to look in there if you add it as a parameter on the form, but I'm not sure about that.


Thank you!!