Bulk Create Workflow BPs

POST /ws/rest/service/v2/bp/record/bulk

Purpose

To bulk create workflow BP records for Simple and Line Item types without configurable module. The REST service supports a maximum of 1000 upper form records.

The REST service does not support:

  • records with attachments
  • assignee filtering conditions
  • email notifications to assignees
  • generating event notification logs for each workflow or non-workflow record

This REST service is not supported for integration with Oracle Integration.

Assumptions For Creation Service

  • Record_no is auto-generated. User input is ignored.
  • Status of a BP record is determined by the action taken. User input is ignored.
  • Record due date is determined by the workflow setup. User input is ignored.

Behavior of the Due Date (due_date) Field

If the Override Workflow Due Date field is set to Yes for a workflow business process, when you create workflow BP records through a REST service, the Due Date provided in the input request is used.

When you update workflow BP records through a REST service, you cannot change the Due Date.

Request Format

To use this REST service:

  • Authentication token is required in the Authorization header.
  • Generate the token through the Unifier Administration interface or by using the REST service.
  • Set the Content-Type as "application/json"

Send an API request as a JSON Map with the following structure:

{

"options":{

"bpname": "<value>",

"project_number": "<value>",

"async": "<value>" },

//For a workflow BP include the required workflow details below//

"workflow_details": {

"workflow_name": "<value>",

"action_name": "<value>",

"user_name": "<value>"

}

"data":[<one or more JSON map of BP records>]

}

Note:

  • If "workflow" is not present in "options", the template and action selection use the default setting in the Auto-Creation.
  • A maximum of 1000 upper form records can be included in the data [ ] section of the request.
  • In the workflow, if the conditional link is under creation step directly, the routing is not dynamically evaluated. The inbound action name to the conditional step goes to the resolving step, and outbound action name from the conditional step goes to the corresponding next step.
  • When you use Bulk Create or Bulk Update, you start by exporting the BP design structure to a Microsoft Excel or CSV file and then populating the required fields. If you leave a Data Picker Data Element (DE) field blank that is configured to Auto Populate, the system completes the field when you run a Bulk Create; however, it does not complete the field when you run a Bulk Update. To reduce confusion and maintain consistency for both Bulk Create and Bulk Update, the system uses the Excel or CSV file to populate the Data Picker field if the field is excluded from the Integration Form for the BP design.

Request Parameters

The following parameters can be included in the request:

Request Parameter Required? Data Type Description
bpname Yes String

The name of the workflow BPs of the following types:

  • Simple BPs
  • Line Item BPs
project_number Yes String The active shell number where the project details will be updated.
async No String

Indicate whether to process the API request asynchronously. Valid values include:

  • True: Request is processed asynchronously
  • False: A URL is returned in the response for you to check on the status of the request.
workflow_name Yes, for workflow BPs String The workflow setup associated with a workflow template.
action_name Yes, for workflow BPs String The action name to a step under creation.
user_name Yes, for workflow BPs String The first name and last name of the user who create the record.

Response Format

A JSON object is returned in the following format:

{

"data": [],

"message": [<list of messages>],

"status": <REST status code value>,

"rest_audit_id": "Value"

}

Sample Create Request

To create a non-workflow BP with two line items, send a request in the following format:

{

"options": {

"project_number":"91FMWBS0001",

"bpname": "Workflow LI BP",

"async": true,

"workflow_details": {

"workflow_name": "wf1setup",

"action_name": "SendAsOpen",

"user_name": "madhuALL auto"

}

},

"data": [

{

"title": "test102",

"creator_id": "madhuALL auto",

"status": "Pending",

"uuu_float": 101.0,

"_bp_lineitems": [

{

"amount": 1.0,

"tab_id": 0,

"description": "a1",

"uuu_tab_id": "Standard-u4001",

"short_desc": "S1",

"li_num": 1

},

{

"amount": 2.0,

"tab_id": 0,

"description": "a2",

"uuu_tab_id": "Standard-u4001",

"short_desc": "S2",

"li_num": 2

}

]

},

{

"title": "test103",

"creator_id": "madhuALL auto",

"status": "Pending",

"uuu_float": 99.1

}

]

}

Sample Success Response to Process Request Asynchronously

When you choose to process the request asynchronously, the following URL is included in the response for you to check the status periodically.

{

"message": {

"@uri": "/ws/rest/service/status/job/756",

"job_id": "756"

},

"status": "202"

}

Sample Success Response Without Asynchronous Process

When you don't choose to process the request asynchronously, a response is sent in the following format.

{

"data": [],

"message": [

"success"

],

"status": 200,

"rest_audit_id": 353

}

Supported Validation Messages and Status Codes

The following error messages and status codes display in the response when incorrect values are provided in the request.

Field Name Use-case Scenario Status Code Error Message
bpname The business process name is not provided in the request. 603 Business Process Name is required.
bpname The business process name is invalid. 603 Business Process Name is not correct."
bpname The business process is of workflow type. 4006 BP must be of Non Workflow.
bpname The business process name is not a Simple or Line Item type BP. 4006 BP must be of 'simple' or 'lineitem' type.
bpname The business process is a Lineitem type BP with configurable module. 4006 Business Process having Line items with Configurable Module code is not supported for bulk creation.
bpname A business process of type, single record. 4006 Single record Business Process is not supported for bulk creation.
project_number An invalid project number is entered in the request. 602 Project/Shell Number is not correct.
project_number An inactive project number is entered in the request. 1219 Project status is Inactive.
workflow_name workflow_name is missing, empty, or invalid. 901 The workflow name is not valid.
action_name action_name is missing, empty, or invalid 903 The workflow action name is not valid.
user_name user_name is missing, empty, or invalid 900 Enter a valid or an active user.
user_name Invalid user_name value as an assignee. 902 The user does not have an active workflow template.
Maximum records The data[] element has more than 1000 records. 19001 Total number of Upper form records exceeds limit of 1000.