OpenSession
Node Action:
This node action opens a session referenced by a selected Editor assignment.
Parameters:
se_type
OpenSession
se_type = OpenSession
se_determineAssignmentId
Lambda expression that expects the target assignment ID as the returned value.
se_closeSessionManagerWindow
Boolean that controls whether the Session Manager window should remain open after opening a selected session.
Example:
Open Session: The following workflow illustrates how to open a session selected by a user:
digraph workflow {
entry[
label = "Open Session Button"
se_type0 = SessionOperationTrigger
se_isPrimaryOperation0 = true,
se_displayName0 = "Open Session",
se_sortOrder0 = 10,
se_showButtonText0 = false,
se_visibilityCondition0 = "(ctx, log) => {
return ctx.Event.assignment.assignedTo == ctx.User.UserId &&
(ctx.Event.isSessionOpen == null || ctx.Event.isSessionOpen == false);
}",
se_iconXaml0 = "
<Canvas
Width=\"32\"
Height=\"32\"
SnapsToDevicePixels=\"True\">
<Path
Data=\"M 1.0857284,26.93696 V 4.4772093 h 9.1557426 l 1.885006,2.5267215 16.426478,0.1403736 v 3.2285896\"
Fill=\"{StaticResource SE_SkyBlueBrush}\"
Stroke=\"{DynamicResource SE_DarkGrayBrush}\"
StrokeEndLineCap=\"Round\"
StrokeMiterLimit=\"1.0\"
StrokeStartLineCap=\"Round\"
StrokeThickness=\"2.0\" />
<Path
Data=\"M 31.245822,11.074762 26.937236,27.217706 1.0857284,27.077332 6.2021726,11.074762 H 31.111178\"
Fill=\"{DynamicResource SE_WhiteBrush}\"
Stroke=\"{DynamicResource SE_DarkGrayBrush}\"
StrokeEndLineCap=\"Round\"
StrokeMiterLimit=\"1.0\"
StrokeStartLineCap=\"Round\"
StrokeThickness=\"2.0\" />
</Canvas>"
]
requestPendingEditsSave[
label = "Prompt user to save pending edits (if any)"
se_type0 = RequestPendingEditsSave
se_resultVariable0 = "SaveEditsResult"
se_type1 = Action
se_action1 = "(ctx, log) => {
ctx.State.ShouldCancel = ctx.State.SaveEditsResult == \"Canceled\";
}"
]
checkVersionExists[
label = "Does Version Exist?"
se_type0 = Action
se_action0 = "(ctx, log) => {
ctx.State.VersionExists = ctx.Event.session.createdStatus == \"Created\";
}",
]
checkVersionExists->createVersion[
label = "No"
se_type = Condition
se_condition = "(ctx, log) => !ctx.State.VersionExists"
]
checkVersionExists->openSession[
label = "Yes"
se_type = Condition
se_condition = "(ctx, log) => ctx.State.VersionExists"
]
createVersion[
label = "Create Version"
se_type0 = Api,
se_method0 = "POST"
se_modifyRequest0 = "(request, ctx, log) => {
request.RequestUri = new Uri($\"api/v1/Sessions/{ctx.Event.session.id}/createVersion\", UriKind.RelativeOrAbsolute);
log.LogDebug($\"Request uri : {request.RequestUri}\");
}",
se_resultVariable0 = SessionResource
se_service0 = "SessionManager"
]
refreshUI[
label = "Refresh Job List"
se_type0 = RefreshMyJobsList,
se_type1 = Timer,
se_delay1 = 200,
se_type2 = SelectMyAssignment,
se_determineAssignmentId2 = "(ctx, log) => {
return ctx.Event.assignment.id.ToString();
}",
]
createVersion->refreshUI->openSession
openSession[
label = "Open Session"
se_type0 = OpenSession
se_determineAssignmentId0 = "(ctx, log) => ctx.Event.assignment.id.ToString()"
se_type1 = Timer,
se_delay1 = 500,
]
exit[
shape=invhouse,
color="#22FF44",
style=filled
]
requestPendingEditsSave->exit[
label = "User canceled"
se_type = Condition
se_condition = "(ctx, log) => ctx.State.ShouldCancel"
]
requestPendingEditsSave-> checkVersionExists[
se_type = Condition
se_condition = "(ctx, log) => !ctx.State.ShouldCancel"
]
entry->requestPendingEditsSave;
openSession->exit;
}