public class ClientUtil
extends java.lang.Object
Constructor and Description |
---|
ClientUtil() |
Modifier and Type | Method and Description |
---|---|
static org.json.JSONObject |
getAsJSON(java.lang.String wlNodeId,
ActivityInstance ai)
Get a JSONObject from an ActivityInstance in the context of a worklist node.
|
static org.json.JSONObject |
getChangesAsJSON()
Get a JSONObject suitable for sending the threads own changes back to the Gui.
|
static org.json.JSONObject |
getChangesAsJSON(boolean avoidAutoNotification)
Get a JSONObject suitable for sending the threads own changes back to the Gui.
|
static org.json.JSONObject |
getChangesAsJSON(java.lang.String guiId)
Get a JSONObject suitable for sending the threads own changes back to the Gui.
|
static org.json.JSONObject |
getChangesAsJSON(java.lang.String guiId,
boolean avoidAutoNotification)
Get a JSONObject suitable for sending the threads own changes back to the Gui.
|
static org.json.JSONObject |
getChangesAsJSON(java.lang.String guiId,
java.util.Set<Pair<java.lang.Long,java.lang.Long>> additionalChangeSet)
Get a JSONObject suitable for sending the threads own changes back to the Gui.
|
static org.json.JSONObject |
getChangesAsJSON(java.lang.String guiId,
java.util.Set<Pair<java.lang.Long,java.lang.Long>> additionalChangeSet,
boolean avoidAutoNotification)
Get a JSONObject suitable for sending the threads own changes back to the Gui.
|
static java.lang.String |
getGuiId()
Get the id of the current gui.
|
static java.lang.String |
getGuiId(javax.servlet.http.HttpServletRequest req)
Get the id of the current gui from the HttpServletRequest
|
static java.util.Set<Pair<java.lang.Long,java.lang.Long>> |
toChangeSet(java.util.Collection<ActivityInstance> ais)
Transform a collection of ActivityInstances to a suitable structure for
getChangesAsJSON(String, Set) . |
public static java.lang.String getGuiId()
public static java.lang.String getGuiId(javax.servlet.http.HttpServletRequest req)
req
- the requestpublic static org.json.JSONObject getChangesAsJSON()
getGuiId()
.getChangesAsJSON(String, Set, boolean)
public static org.json.JSONObject getChangesAsJSON(boolean avoidAutoNotification)
getGuiId()
.avoidAutoNotification
- if true, the changes will not be send back to the originating client session via notification.getChangesAsJSON(String, Set, boolean)
public static org.json.JSONObject getChangesAsJSON(java.lang.String guiId)
guiId
- the id of the XMLGui to usegetChangesAsJSON(String, Set, boolean)
public static org.json.JSONObject getChangesAsJSON(java.lang.String guiId, boolean avoidAutoNotification)
guiId
- the id of the XMLGui to useavoidAutoNotification
- if true, the changes will not be send back to the originating client session via notification.getChangesAsJSON(String, Set, boolean)
public static java.util.Set<Pair<java.lang.Long,java.lang.Long>> toChangeSet(java.util.Collection<ActivityInstance> ais)
getChangesAsJSON(String, Set)
.ais
- the collection of ActivityInstancespublic static org.json.JSONObject getChangesAsJSON(java.lang.String guiId, java.util.Set<Pair<java.lang.Long,java.lang.Long>> additionalChangeSet)
Beware: this call commits the actions.
guiId
- the id of the XMLGui to use; can also be nodeId, then the guiId prefix will be extracted.additionalChangeSet
- additional information about changes to activityinstances that could not be automatically detected by the system. Can be null.getChangesAsJSON(String, Set, boolean)
public static org.json.JSONObject getChangesAsJSON(java.lang.String guiId, java.util.Set<Pair<java.lang.Long,java.lang.Long>> additionalChangeSet, boolean avoidAutoNotification)
Beware: this call commits the actions.
According theadditionalChangeSet
parameter: sometimes the activityinstances do not change, but nevertheless they may end up in different worklists (e.g. movement),
since there are no updates associated with this activityinstances, there are no detectable storage events for this activityinstances.
The additionalChangeSet
parameter can be used to inform this method about such changes. It is a set of pairs of oids and transactionids
of such activityinstances that did not change in terms of the database but in terms of gui representation (see: toChangeSet(Collection)
).
N.B.Changes specified via additionalChangeSet
will only be reflected in the result of this function and not in notifications for other sessions.
If other sessions should be notified about such undetectable changes too,
use WfEngine.propagateChange(ActivityInstance)
before calling this function.
guiId
- the id of the XMLGui to use; can also be nodeId, then the guiId prefix will be extracted.additionalChangeSet
- additional information about changes to activityinstances that could not be automatically detected by the system. Can be null.avoidAutoNotification
- if true, the changes will not be send back to the originating client session via notification.
In this case the it is the responsibility of the caller to send the changes back itself.public static org.json.JSONObject getAsJSON(java.lang.String wlNodeId, ActivityInstance ai)
wlNodeId
- the id of the worklist node in the the XMLGui to use. Must be prefixed by a gui id (e.g. standard.wl).ai
- the ActivityInstance@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.