You are viewing limited content. For full access, please sign in.

Question

Question

Pending Approval User task

asked on April 21, 2020

I have a scenario where my form goes through a User task Approve/Reject process for a student request on a course.

When the request gets approved, emails goes out to the Parent and the database table gets updated for the student course request with status Approved

When the request gets rejected , email goes out to Parent and the database table gets updated for the student course request with status Rejected

The above 2 works.

I have another status Pending which should happen when the user submits the course request and when the form waits for the approval process.

The database needs to be updated with Pending status before the Approval /Rejection state happens.

Any help or suggestions appreciated!

 

 

0 0

Answer

SELECTED ANSWER
replied on April 26, 2020 Show version history

Hello Rekha,

You do not need to examine the approval of the course from the workflow. You already have exclusive gateways in your Laserfiche Forms Process Designer that can choose what route to follow in case certain values were filled in your form.

Using workflow you can only retrieve the filled values from your forms and execute actions that cannot be done by Laserfiche Forms. For example: routing an entry in Laserfiche from one folder to another, renaming an entry etc... 

In your case you can use workflow to execute the actions needed on each step. So what i would do is create two workflows, one workflow for the approval and another one for the rejection.

Moreover, regarding the pending status update, i also prefer to create another workflow to set the status of the student's request to pending. This might seem a lot of workflows to create, but at least you organized your work in a way that your future troubleshooting will be much easier.

So again, i suggest the following:

  1. one workflow responsible for setting the value of the request status to pending. you just have to use the retrieve business process activity to import all the values of the form. and do the necessary actions on your database.
  2. After that, Using Laserfiche Forms exclusive gateways, split your process into two routes:
    1. One route handles what happened upon approval. Here you can create a workflow to process your data and do the necessary actions after approval.
    2. another route that handles rejection. Here you can create a workflow to process your data and do the necessary actions after rejections.  

 

And one more thing, a workflow started by Laserfiche forms wont have an entry associated to it. in other words, workflows started on entry actions withing the Laserfiche repository are the ones that will have a starting entry to work with. And here we mean by entry any file located inside the Laserfiche repository (folder or any type of document).

For more information on exclusive gateways, refer to Laserfiche Web help site. But i think it is self explanatory whenever you see it in Laserfiche Forms.

1 0

Replies

replied on April 21, 2020

Assuming this is a custom database table, you could simply set the status to Pending when you first insert the request and/or set the column's default value to Pending.

Otherwise, you could add an additional Workflow task right before the User Task, and use that to update the status to Pending.

0 0
replied on April 21, 2020 Show version history

The first suggestion will not work for this scenario since i update the db only after the approve/reject happens. And the workflow updates the db with the status.

I will try your second suggestion. So looks like i may have to add a workflow task in the process diagram and see if i can update task to pending.

 

0 0
replied on April 21, 2020

You can also define default value of the column in dB as “Pending”. 

0 0
replied on April 22, 2020

I assume you are adding a student record whenever the student submits a new form for a new course.

I think you can send the value "Pending" by default as Chandresh Sharma said whenever you first add the student record into your database. 

0 0
replied on April 22, 2020

To Chandesh Sharma and Jospeh Maary's response thanks for your suggestion. 

In this scenario the db is updated only after the form goes through the approval process. So when the user submits a course request it does not write to db. Hence i cannot add Pending for the Form Submit.

There has to be a step before the approval Process for me to write to DB. I need to try adding a Workflow task before the user task as suggested here. I was working on a diff requirement yday. Will try this today and let you all know how it's going . Thanks!

0 0
replied on April 22, 2020

In that case adding a workflow task to update DB with BPID will be helpful which can be used at every stage through workflow. You can define one single workflow with routing conditions of DB updates. These conditions can be mapped to a stage value of form. One of branch can update basic request metadata with status=pending along with date and time in another column. This will help better change management and also help you calculate aging when required.

 

Rgds

Chandresh

1 0
replied on April 22, 2020

Ok so here is what i did.

I added a workflow Service task before the User Task. The workflow service task id is 24. (screen capture below)

Is there a way to capture this id in the workflow so i can use it in the Branch which checks for Pending status? Or is there a different way to capture this in the workflow so i can use that ID to check for the pending status.

 

 

 

 

 

0 0
replied on April 22, 2020

You can use Form Name as identifier. You have select “Started by Laserfiche Forms” in workflow properties. This will work perfectly fine if you have different forms at every user task. If you have same forms then StepID may help.

0 0
replied on April 22, 2020

I just have one form for the whole process . I already have the " Started by Laserfiche Forms" checked in the wf properties.

I see Forms ID, BP Instance ID, Submission ID, Submission Step ID under the Token Dialog Input parameters. 

What you are referring is  Submission StepID?

Let me try...

0 0
replied on April 22, 2020

Yes, you can use the "Submission Step ID". Remember that this token will give you multiple values and thus you need to set StepID token for each value which will ensure that in the end token contains that last value. After this, you can have conditions defined on StepID value.

Screenshot 2020-04-23 at 3.01.09 AM.png
Screenshot 2020-04-23 at 3.01.22 AM.png
1 0
replied on April 23, 2020

When i add a workflow task and i included the above changes for capturing the submission step ID, the workflow is failing at the retrieve Field values step in the workflow where i have Instance ID and Submission ID captured.

Do i have to add anything specific for the workflow task in the workflow? Any ID?

 

0 0
replied on April 23, 2020

Use “Retrieve Business Process Variables” this action allows to get values from Forms. “Retrieve Field Value” is only for template data from DMS.

0 0
replied on April 23, 2020

Yes i use "Retrieve Business Process Variables" to capture the Fields in the forms but use the "Retrieve Field Value" to capture the Instance ID and Submission ID which is needed for Saving in the Repository and Move entry, Rename Entry and Assign Field values in the workflow . 

 

 

0 0
replied on April 23, 2020

To Capture InstanceID and StepID, it’s available by default when you click “Started by Laserfiche Forms”. You don’t need to read it using Retrieve Field Value. Simply assign to fields where required. You can find these in Global Variables in Token Editor’>’.

 

0 0
replied on April 23, 2020

Oh i see ur point. Let me check.

0 0
replied on April 23, 2020

I went ahead and disabled the Retrieve Field Value, Move Entry, Rename Entry and Assign Field values steps in the workflow and i actually got the table updated with the Pending status.

But when it comes back into the workflow for the approval /rejection branch ,it's fails at the Retrieve Business Business process variables Step with the error "This workflow does not appear to be started by Forms. The Forms instance id was not specified or was empty" since i have the "Instance that started this workflow" selected. Any suggestions?

0 0
replied on April 24, 2020 Show version history

Hello Rekha,

  1. If you tried to create the Retrieve business process variables activity as @Chandresh mentioned but you did it in one of the condition branches then other branches wont be able to use its variables because they will no be able to access it.
  2. You can try saving the value of your instance id after retrieving it in a token using Assign Token Values before entering the branches. This token can be then reached from either Approval, Rejection or Pending Branch.

This workflow is the same workflow you are calling before and after the approval step so the instance id is still the same.

1 0
replied on April 24, 2020

Thanks!

I have my Retrieve Business Process variables right at the start of the wf before the branches.

So as per the wf i have it set before it enters any branch.

Is there a way to keep the Retrieve Field values so i grab the instance ID and submission ID and use that in the Business Process Variable step  and at the same time accomplish The pending Status through the workflow task?

Right now i have the Retrieve Field values disabled and use the below option to grab the instance in the Business process variable. It's using just the instance so after Pending is captured and the approver approves/rejects it and comes into the wf it's looking for the instance ID again. The Business process Variables are not inside the branch where it's checking for pending or Approval/Rejection. 

I hope am explaining myself clear.

0 0
replied on April 24, 2020 Show version history

Alright, 

  1. Try to move the Retrieve Business process activity right before the Assign Token Values activity
  2. In the Assign Token Values activity, create two variables: one variable corresponds to the Submission Id and another variable corresponds to the Instance Id as @Chandresh mentioned. Note: You can create both token in the same activity. give them appropriate names to identify them.
  3. Once these variables are created, assign the values of each one using the Retrieve Business process tokens.

 

Once these steps are done, you can configure your condition in a way to let the workflow decide which branch it should choose based on the values in your tokens.

0 0
replied on April 24, 2020

Thanks! Let me try.

0 0
replied on April 24, 2020

So i went ahead and did the above suggestions. Created Instance and Sumbission ID in Assign Token values. And modified the token values by assigning the Instance and Submission ID And here is where i am.

It's moved further down in the wf, but it's failing to Move the entry in the repository ("No entry was specified"). It will also fail at the Rename Entry for the same.

0 0
replied on April 24, 2020 Show version history

What is the error message provided by the workflow ? 

In order to locate the error message, please click on the messages tab.

and here, what entry are you trying to move? because the way i'm seeing it is that you didn't specify an entry to move in first place.

The workflow is being started by Laserfiche Forms where there is no entries to work with. You have to use activities like Find Entry and Search Repository in order to locate and use these entries to move or rename ext... 

0 0
replied on April 24, 2020

Will get back to this later tdy and keep this thread posted. 

0 0
replied on April 26, 2020

This is what i have and need suggestion on how i can handle it.

I changed some of my approach.....When the form gets submitted with a course selection i check in the workflow if Initiator is Forms Routing and Starting Entry is false. So it goes through the process, captures the Pending and updates the db.

When the approver picks it up and approves/rejects thats where i have an issue. AM not sure if am taking the right approach.

I have another branch (second screen shot below) where i check for initiator is svc_lfservice and starting entry is true , i retrieve the business process variables and assign the status as Approved/Reject.

It fails at the Business process variable step and errors ,(third screen shot below) How can i handle this? 

 

 

 

 

 

0 0
replied on April 26, 2020

ok Thanks so much for the suggestion . Let me try it this way. It’s better to take a diff route rather than getting stuck and trying to resolve it. Will keep the thread posted .

0 0
replied on April 29, 2020

Thankyou very much for the suggestion. Splitting the workflow task helped and am able to set the pending status, approved and denied and separate workflows. Looks good.

The pending approval task happens on Credit recovery Course Type.

There is another course type called Advancement which they select in the same form. This is pretty straight forward. NO approval required. Screen shots below.

I see a warning in the workflow search when i search for the instance after the form submission . Any idea how i can get rid of the warning. It's functioning the way it should but i would like to fix/prevent the warning. Suggestions appreciated.

 

 

 

 

0 0
replied on April 29, 2020

Hello Rekha,

I'm really i could help in your situation. 

As for the warning, if you are not using the Laserfiche Forms instance id or submission step then no need to check the Started By Forms checkbox. Uncheck it and i believe the warning will not show. But once again, uncheck it IF you are not using any tokens provided by this checkbox.

If you are using the instance id, then make sure that the instance id is returning a certain value. the warning is pretty self explanatory.

Other than that, i am glad u worked it out. Cheers!

 

 

0 0
replied on April 29, 2020

i just checked the Workflow properties and the checkbox for Started by Laserfiche forms is unchecked.

And below is what i have on the Business Process variables properties in the wf.

0 0
replied on April 30, 2020

Oh well, at this point i have no idea whats causing this warning to appear.

But as long as you are not using the Laserfiche forms instance id anywhere in this workflow, you do not need to worry.

0 0
replied on May 4, 2020

No problem. Thankyou!

I included a condition check before Retrieve Business Process variable to check if the initiator is FormsRouting and that helped remove the warning.

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.