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

Question

Question

Forms user tasks assigned to TEAM

asked on May 2, 2017

I have a user task assigned to a particular team member by filter using a variable field from the form.  That is working.  I want to 'by pass' the task if there is no team member assigned based on the filter.  Right now the process will suspend and require I reassign to move past it.  

I suspect that in the filter assignment I could do something more creative to prevent it from Suspending.  

Has anyone tried this?  or have any other solution (best practice?)

Screen Shot 05-02-17 at 11.12 AM.PNG
0 0

Answer

SELECTED ANSWER
replied on June 2, 2017

The stored procedure method works great -- the resulting found YES/NO is the field value I use in the BP to determine the route of approvals.  

 

USE [LaserficheKSD]
GO

/****** Object:  StoredProcedure [dbo].[LF_CheckActiveTeam]    Script Date: 6/2/2017 10:02:25 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[LF_CheckActiveTeam]
    -- Add the parameters for the stored procedure here
        @TeamName NVarchar(30), @LocationNbr INT
        AS
        BEGIN
                DECLARE @RESULTS INT
                select @RESULTS = COUNT(R.NAME) 
                    --,t.name, t.id, is_deleted,team_id, r.name, r.description 
                    from [LFFormsKSD].[dbo].[teams] t , [LFFormsKSD].[dbo].[team_roles] r
                    where is_deleted like '0' and r.team_id = t.id and t.name like rtrim(@TeamName) and r.name like rtrim(@LocationNbr)
                    
    IF @RESULTS > 0
            BEGIN 
                SELECT FOUND = 'YES'
            END
        ELSE 
            BEGIN
                SELECT FOUND = 'NO'
            END
        END

GO
 

0 0

Replies

replied on May 2, 2017 Show version history

I don't think it is possible inside the User Task to do something like "if no users meet the role, then do this alternate process".

I was thinking this could work with Signal/Catch events or Error End/Start events in your process, but upon examining those closely, I'm not really seeing how that could work.

A solution comes to mind, but is rather complex.  This would require setting up a Stored Procedure in the Forms database that reviews your teams/roles/users tables and gets a count of how many users have the specific role, this value would be populated into a variable in your form process (either through a data lookup inside a form, or through a workflow called from your process).  Then in the process, a gateway would determine if the value in that field is zero or higher.  If higher, the process continues to the user task, if zero, the process skips the user task and picks up at a later stage.  The part about doing a stored procedure could be skipped if using the workflow option, since you could just query the forms db for the info you need, whereas doing that from a form would need the stored procedure to get what you need.

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

Sign in to reply to this post.