Skip to content

Commit

Permalink
attachment rest callable SubProcess (#11)
Browse files Browse the repository at this point in the history
* attachment rest callable SubProcess

* tag - connector
  • Loading branch information
jirafra authored May 30, 2023
1 parent 6508f27 commit 0815390
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 0 deletions.
5 changes: 5 additions & 0 deletions talentlink-connector/dataclasses/rest/AttachmentData.ivyClass
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
AttachmentData #class
rest #namespace
attachment com.axonivy.connector.talentlink.entity.Attachment #field
attachmentId Long #field
error ch.ivyteam.ivy.bpm.error.BpmError #field
82 changes: 82 additions & 0 deletions talentlink-connector/processes/rest/Attachment.p.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"format" : "10.0.0",
"id" : "1882E31A11B7E690",
"kind" : "CALLABLE_SUB",
"config" : {
"data" : "rest.AttachmentData"
},
"elements" : [ {
"id" : "f0",
"type" : "CallSubStart",
"name" : "getAttachment(Long)",
"config" : {
"callSignature" : "getAttachment",
"input" : {
"params" : [
{ "name" : "attachmentId", "type" : "Long" }
],
"map" : {
"out.attachmentId" : "param.attachmentId"
}
},
"result" : {
"params" : [
{ "name" : "attachment", "type" : "com.axonivy.connector.talentlink.entity.Attachment" },
{ "name" : "error", "type" : "ch.ivyteam.ivy.bpm.error.BpmError" }
],
"map" : {
"result.attachment" : "in.#attachment",
"result.error" : "in.#error"
}
},
"tags" : "connector"
},
"visual" : {
"at" : { "x" : 96, "y" : 64 }
},
"connect" : { "id" : "f4", "to" : "f5" }
}, {
"id" : "f1",
"type" : "CallSubEnd",
"visual" : {
"at" : { "x" : 352, "y" : 64 }
}
}, {
"id" : "f5",
"type" : "RestClientCall",
"name" : "Attachment",
"config" : {
"path" : "/candidate/attachment/{documentId}",
"clientId" : "d8e4652e-41d5-4023-90c5-5c822b8600e2",
"clientErrorCode" : "ivy:error:rest:client",
"statusErrorCode" : "ivy:error:rest:client",
"responseMapping" : {
"out.attachment" : "result"
},
"templateParams" : {
"documentId" : "in.attachmentId"
},
"resultType" : "com.axonivy.connector.talentlink.entity.Attachment"
},
"visual" : {
"at" : { "x" : 232, "y" : 64 }
},
"boundaries" : [ {
"id" : "f10",
"type" : "ErrorBoundaryEvent",
"config" : {
"output" : {
"map" : {
"out" : "in",
"out.error" : "error"
}
}
},
"visual" : {
"at" : { "x" : 264, "y" : 96 }
},
"connect" : { "id" : "f3", "to" : "f1" }
} ],
"connect" : { "id" : "f2", "to" : "f1" }
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.axonivy.connector.talentlink.entity;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Entity for Attachment received from Rest call
*/
public class Attachment {
@JsonProperty("fileName")
private String fileName = null;

@JsonProperty("mimeType")
private String mimeType = null;

@JsonProperty("base64EncodedContent")
private String base64EncodedContent = null;

public String getFileName() {
return fileName;
}

public void setFileName(String fileName) {
this.fileName = fileName;
}

public String getMimeType() {
return mimeType;
}

public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}

public String getBase64EncodedContent() {
return base64EncodedContent;
}

public void setBase64EncodedContent(String base64EncodedContent) {
this.base64EncodedContent = base64EncodedContent;
}

}

0 comments on commit 0815390

Please sign in to comment.