1. Overview

Microservice containing the business logic for managing templates of approvalcockpit .

1.1. URI scheme

Host : localhost
BasePath : /approval-cockpit-app-service/

1.2. Tags

  • activity-controller : Activity Controller

  • line-controller : Line Controller

  • unit-controller : Unit Controller

  • user-groups-controller : User Groups Controller

  • user-settings-controller : User Settings Controller

  • workflow-configuration-controller : Workflow Configuration Controller

  • workflow-event-controller : Workflow Event Controller

  • workflow-execution-controller : Workflow Execution Controller

  • workflow-level-group-execution-controller : Workflow Level Group Execution Controller

2. Resources

2.1. Activity-controller

Activity Controller

2.1.1. Fetches List of activities containing their variable counts

GET /v1/activities/{id}/activityVariableCounts
Parameters
Type Name Description Schema

Path

id
required

Activity Id.

integer (int64)

Responses
HTTP Code Description Schema

200

OK

ActivitiesVariableCountsResource

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.2. Line-controller

Line Controller

2.2.1. Get all the lines

GET /v1/lines
Responses
HTTP Code Description Schema

200

OK

< LineData > array

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.3. Unit-controller

Unit Controller

2.3.1. Units of all lines

GET /v1/units
Responses
HTTP Code Description Schema

200

OK

< UnitsData > array

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.4. User-groups-controller

User Groups Controller

2.4.1. Get all the groups

GET /v1/groups
Responses
HTTP Code Description Schema

200

OK

< GroupData > array

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.5. User-settings-controller

User Settings Controller

2.5.1. Create User settings for the logged in user

POST /v2/settings
Parameters
Type Name Description Schema

Body

userSettingsRequest
optional

User Setting Object

UserSettingRequest

Responses
HTTP Code Description Schema

201

Created

UserSettingResource

204

No Content, Error retrieving created user settings

HttpErrorResponse

400

Invalid data supplied

HttpErrorResponse

401

User Unauthorized

No Content

404

App ID not found in privilege set

HttpErrorResponse

409

Conflict, User Setting already exists. Use a PUT to update

HttpErrorResponse

500

Internal Server Error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.5.2. Get User settings for the logged in User

GET /v2/settings
Parameters
Type Name Description Schema

Query

appId
required

appId

integer (int32)

Query

viewName
required

viewName

string

Responses
HTTP Code Description Schema

200

OK

UserSettingResource

400

Invalid data supplied

HttpErrorResponse

401

User Unauthorized

No Content

404

Not found, no user setting found for the user

HttpErrorResponse

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.5.3. Update User settings for the logged in user

PUT /v2/settings
Parameters
Type Name Description Schema

Body

request
optional

User Preference Object

UserSettingRequest

Responses
HTTP Code Description Schema

200

OK

UserSettingResource

400

Invalid data supplied

HttpErrorResponse

401

User Unauthorized

No Content

404

Not Found, There is no saved User settings for the logged in user

HttpErrorResponse

500

Internal Server Error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.5.4. Delete User settings for the logged in user

DELETE /v2/settings
Parameters
Type Name Description Schema

Query

appId
required

appId

integer (int32)

Query

viewName
required

viewName

string

Responses
HTTP Code Description Schema

200

OK

object

204

Success

object

400

Invalid data supplied

HttpErrorResponse

401

User Unauthorized

No Content

404

Not Found, User Setting not found

HttpErrorResponse

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.5.5. Get Privilege Sets

GET /v2/settings/apps
Parameters
Type Name Description Schema

Query

appName
optional

appName

string

Responses
HTTP Code Description Schema

200

OK

< PrivilegeSet > array

400

Invalid data supplied

HttpErrorResponse

401

User Unauthorized

No Content

404

Not found, no user setting found for the user

HttpErrorResponse

500

Internal Server Error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.6. Workflow-configuration-controller

Workflow Configuration Controller

2.6.1. Create WorkFlow Configurations

POST /v1/workflow-configurations
Parameters
Type Name Description Schema

Body

workflowConfigurationRequest
required

workflowConfigurationRequest

Workflow Configuration Create Info

Responses
HTTP Code Description Schema

201

Created

WorkflowConfigurationInfo

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

409

Workflow with that name already exists

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.6.2. Query Workflow Configurations

GET /v1/workflow-configurations
Parameters
Type Name Description Schema Default

Query

eventId
required

Event id of the configurtion (Refer API /eventType )

integer (int32)

Query

page
optional

Results page you want to retrieve (0..N)

integer (int32)

0

Query

size
optional

Number of records per page.

integer (int32)

20

Responses
HTTP Code Description Schema

200

OK

WorkflowConfigurationInfosPage

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.6.3. Query Workflow details

GET /v1/workflow-configurations/{id}
Parameters
Type Name Description Schema

Path

id
required

Workflow Configuration Id.

integer (int64)

Responses
HTTP Code Description Schema

200

OK

WorkflowConfigurationInfoResponse

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.6.4. Update WorkFlow Configurations

PUT /v1/workflow-configurations/{id}
Parameters
Type Name Description Schema

Path

id
required

Workflow Configuration Id.

integer (int64)

Body

workflowConfigurationRevisionRequest
required

workflowConfigurationRevisionRequest

WorkflowConfigurationRevisionRequest

Responses
HTTP Code Description Schema

200

OK

WorkflowConfigurationInfo

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.7. Workflow-event-controller

Workflow Event Controller

2.7.1. Query Workflow Events

GET /v1/workflow-events
Responses
HTTP Code Description Schema

200

OK

< WorkflowEventInfo > array

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.8. Workflow-execution-controller

Workflow Execution Controller

2.8.1. Approve Workflow Execution

POST /v1/workflow-executions/{id}/approve
Parameters
Type Name Description Schema

Path

id
required

Id of the workflow execution.

integer (int64)

Body

request
required

request

WorkflowExecuteRequest

Responses
HTTP Code Description Schema

200

OK

object

204

No Content

object

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.8.2. Approval Details

GET /v1/workflow-executions/{id}/level-groups
Parameters
Type Name Description Schema

Path

id
required

Id of the workflow execution.

integer (int64)

Responses
HTTP Code Description Schema

200

OK

< ExecutionDetails > array

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.8.3. Add monitor group

POST /v1/workflow-executions/{id}/monitor-group
Parameters
Type Name Description Schema

Path

id
required

Id of the workflow execution.

integer (int64)

Body

monitorGroupRequest
required

monitorGroupRequest

MonitorGroupRequest

Responses
HTTP Code Description Schema

201

Created

MonitorGroupResponse

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.8.4. Update monitor group

PUT /v1/workflow-executions/{id}/monitor-group/{monitor-group-id}
Parameters
Type Name Description Schema

Path

id
required

Id of the workflow execution.

integer (int64)

Path

monitor-group-id
required

monitor-group-id

integer (int64)

Body

monitorGroupRequest
required

monitorGroupRequest

MonitorGroupRequest

Responses
HTTP Code Description Schema

200

OK

MonitorGroupResponse

201

Created

MonitorGroupResponse

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json;charset=UTF-8

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.8.5. Reject Workflow Execution

POST /v1/workflow-executions/{id}/reject
Parameters
Type Name Description Schema

Path

id
required

Id of the workflow execution.

integer (int64)

Body

request
required

request

WorkflowExecuteRequest

Responses
HTTP Code Description Schema

200

OK

object

204

No Content

object

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.8.6. Reverify of the approved workflow

POST /v1/workflow-executions/{id}/reverify
Parameters
Type Name Description Schema

Path

id
required

Id of the workflow execution.

integer (int64)

Body

rerequest
required

rerequest

ReverifyRequest

Responses
HTTP Code Description Schema

200

OK

object

204

No Content

object

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Consumes
  • application/json

Produces
  • application/json

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

2.9. Workflow-level-group-execution-controller

Workflow Level Group Execution Controller

2.9.1. Query Workflow Level Groups Execution Details

GET /v1/workflow-level-group-executions
Parameters
Type Name Description Schema Default

Query

level
optional

Level of the execution as a filter.

integer (int32)

Query

onlyMyWorkflows
optional

Currently logged in user’s executions as a filter.

boolean

"true"

Query

page
optional

Results page you want to retrieve (0..N)

integer (int32)

0

Query

size
optional

Number of records per page.

integer (int32)

20

Query

status
optional

status

< enum (Pending, InProgress, Approved, Rejected) > array(multi)

Query

workflowExecutionId
optional

Id of the workflow execution as a filter

integer (int32)

Responses
HTTP Code Description Schema

200

OK

WorkflowLevelGroupExecutionInfoPage

400

Bad Request

HttpErrorResponse

401

Unauthorized

HttpErrorResponse

404

Not Found

HttpErrorResponse

500

Internal Server error

HttpErrorResponse

Produces
  • application/json

Security
Type Name Scopes

oauth2

access_token

default

oauth2

client_creds

default

oauth2

resource_owner

default

oauth2

implicit_grant

default

3. Definitions

3.1. ActivitiesVariableCountsResource

Name Schema

content
optional

< ActivityVariableCounts > array

links
optional

< Link > array

3.2. ActivityVariableCounts

Name Schema

activity
optional

IdNameValue

eventId
optional

integer (int64)

eventType
optional

enum (TimeBasedEvent, ProductionEvent, UserDefinedEvent, ProductChangeEvent)

remainingMandatoryVariablesCount
optional

integer (int32)

totalMandatoryVariablesCount
optional

integer (int32)

totalVariablesCount
optional

integer (int32)

3.3. Error

Name Schema

code
optional

string

details
optional

object

3.4. ExecutionDetails

Name Schema

groupinfo
optional

< GroupStatusInfo > array

levelId
optional

integer (int32)

levelName
optional

string

3.5. Group

Name Schema

groupName
optional

string

groupType
optional

string

securityGroups
optional

< string > array

3.6. GroupData

Name Description Schema

description
optional

The description of the group

string

displayName
optional

The name of the group

string

3.7. GroupInfo

Name Schema

groupName
optional

string

groupType
optional

string

groupTypeId
optional

integer (int32)

levelGroupConfigId
optional

integer (int64)

securityGroups
optional

< SecurityGroup > array

3.8. GroupStatusInfo

Name Description Schema

groupName
optional

string

groupType
optional

string

lastModifiedBy
optional

string

lastModifiedOn
optional

string (date-time)

recievedReverification
optional

Example : false

boolean

status
optional

string

3.9. HttpErrorResponse

Name Schema

error
optional

Error

path
optional

string

timestamp
optional

string

3.10. IdNameValue

Name Description Schema

id
optional

Unique identifier of this id of every pair/used across several services to represent a generic Id

integer (int64)

name
optional

Unique identifier of this name of every pair/used across several services to represent a generic name

string

3.11. Level

Name Schema

escalationDueDays
optional

integer (int32)

groups
optional

< Group > array

name
optional

string

sequence
optional

integer (int32)

3.12. LevelInfo

Name Schema

escalationDueDays
optional

integer (int32)

groups
optional

< GroupInfo > array

name
optional

string

sequence
optional

integer (int32)

3.13. LineData

Name Description Schema

lineId
optional

The assetId of the unit

integer (int64)

lineName
optional

The name of the unit

string

Name Schema

href
optional

string

rel
optional

string

templated
optional

boolean

3.15. MonitorGroup

Name Schema

groupName
optional

string

securityGroupName
optional

string

3.16. MonitorGroupInfo

Name Schema

createdBy
optional

string

createdOn
optional

string (date-time)

groupName
optional

string

id
optional

integer (int32)

securityGroupName
optional

string

3.17. MonitorGroupRequest

Name Schema

name
optional

string

securityGroup
optional

string

3.18. MonitorGroupResponse

Name Schema

createdBy
optional

string

createdOn
optional

string (date-time)

id
optional

integer (int64)

lastModifiedBy
optional

string

lastModifiedOn
optional

string (date-time)

name
optional

string

securityGroupName
optional

string

workflowExecutionId
optional

integer (int64)

3.19. PageMetadata

Name Schema

number
optional

integer (int64)

size
optional

integer (int64)

totalElements
optional

integer (int64)

totalPages
optional

integer (int64)

3.20. PrivilegeSet

Name Schema

category
optional

string

description
optional

string

displayName
optional

string

icon
optional

string

id
optional

integer (int32)

scope
optional

string

3.21. ReverifyRequest

Name Schema

levelGroupExecutionIds
optional

< integer (int64) > array

levelId
optional

integer (int32)

3.22. RevisionGroup

Name Schema

groupName
optional

string

groupType
optional

string

levelGroupConfigId
optional

integer (int64)

securityGroups
optional

< RevisionSecurityGroup > array

3.23. RevisionLevel

Name Schema

escalationDueDays
optional

integer (int32)

groups
optional

< RevisionGroup > array

name
optional

string

sequence
optional

integer (int32)

3.24. RevisionMonitorGroup

Name Schema

groupName
optional

string

id
optional

integer (int32)

securityGroupName
optional

string

3.25. RevisionSecurityGroup

Name Schema

id
optional

integer (int32)

name
optional

string

3.26. SecurityGroup

Name Schema

createdBy
optional

string

createdOn
optional

string (date-time)

id
optional

integer (int32)

name
optional

string

3.27. UnitsData

Name Description Schema

assetId
optional

The assetId of the unit

integer (int64)

name
optional

The name of the unit

string

3.28. UserSettingRequest

Name Description Schema

appId
optional

integer (int32)

data
optional

The application specific settings, Eg:- 'App Name' : {'property1' : 'value' , 'property2' : 'value'} }
Example : {
"AppKey1" : {
"property1" : { },
"property2" : { },
"property3" : { }
},
"AppKey2" : {
"property1" : { },
"property2" : { },
"property3" : { }
},
"AppKey3" : {
"property1" : { },
"property2" : { },
"property3" : { }
}
}

object

viewName
optional

string

3.29. UserSettingResource

Name Description Schema

appId
optional

integer (int32)

data
optional

object

defaultSetting
optional

Example : false

boolean

links
optional

< Link > array

viewName
optional

string

3.30. Workflow Configuration Create Info

Workflow data tranfer object for creation.

Name Schema

equipmentId
optional

integer (int64)

eventId
optional

integer (int32)

levels
optional

< Level > array

lineId
optional

integer (int64)

monitorGroup
optional

MonitorGroup

name
optional

string

3.31. WorkflowConfigurationInfo

Name Schema

createdBy
optional

string

createdOn
optional

string (date-time)

equipementId
optional

integer (int64)

id
optional

integer (int64)

lastModifiedBy
optional

string

lastModifiedOn
optional

string (date-time)

lineId
optional

integer (int64)

lineName
optional

string

name
optional

string

revision
optional

integer (int32)

wfEventName
optional

string

3.32. WorkflowConfigurationInfoResponse

Name Schema

equipmentId
optional

integer (int32)

eventId
optional

integer (int32)

levels
optional

< LevelInfo > array

lineId
optional

integer (int64)

monitorGroup
optional

MonitorGroupInfo

name
optional

string

3.33. WorkflowConfigurationInfosPage

Name Schema

content
optional

< WorkflowConfigurationInfo > array

links
optional

< Link > array

page
optional

PageMetadata

3.34. WorkflowConfigurationRevisionRequest

Name Schema

levels
optional

< RevisionLevel > array

monitorGroup
optional

RevisionMonitorGroup

3.35. WorkflowEventInfo

Name Schema

eventType
optional

string

id
optional

integer (int32)

name
optional

string

3.36. WorkflowExecuteRequest

Name Schema

levelGroupExecutionId
optional

integer (int64)

3.37. WorkflowExecutionsPage

Name Schema

content
optional

< WorkflowLevelGroupExecutionInfo > array

links
optional

< Link > array

page
optional

PageMetadata

3.38. WorkflowLevelGroupExecution

Name Schema

activityId
optional

integer (int64)

groupName
optional

string

groupType
optional

string

id
optional

integer (int64)

levelGroupCreatedOn
optional

string (date-time)

levelId
optional

integer (int32)

levelName
optional

string

monitorGroupId
optional

integer (int64)

monitorSecurityGroup
optional

string

requestId
optional

string

requestName
optional

string

revision
optional

integer (int32)

status
optional

string

workflowExecutionId
optional

integer (int64)

workflowLevelGroupExecutionId
optional

integer (int64)

workflowName
optional

string

workflowStartedBy
optional

string

workflowStartedOn
optional

string (date-time)

3.39. WorkflowLevelGroupExecutionInfo

Name Description Schema

activityId
optional

integer (int64)

groupName
optional

string

groupType
optional

string

id
optional

integer (int64)

levelGroupCreatedOn
optional

string (date-time)

levelId
optional

integer (int32)

levelName
optional

string

monitorGroupId
optional

integer (int64)

monitorSecurityGroup
optional

string

recievedReverification
optional

Example : false

boolean

requestId
optional

string

requestName
optional

string

revision
optional

integer (int32)

status
optional

string

workflowExecutionId
optional

integer (int64)

workflowLevelGroupExecutionId
optional

integer (int64)

workflowName
optional

string

workflowStartedBy
optional

string

workflowStartedOn
optional

string (date-time)

3.40. WorkflowLevelGroupExecutionInfoPage

Name Schema

content
optional

< WorkflowLevelGroupExecution > array

links
optional

< Link > array

page
optional

PageMetadata

4. Security

4.1. access_token

Type : oauth2
Flow : accessCode
Token URL : https://10.181.213.181/uaa/oauth/authorize
Token URL : https://10.181.213.181/uaa/oauth/token

Name Description

default

Default oauth2 scope.

4.2. resource_owner

Type : oauth2
Flow : password
Token URL : https://10.181.213.181/uaa/oauth/token

Name Description

default

Default oauth2 scope.

4.3. implicit_grant

Type : oauth2
Flow : implicit
Token URL : https://10.181.213.181/uaa/oauth/authorize

Name Description

default

Default oauth2 scope.

4.4. client_creds

Type : oauth2
Flow : application
Token URL : https://10.181.213.181/uaa/oauth/token

Name Description

default

Default oauth2 scope.