2 Job Definition Naming Convention
This topic describes the naming convention that to be followed when a custom job is introduced as a task into EOD process.
- Milestone task name must be prefixed with "MS-". Ex: MS-BranchCutOff
Milestone stage
Milestone stage will pause the batch execution till it is manually resumed.
Sample template for milestone stage
{
"name": "MS-CHKAFTEREOTI",
"taskReferenceName": "MS-CHKAFTEREOTI",
"inputParameters": {
"http_request": {
"connectionTimeOut": "0",
"readTimeOut": "0",
"vipAddress": "CMC-BRANCH-SERVICES",
"uri": "/cmc-branch-services/brancheod/milestone",
"method": "POST",
"headers": {
"appId": "CMNCORE",
"branchCode": "${workflow.input.branchCode}",
"userId": "${workflow.input.userID}"
},
"body": {
"data": [
{
"workflowId": "${workflow.workflowId}",
"taskId": "${CPEWF_TASK_ID}",
"waitTime": "5000"
}
]
}
}
},
"type": "HTTP",
"startDelay": 0,
"optional": false,
"asyncComplete": true
}
Steps to integrate Custom Jobs
- If the custom job uses Oracle Banking Microservices Architecture Batch service, then use the below template to include the job as a task in EOD Flow definition.
{ "type":"HTTP", "name":"<MilestoneCode.JobName>", "taskReferenceName":"<MilestoneCode.JobName>", "inputParameters":{ "http_request":{ "connectionTimeOut":"0", "readTimeOut":"0", "vipAddress":"PLATO-BATCH-SERVER", "uri":"/plato-batch-server/jobLauncher/launch/", "method":"POST", "headers":{ "appId":"${workflow.input.appId}", "branchCode":"${workflow.input.branchCode}", "userId":"${workflow.input.userId}" }, "body":{ "jobName":"<JobName>", "jobParameters":[ { "key":"appId", "value":"<Application ID of microservice>" }, { "key":"microServiceName", "value":"<Microservice name>" }, { "key":"contextRoot", "value":"<Context root of microservice>" }, { "key":"workflowId", "value":"${workflow.workflowId}" }, { "key":"referenceTaskName", "value":"<MilestoneCode.JobName>" }, { "key":"userId", "value":"${workflow.input.userId}" }, { "key":"branchCode", "value":"${workflow.input.branchCode}" }, { "key":"isCallback", "value":"Y" }, { "key":"callbackType", "value":"PLATOORCH" } ] } }, "asyncComplete":true }, "startDelay":0, "optional":false, "asyncComplete":true }
- If the custom job doesn’t use the Oracle Banking Microservices Architecture Batch service. The Batch API is implemented as a synchronous call, use the below template to include the job as a task in EOD Flow definition.
{ "type":"HTTP", "name":"<MilestoneCode.JobName>", "taskReferenceName":"<MilestoneCode.JobName>", "inputParameters":{ "http_request":{ "connectionTimeOut":"0", "readTimeOut":"0", "vipAddress":"<Microservice name registered in eureka>", "uri":"<relative URL>", "method":"<HTTP Method>", "headers":{ "appId":"${workflow.input.appId}", "branchCode":"${workflow.input.branchCode}", "userId":"${workflow.input.userId}" } }, "asyncComplete":false }, "startDelay":0, "optional":false, "asyncComplete":true }
Note:
HTTP Method - One of the GET, PUT, POST, DELETE, OPTIONS, HEAD - If the custom job doesn’t uses Oracle Banking Microservice Architecture Batch service and if the Batch API is implemented as an asynchronous call, then call back needs to be implemented in the respective API. Use the below template to include the job as a task in EOD Flow Definition.
{ "type":"HTTP", "name":"<MilestoneCode.JobName>", "taskReferenceName":"<MilestoneCode.JobName>", "inputParameters":{ "http_request":{ "connectionTimeOut":"0", "readTimeOut":"0", "vipAddress":"<Microservice name registered in eureka>", "uri":"<relative URL>", "method":"<HTTP Method>", "headers":{ "appId":"${workflow.input.appId}", "branchCode":"${workflow.input.branchCode}", "userId":"${workflow.input.userId}" } }, "asyncComplete":true }, "startDelay":0, "optional":false, "asyncComplete":true }
Table 2-1 Batch API
Method | Post | Description |
---|---|---|
URL | http://<hostname>:<port>/plato-orch-service/api/tasks | - |
Headers |
userId : <Logged in user id> branchCode : <Logged in branch code> appId : platoorch Content-Type : application/json Accept : application/json |
userId – User who updates the task branchCode – Branch where the update is performed. |
Body |
|
EOD_Workflow_ID – A Workflow ID gets generated when EOD is invoked Task_ID – Unique task ID gets generated for each task once it starts Status – COMPLETED / FAILED_WITH_TERMINAL_ERROR / FAILED / IN_PROGRESS |
Note:
asyncComplete – field in EOD workflow definition should be set to true if the Http task makes an asynchronous call and the task has to be updated explicitly by calling above update APIs. Only after successful update, next task will get executed.