AttachDesignAttachment
Node Action:
The AttachDesignAttachment node action makes an HTTP call to an ArcGIS endpoint
Parameters:
se_type
AttachDesignAttachment
se_type = AttachDesignAttachmentse_determineFilePath
The URI to which the request is sent.
se_determineAttachmentPath
A lambda to build up an attachment name for the attached file in Designer Storage Service.
se_attachmentName
The attachment name for the attached file in Designer Storage Service.
se_mediaType
The media type for the attachment.
se_designId
The design ID to attach the file to.
se_determineDesignId
A lambda to determine the design ID to attach the file to.
Example:
Attach Construction Drawing: The following workflow allows you to attach a file to a design and store it in the Designer Storage Service.
digraph finite_state_machine {
splines=spline;
edge[arrowsize=1, color=black];
node[shape = box, color = green];
entry[
label = "Print Tool - Attach Construction Drawing",
shape= invhouse,
height = 1,
se_type1 = PrintToolTrigger,
se_displayName1 = "Attach Construction Drawing",
se_iconService1 = KvStorage,
se_iconUrl1 = "/api/v1/global/_attachment/SE.Geospatial.Designer/Settings/PrintTools/AttachConstructionDrawing",
se_sortOrder1 = 20,
se_requiresConnection1 = true,
se_visibilityCondition1 = "function (ctx, log) {
var hasArcFMMobile = ctx.User.TenantInfo.auth0Apps.find(x => x.name == \"ArcFM Mobile (OIDC)\");
return hasArcFMMobile != null && hasArcFMMobile != undefined;
}"
];
generateDocument[
label = "Generate print of all pages"
se_type1 = GenerateDocument,
se_pageRange1 = "All",
se_resultVariable1 = GeneratedDocumentPath
]
openDefaultPdfViewer[
label = "Open default PDF viewer"
se_type0 = LaunchUriScheme,
se_determineUri0 = "function (ctx, log) {
return ctx.State.GeneratedDocumentPath;
}"
]
promptUser[
label = "Should attach print?"
se_type0 = PromptUser,
se_promptCaption0 = "Attach Construction Print",
se_cardTemplate0 = "{
\"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\",
\"type\": \"AdaptiveCard\",
\"version\": \"1.3\",
\"body\": [
{
\"type\": \"TextBlock\",
\"text\": \"Do you like how your print looked?\"
},
{
\"type\": \"ActionSet\",
\"actions\": [
{
\"type\": \"Action.Submit\",
\"title\": \"Attach\"
},
{
\"type\": \"Action.Submit\",
\"title\": \"Cancel\"
}
]
}
]
}",
se_resultVariable0 = ShouldPrintResponse
]
attachPrintAsDesignAttachment[
label = "Attach Print as Design Attachment"
se_type0 = AttachDesignAttachment,
se_attachmentName0 = "ConstructionDrawing"
se_determineDesignId0 = "function (ctx, log) {
return `${ctx.Event.design.id}`;
}",
se_determineFilePath0 = "function (ctx, log) {
return ctx.State.GeneratedDocumentPath;
}",
se_mediaType0 = "application/pdf"
]
exit[
label= "Complete",
shape=invhouse,
style=filled
]
cancelled[
label = "Cancelled",
shape=invhouse,
color=yellow,
style=filled
]
entry->generateDocument;
generateDocument->openDefaultPdfViewer[
se_type = Condition,
se_condition = "function (ctx, log) {
return ctx.State.GeneratedDocumentPath != null;
}"
]
generateDocument->cancelled[
se_type = Condition,
se_condition = "function (ctx, log) {
return ctx.State.GeneratedDocumentPath == null;
}"
]
openDefaultPdfViewer->promptUser;
promptUser->attachPrintAsDesignAttachment[
se_type = Condition,
se_condition = "function (ctx, log) {
return ctx.State.ShouldPrintResponse.submittedAction.title == \"Attach\";
}"
]
attachPrintAsDesignAttachment->exit;
promptUser->cancelled[
se_type = Condition,
se_condition = "function (ctx, log) {
return ctx.State.ShouldPrintResponse.submittedAction.title != \"Attach\";
}"
]
}