public class JourneyManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CHANGEDSTAGE_EVENT_ID |
static String |
EXITED_EVENT_ID |
static String |
STARTED_EVENT_ID |
Constructor and Description |
---|
JourneyManager() |
Modifier and Type | Method and Description |
---|---|
static Journey |
addJourney(String name,
String serviceInstanceId,
TimeUnit timeoutUnit,
int timeoutAmount)
Adds a new journey.
|
static JourneyInstance |
addUserToJourney(String userId,
String stageId)
Adds the user with the given identifier to the journey through the stage with the given identifier.
Returns null if the user is already in the journey or the created JourneyInstance otherwise.This method uses its own transaction. |
static void |
clearAbandonedInstances()
Removes the abandoned instances.
|
static void |
deleteJourneys(Collection<String> journeyIds)
Removes the given journey.
|
static void |
deleteJourneys(String... journeyIds)
Removes the journey with the given identifier.
|
static void |
deleteJourneysByServiceInstance(String serviceInstanceId)
Removes all journeys of the service with the given identifier.
|
static void |
deleteStages(Collection<String> stageIds)
Deletes the given stages.
|
static void |
deleteStages(String... stageIds)
Deletes the given stages.
|
static JourneyInstance |
getInstance(String instanceId)
Returns the instance with the given identifier.
|
static JourneyInstance |
getInstanceByUserAndJourney(String userId,
String journeyId)
Returns the journey instance for the user in the journey.
|
static JourneyInstance |
getInstanceByUserAndStage(String userId,
String stageId)
Returns the journey instance for the user in the stage.
|
static Collection<JourneyInstance> |
getInstancesByUser(String userId)
Finds the instances of the given user.
|
static Journey |
getJourney(String journeyId)
Returns the journey with the given identifier.
|
static Collection<String> |
getJourneyIdsByServiceInstance(String serviceInstanceId)
Returns all journeys of the service instance with the given identifier.
|
static JourneyStage |
getStage(String stageId)
Returns the journey stage with the given identifier.
|
static boolean |
isUserInJourney(String userId,
String journeyId)
Returns whether the user with the given identifier is in journey with the given identifier.
|
static boolean |
isUserInJourneyStage(String userId,
String stageId)
Returns whether the user with the given identifier is in the stage with the given identifier.
|
static String |
localize(String idString)
Returns the localized string with journey resources.
|
static boolean |
moveUserToStage(String userId,
String stageId)
Moves the user with the given identifier to the stage with the given identifier.
Returns false if the user is already in the given stage or true otherwise.The user must already be in the journey that contains the given stage. This method uses its own transaction. |
static void |
removeAllUsersFromJourney(String journeyId)
Removes all users from the journey with the given identifier.
|
static void |
removeUserFromAllJourneys(MonitorUser monitorUser)
Remove the monitor user from all journeys.
|
static void |
removeUsersFromJourney(Collection<String> userIds,
String journeyId)
Removes the users with the given identifiers from the journey with the given identifier.
|
static void |
updateJourney(Journey journey)
Updates the given journey.
|
static void |
updateStage(JourneyStage stage,
boolean createUserSegmentation)
Updates the given stage.
The createUserSegmentation parameter value will make either:A new segmentation to be created if the parameter is true and the stage still doesn't have a segmentation created.
The existent segmentation to be deleted if the parameter is false and there's already a created segmentation.
Nothing otherwise.
|
public static final String STARTED_EVENT_ID
public static final String EXITED_EVENT_ID
public static final String CHANGEDSTAGE_EVENT_ID
public static JourneyInstance addUserToJourney(String userId, String stageId) throws PortalException
null
if the user is already in the journey or the created JourneyInstance
otherwise.userId
- the user identifier.stageId
- the journey stage identifier.null
if the user is already in the journey or the created JourneyInstance
otherwise.PortalObjectNotFoundException
- if there's no user with the given identifier.PortalObjectNotFoundException
- if there's no journey stage with the given identifier.NullPointerException
- if some required field is null
.AccessDeniedException
- if the current session's user does not have permission to perform the transition.PortalException
- if other error occurpublic static boolean moveUserToStage(String userId, String stageId) throws PortalException
false
if the user is already in the given stage or true
otherwise.userId
- the user identifier.stageId
- the journey stage identifier.PortalObjectNotFoundException
- if there's no user with the given identifier.PortalObjectNotFoundException
- if there's no journey stage with the given identifier.NullPointerException
- if some required field is null
.AccessDeniedException
- if the current session's user does not have permission to perform the transition.IllegalStateException
- if the user is not yet in the journey.PortalException
- if other error occurpublic static Journey addJourney(String name, String serviceInstanceId, TimeUnit timeoutUnit, int timeoutAmount) throws PortalException
name
- the journey nameserviceInstanceId
- the journey service instance identifiertimeoutUnit
- the timeout unittimeoutAmount
- the timeout amountPortalException
public static void updateJourney(Journey journey) throws PortalException
journey
- the journey.PortalException
public static void deleteJourneys(String... journeyIds) throws PortalException
journeyId
- the journey identifierPortalException
public static void deleteJourneys(Collection<String> journeyIds) throws PortalException
journey
- the journeyPortalException
public static void updateStage(JourneyStage stage, boolean createUserSegmentation) throws PortalException
createUserSegmentation
parameter value will make either:true
and the stage still doesn't have a segmentation created.false
and there's already a created segmentation.stage
- the stage.createUserSegmentation
- indicates whether a user segmentation should be created for this stage (if it doesn't exist yet)PortalException
public static void deleteStages(String... stageIds) throws PortalException
stageIds
- the stages identifiersPortalException
public static void deleteStages(Collection<String> stageIds) throws PortalException
stageIds
- the stages identifiersPortalException
public static Journey getJourney(String journeyId) throws PortalException
journeyId
- the journey identifier.PortalException
public static JourneyStage getStage(String stageId) throws PortalException
stageId
- the stage identifierPortalException
public static JourneyInstance getInstance(String instanceId) throws PortalException
instanceId
- the instance identifierPortalException
public static void deleteJourneysByServiceInstance(String serviceInstanceId) throws PortalException
serviceInstanceId
- the service identifierPortalException
public static Collection<String> getJourneyIdsByServiceInstance(String serviceInstanceId) throws PortalException
serviceInstanceId
- the service instance identifier.PortalException
public static void removeUsersFromJourney(Collection<String> userIds, String journeyId) throws PortalException
userIds
- the user identifiersjourneyId
- the journey identifierPortalException
public static void removeAllUsersFromJourney(String journeyId) throws PortalException
journeyId
- the journey identifierPortalException
public static boolean isUserInJourney(String userId, String journeyId) throws PortalException
userId
- the user identifierjourneyId
- the journey identifierPortalException
public static boolean isUserInJourneyStage(String userId, String stageId) throws PortalException
userId
- the user identifierstageId
- the stage identifierPortalException
public static JourneyInstance getInstanceByUserAndJourney(String userId, String journeyId) throws PortalException
userId
- the user identifierjourneyId
- the journey identifierPortalException
public static JourneyInstance getInstanceByUserAndStage(String userId, String stageId) throws PortalException
userId
- the user identifierstageId
- the stage identifierPortalException
public static Collection<JourneyInstance> getInstancesByUser(String userId) throws PortalException
userId
- the user identifier.PortalException
public static void removeUserFromAllJourneys(MonitorUser monitorUser) throws PortalException
monitorUser
- the userPortalException
public static String localize(String idString) throws PortalException
idString
- string identifier.PortalException
public static void clearAbandonedInstances() throws PortalException
PortalException
LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.