The community will be in read-only from Monday 11:59pm (PT) to Wednesday 7:30am (PT)
The community will be in read-only from Monday 11:59pm (PT) to Wednesday 7:30am (PT)
Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Can we somehow Transition Request in WF with Rule ?

SOLVED
Go to solution
Highlighted
Raj Ghimire
Occasional Visitor

Can we somehow Transition Request in WF with Rule ?

hello Everyone!
We have a interesting situation where we were exploring if it was possible to transition request in a WF with field value change. Whenver Request field value was set to "ON HOLD we wanted to explore possibility if we can move the Request to a certain Step. Can we somehow utilize the Rule to do that? I know there is a special command which can move the request in WF but I don;t think we can use that in Rules, can we ?
Any kind of ideas will be appreciated.
Thanks.
-Raj
10 REPLIES
Jim Bowen
Super Collector

Re: Can we somehow Transition Request in WF with Rule ?

You could probably write a database procedure to do this.

But, not make the field read-only, and create a button on the relevant workflow step called "Put On Hold", and do it that way?

Jim
Raj Ghimire
Occasional Visitor

Re: Can we somehow Transition Request in WF with Rule ?

Thanks for the input Jim !
i guess DB Procedure could help. I think they used to have a DB procedure for similar function back in 5.5.
The reason we don't want to use a transition is, we may have to take the Request to "On Hold" from almost any steps in the WF or its SWF which has multiple steps. And we didn't want to have the transition going from all over the place. But I am thiking of may be having more than one On Hold steps if needed and utilize special command from Sub workflow step so that I don't have to use too many transitions.
Thanks.
-Raj
Jim Esler
Honored Contributor
Solution

Re: Can we somehow Transition Request in WF with Rule ?

You could have a workflow step always active that would have a 'Place on hold' action available to the appropriate groups. When the action is taken, execute commands that capture the identity of the primary active step and move the request to a holding step. When the hold is released, move to the captured step and reenable the 'Place on hold' step. I haven't tried it but it seems feasable.
Jason Nichols K
Honored Contributor

Re: Can we somehow Transition Request in WF with Rule ?

Raj,

I did something similar to what Jim is talking about. We had a Project workflow that had 6 SWFs and they wanted to be able to put the project on hold at any time. What we did with that was to have an OR step at the beginning of each SWF that would branch to the main path and also to secondary Place on Hold path that was available only to the PMO. When the project was placed on hold, the other step that the project was at was captured and then that step was deactivated. When the project was then taken off of hold, there were transition steps built into the workflow to take it back to the last step that was "owned" by the PM. The last thing with this setup was to deactivate the Place On Hold step before transitioning out of the SWF. The client this solution was built for has been using it for over 2 years now.
Raj Ghimire
Occasional Visitor

Re: Can we somehow Transition Request in WF with Rule ?

Thansk Jason !
I wonder how you would de-activate the step though. Can we use one execution step to de-activate another step ? Do we have any built in special command for that by any chance ?
-Raj
Jason Nichols K
Honored Contributor

Re: Can we somehow Transition Request in WF with Rule ?

I had built an execution step that called a PL/SQL function and ran just before transitioning out of the SWF.
Raj Ghimire
Occasional Visitor

Re: Can we somehow Transition Request in WF with Rule ?

Interesting... I wonder what PPM Table you were updating using that PL/SQL function to deactivate the step though. Can you give me any an idea on that ?
Thanks in advance.
-Raj
Jason Nichols K
Honored Contributor

Re: Can we somehow Transition Request in WF with Rule ?

I'll do you one better. Here's the two functions I used:

FUNCTION CancelHoldStep ( requestID IN NUMBER)
RETURN VARCHAR2
/*
Function: CANCELHOLDSTEP
Input: The project Request ID
Output: 'SUCCESS'
Purpose: The disables the Put On Hold step in each of the Stage
Sub-Workflows.
*/
IS

HoldStepID NUMBER;

BEGIN

-- Get Workflow Instance Step ID to disable
SELECT kwis.WORKFLOW_INSTANCE_STEP_ID
INTO HoldStepID
FROM KWFL_WORKFLOW_STEPS kws
, KWFL_WORKFLOW_INSTANCES kwi
, KWFL_WORKFLOW_INSTANCE_STEPS kwis
WHERE kwi.TOP_INSTANCE_SOURCE_ID = requestID
AND kwis.WORKFLOW_INSTANCE_ID = kwi.WORKFLOW_INSTANCE_ID
AND kwis.ACTIVE_FLAG = 'Y'
AND kwis.WORKFLOW_STEP_ID = KWS.WORKFLOW_STEP_ID
AND kws.STEP_NAME = 'Place Project On Hold';
-- This is the Visible Step Name for the step that the user clicks to put a Project on hold

-- Update the step ACTIVE_FLAG to 'N'
UPDATE KWFL_WORKFLOW_INSTANCE_STEPS
SET ACTIVE_FLAG = 'N'
WHERE WORKFLOW_INSTANCE_STEP_ID = HoldStepID;

RETURN 'SUCCESS';

END CancelHoldStep;

FUNCTION PutOnHold ( requestID IN NUMBER)
RETURN VARCHAR2
/*
Function: PUTONHOLD
Input: The request ID to put on Hold
Output: 'SUCCESS'
Purpose: The process of putting a project on hold disables the currently
active step(s). This function also captures and stores the
step number of the last step disabled so that if the project
resumes, it will go back to the last PM step.
*/
IS

-- Cursor to find the active steps. It has to be a cursor as there are
-- parallel steps at some points in the workflow.
CURSOR ActiveSteps IS
SELECT kws.SORT_ORDER
, TO_CHAR(kws.SORT_ORDER) HOLD_STEP
, kwis.WORKFLOW_INSTANCE_STEP_ID WISI
FROM KWFL_WORKFLOW_STEPS kws
, KWFL_WORKFLOW_INSTANCES kwi
, KWFL_WORKFLOW_INSTANCE_STEPS kwis
WHERE kwi.TOP_INSTANCE_SOURCE_ID = requestID
AND kwis.WORKFLOW_INSTANCE_ID = kwi.WORKFLOW_INSTANCE_ID
AND kwis.ACTIVE_FLAG = 'Y'
AND kwis.WORKFLOW_STEP_ID = KWS.WORKFLOW_STEP_ID
AND kws.STEP_NAME <> 'Put Project On Hold' -- Don't include the step that called this function.
AND kwi.INSTANCE_SOURCE_ID <> kwi.TOP_INSTANCE_SOURCE_ID;

ReturnStep VARCHAR2(200);

BEGIN

FOR Step IN ActiveSteps -- Step through the Cursor
LOOP
ReturnStep := Step.HOLD_STEP; -- Capture the step number

-- Set the step ACTIVE_FLAG to 'N'
UPDATE KWFL_WORKFLOW_INSTANCE_STEPS
SET ACTIVE_FLAG = 'N'
WHERE WORKFLOW_INSTANCE_STEP_ID = Step.WISI;
END LOOP;

-- Store the step number in the database for use later. This is the storage location for Held Step in the Request Type
UPDATE KCRT_REQUEST_DETAILS
SET PARAMETER14 = ReturnStep
, VISIBLE_PARAMETER14 = ReturnStep
WHERE REQUEST_ID = requestID
AND BATCH_NUMBER = 2;

RETURN 'SUCCESS';

END PutOnHold;
Raj Ghimire
Occasional Visitor

Re: Can we somehow Transition Request in WF with Rule ?

Great!
Thanks a Lot Jason ! I definately could utilize at least some part of these information for my customization.
Thanks again !
-Raj
Raj Ghimire
Occasional Visitor

Re: Can we somehow Transition Request in WF with Rule ?

Decided to use Decision step and Execution step with funcions & special commands(instead of transition) to ahceive what I need.
Please see above for details.
Thanks everyone for the input.
-Raj
//Add this to "OnDomLoad" event