Package com.jk.services.client.workflow
Class JKWorkflowServiceClient
java.lang.Object
com.jk.services.client.JKServiceClient<T>
com.jk.services.client.JKMatureServiceClient<NewPayloadRequestModel>
com.jk.services.client.workflow.JKWorkflowServiceClient
This class represents a client for interacting with a workflow service.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
This enum represents the user actions for workflow.static enum
This enum represents the workflow actions. -
Field Summary
Fields inherited from class com.jk.services.client.JKServiceClient
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapproveWorkflowEntity
(Integer payloadId) This method approves a workflow entity with the given pay-load ID.getPayLoads
(String system, String role) This method retrieves a list of pay-load models based on system and role.getPayLoads
(String system, String entity, String role) This method retrieves a list of pay-load models based on the specified system, entity, and role.This method retrieves the property for specifying URL of the workflow services.This method retrieves a system model by its code.getWorkflowEntity
(String system, String code, String className) This method retrieves a workflow entity model by using system, code, and class name.insert
(NewPayloadRequestModel model) This method inserts an object into the service.static void
This main method is used for testing the workflow service client.processWorkflow
(int payloadId, String userAction) This method processes a workflow action for a pay-load.rejectWorkflowEntity
(Integer payloadId) This method rejects a workflow entity with the given pay-load ID.Methods inherited from class com.jk.services.client.JKMatureServiceClient
delete, find, getAll, getBase, getId, setBase, update
Methods inherited from class com.jk.services.client.JKServiceClient
callDownloadFileWithPost, callGet, callJson, callJson, callJsonAsListOfObjects, callJsonAsListOfObjects, callJsonAsListOfObjects, callJsonAsString, callJsonAsString, callJsonWithDelete, callJsonWithPatch, callJsonWithPatch, callJsonWithPost, callJsonWithPost, callJsonWithPut, callJsonWithPut, callPatch, callPost, callPut, callService, callSingleJson, callSingleJson, createClient, createSslContext, getAcceptMediaType, getConnectTimeout, getFullUrl, getHeaders, getLogServiceClient, getModelClass, getReadTimeout, getRequestMediaType, getResponseHeaders, getServiceName, isEnableRemoteLogging, setAcceptMediaType, setEnableRemoteLogging, setHeaders, setHeadersOnRequest, setModelClass, setRequestMediaType, setServiceName, toObject, toObject, toObjects, toObjects, uploadFile, validateReponse
-
Constructor Details
-
JKWorkflowServiceClient
public JKWorkflowServiceClient()
-
-
Method Details
-
getServiceUrlPropertyName
This method retrieves the property for specifying URL of the workflow services.- Overrides:
getServiceUrlPropertyName
in classJKMatureServiceClient<NewPayloadRequestModel>
- Returns:
- the property for specifying URL of the workflow services.
-
insert
This method inserts an object into the service.- Overrides:
insert
in classJKMatureServiceClient<NewPayloadRequestModel>
- Parameters:
model
- Specifies the model object to insert.- Returns:
- the inserted object obtained from the service response.
-
getSystem
This method retrieves a system model by its code.- Parameters:
code
- Specifies the code of the system to retrieve.- Returns:
- the retrieved system model.
-
getWorkflowEntity
This method retrieves a workflow entity model by using system, code, and class name.- Parameters:
system
- Specifies the system code.code
- Specifies the code of the entity.className
- Specifies the class name of the entity.- Returns:
- retrieved workflow entity model or null if not found.
-
getPayLoads
This method retrieves a list of pay-load models based on system and role.- Parameters:
system
- Specifies the system code.role
- Specifies the role for which pay-loads are retrieved.- Returns:
- a list of pay-load models.
-
getPayLoads
This method retrieves a list of pay-load models based on the specified system, entity, and role.- Parameters:
system
- Specifies the system code.entity
- Specifies the entity associated with the pay-loads.role
- Specifies the role for which pay-loads are retrieved.- Returns:
- a list of pay-load models matching the specified criteria.
-
processWorkflow
This method processes a workflow action for a pay-load.- Parameters:
payloadId
- Specifies the ID of the pay-load to process.userAction
- Specifies the user action to perform.- Returns:
- the result of the workflow action.
-
approveWorkflowEntity
This method approves a workflow entity with the given pay-load ID.- Parameters:
payloadId
- Specifies the ID of the pay-load to approve.- Returns:
- the result of the approval action.
-
rejectWorkflowEntity
This method rejects a workflow entity with the given pay-load ID.- Parameters:
payloadId
- Specifies the ID of the pay-load to reject.- Returns:
- the result of the rejection action.
-
main
This main method is used for testing the workflow service client.- Parameters:
args
- the command-line arguments.
-