Posted: 29 Aug 2016 19:04 EDT Last activity: 14 May 2017 22:10 EDT
Can we launch a Flow rule without any workpage in Context?
We have a requirement, where we want to launch a flow rule without having any case or workpage context. Basically, we want to use the flow rule for running the decisioning logic that is available within the flow rule.
The question i have is :
1.) Is it possible to have a flow rule without any workpage or case associated? If yes, how is it created. Also let us know how you will launch that flow from an activity or from Desktop/mobile portal/harness.
2.)If a portal rule can be created without any workpage or case associated, is it recommended to have a flow like that? What are disadvantages or drawbacks if any.
3.) Will the flow rule be able to create any case without any issues.
4.) Will the flow rule persist any data in any table?
I personally think it is a bad idea to have a flow rule without a case type or work-type associated, since it defeats the whole case lifecycle concept. My understanding is flow rule should always be used within the context of a case type/work object.
Appreciate inputs/feedbacks from anyone on this.
***Updated by moderator: Lochan to add Categories***
One thing to notice is that flow rules ALWAYS have, as one of their keys, a work class, so therefore it's impossible to totally divorce a flow rule from all work classes. However, there are certainly operations you can choose to do within the flow shapes that may be somewhat independent of that class.
Another thing that may help you are the settings on either the "process" or "design" tabs of the flow rule (I forget which settings are on which tab!). Some of the settings that come to mind are 1) The setting that indicates whether this flow creates a new work object or not and 2) The setting indicating whether this is a temporary-object flow or not. I do NOT strongly suggest you use that temporary-object feature, as my experience has been that it tends to cause issues, and is safer merely stay away from. /Eric
1. Yes, a flow can be called without a work object. It will need some sort of object on the clipboard that it is working on, but that doesn't need to be something you persist to the database.
2. Creating portals and flows without work objects fails to leverage much of what the Pega Platform offers. As a result most people don't do it, so I don't have a lot of experience with any specific advanatages/disadvantages. The most common case I've seen for flows on data objects are when your work object needs to do something on a list of pages, so you are doing a split for each or spin off, to do that work.
3. If the flow is creating a case, then it is creating it's own workpage. I'm assuming you're letting the process engine create the case with "Creates a new work object" checked on the Process tab. If you're trying to do it from within an active flow... I've never seen it done, but theoretically you could figure it out. You would still be significantly better off staying within the guardrails and letting the process engine do the work for you.
4. Any object created in a concrete class can be perisisted to the database via an obj-save. As a flow moves from assignment to assignment, provided it isn't a temporary object, it will attempt to perisist itself and the associated assignments to the database. If you are doing a flow on an abstract class, you will probably face errors. You can also create utility shapes that explicitly call the obj-save method on other object than the one the flow is acting on, if you need to save them to the db.
So in short, yes you can do it, by generally you wouldn't want to. At the end of the day, what are your business requirements and how can you best meet them? You may have an edge case where what you suggests makes sesnse, but for the vast majority of the time it won't.
On the first point (flow can be called without a work object), I have exact same scenario to launch a flow to completed service request processing (running few decision rules and some logic through utility activities) without doing anything with WorkObject. I am experiencing issue:
1. com.pega.pegarules.pub.database.BadInputException: trying to calculate the handle of a class whose instances may not be written to the database: XXXX-FW-XXXFW-Int-XXX: code: <none> SQLState: <none> Message: <none> From: (H481C8E6BC729320371E9F7B9F749B2BA:10.202.242.122)
2. Failed to find a 'RULE-OBJ-ACTIVITY' with the name 'PROBLEMFLOW' that applies to 'XXXX-FW-XXXFW-Int-XXX'.
Could you please suggest how we can achieve this? Your help is much appriciated.