This Action performs a HTTP POST request with a JSON body. The body is build using the transfer mapping of the Task and the configured transfer target type.
The Action is implemented by the Java class de.ecm4u.faw.api.impl.HTTPPostJSONAction.
The Action has two required parameters:
HTTPPostJSONAction.transferMappingBaseName: The first part of the name of the transfer mapping textresource. Usually equals the Task Name, but can also be different in order to use one mapping configuration for several tasks.HTTPPostJSONAction.transferMappingTargetName: The ID of the transfer target. This will be used to look up information necessary to connect to the transfer target. The lookup is done in the global configuration. The value of this parameter is also used as the second part of the transfer mapping textresource name.HTTPPostJSONAction.transferMappingTargetNames: Same as transferMappingTargetName, but as a list of IDs. This way a POST can be send to multiple targetsThe Action has one optional parameter:
HTTPPostJSONAction.premapping: An object of additional properties that shall be injected as Form properties while resolving the transfer mapping values. Each key in this object is the name of such a property, the corresponding value defines how the value of this property shall be resolved.
method: How the value shall be resolved.
taskproperty: The value of the injected form property shall be resolved from a Task Property.
key: The name of the Task Property to resolve for the value of the injected form property. If the name of the Task Property is preceeded by a dollar sign $, the resolving is done indirectly: As the first step the value of the named Task Property is read. This value is used as the name of another Task Property whose value is read as the second step. This value is used as the value of the injected Form property.HTTPPostJSONAction.transferMappingDocumentRoleNames: A list of role names. Only the listed roles will be posted to the target.The name of the textresource of the transfer mapping is build as
{transferMappingBaseName}-{transferMappingTargetName}-{role}
transferMappingBaseName and transferMappingTargetName are parameters configured in the HTTPPostJSONAction and must match this file name.role is an optional attribute of a document in a task that is configured in the DocumentResourceRoles Subject of the Configuration Service. It specifies the role of a document in a task (e.g. Attachment and Document). By adding the role at the end of a transfer mapping, it is possible to define different mappings for the same transfer target (e.g. An Attachement can receive other data as the Document). It is not required to add a role to name of a transfer mapping textresource, all document roles will use the same mapping in this case.Using these parameters single Form of the Task is used when building the body.
HTTPPostJSONAction.transferMappingBaseName: ecm4uBizDocs_DocumentDataCapture
HTTPPostJSONAction.transferMappingTargetName: alfresco
HTTPPostJSONAction.premapping:
entityId:
method: taskproperty
key: "$entityIdPropertyName"
ecm4uBizDocs_DocumentDataCapture-alfresco.entityId is injected into the formData of the Form. The value of this property is read by resolving the Task Property entityIdPropertyName which contains the name of another Task property whose value is used.A transfer mapping is a JSON Textresource. It defines a template of a JSON object that will be used to build the body for the HTTP POST request.
The following values can be used:
@ prefix$ prefix$$ prefixldrp: prefixrs:connector. or rs:content. or rs:resource prefixExample:
{
"alfrescoType": "bd:SupplierInvoice",
"properties": {
"cm:title": "@cm_title",
"cm:description": "@cm_description",
"bd:partnerNo": "@bd_partnerNo",
"bd:creditorNo": "@bd_creditorNo",
"bd:invoiceNo": "@bd_invoiceNo",
"bd:receivedDate": "@bd_receivedDate",
"bd:payableDate": "@bd_payableDate",
"bd:docDate": "@bd_docDate",
"bd:earlyPaymentDiscount": "@bd_earlyPaymentDiscount",
"bd:earlyPaymentDiscountDate": "@bd_earlyPaymentDiscountDate",
"bd:invoiceDate": "@bd_invoiceDate",
"bd:paymentAmountGross": "@bd_paymentAmount",
"bd:paid": "@bd_paid",
"bd:datePaid": "@bd_datePaid",
"md:contactNoList": "@md_contactNoList",
"md:contractNoList": "@md_contractNoList",
"md:projectNoList": "@md_projectNoList",
"md:employeeNoList": "@md_employeeNoList",
"md:productNoList": "@md_productNoList",
"md:issueNoList": "@md_issueNoList",
"md:creditorNoList": "@md_creditorNoList",
"md:partnerNoList": "@md_partnerNoList",
"cm:name": "@cm_name",
"md:caseNoList": "@md_caseNoList",
"md:customerOfferNoList": "@md_customerOfferNoList",
"sm:flow": "@sm_flow",
"sm:status": "@sm_status",
"sm:value": "@sm_value"
},
"nodeRef": "#backendResourceId",
"runAs": "$originalAuthority"
}