In my application, the first stage is registration stage where the user can register and the operator id gets created for that person automatically.
Later if that person logins, if he/she runs the case, the first stage i.e. Registration stage should be skipped from him and the case should start from the second stage. Can anyone help me out in resolving this?
You need to have an alternate stage, Configure "Registration Stage" with a condition configured in the right-hand panel of Case type rule. Refer below,
There are two conditions which could be useful, "Skip stage when" this could be used to skip the registration stage in your case. This when rule could check the database(Data-Admin-Operator-ID) table if the operator entered already exists or not. If it exists, "OperatorExists" When rule should return true and this stage will be skipped.
Also, you could additionally check the "Set entry validation" according to your business logic.
Adding an alternate stage
Unlike primary stages, which are intended to be run for most – if not all – cases that are defined by a case type, alternate stages allow you to group exception actions or "ad hoc" steps. To add an alternate stage, click the Actions menu on the Case Type form and click Configure Alternate Stages. Alternate stages appear below the primary stages, and are indicated with a gold background, rather than a blue background.
Alternate stage for a case type, in this example, for a rejection
Alternate stage for a case type, as indicated by the gold background for the stage label
When considering the use of an alternate stage, keep the following points in mind:
Alternate stages do not support automatic transitions. To exit an alternate stage, you must configure a controlled transition.
Alternate stages should not be used in place of a child case.
An alternate stage can represent either an exception path or a primary stage that does not occur at a defined point in the overall case life cycle.
Yes I used when rule to skip a stage in the 2 stage but in this stage there is a spin off case New register it should not get created ,but in the background it is getting created .How to resolve this problem ?When the stage is getting skipped how a step in the stage is getting executed?
For your requirement implemented as above but one thing, I want add here, most of pega application were used for an internal business process where the user already having the login credentials. if not so someone will generate and route to them. In another scenario especially If your considering regular website where you need to give user form and back end by using some pega service It will create operatorid to user and then log in and proceed with regular case life cycle.