Class JKWorkflowServiceClient


public class JKWorkflowServiceClient extends JKMatureServiceClient<NewPayloadRequestModel>
This class represents a client for interacting with a workflow service.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Details

    • JKWorkflowServiceClient

      public JKWorkflowServiceClient()
  • Method Details

    • getServiceUrlPropertyName

      public String getServiceUrlPropertyName()
      This method retrieves the property for specifying URL of the workflow services.
      Overrides:
      getServiceUrlPropertyName in class JKMatureServiceClient<NewPayloadRequestModel>
      Returns:
      the property for specifying URL of the workflow services.
    • insert

      This method inserts an object into the service.
      Overrides:
      insert in class JKMatureServiceClient<NewPayloadRequestModel>
      Parameters:
      model - Specifies the model object to insert.
      Returns:
      the inserted object obtained from the service response.
    • getSystem

      public SystemModel getSystem(String code)
      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

      public WorkflowEntityModel getWorkflowEntity(String system, String code, String className)
      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

      public List<PayloadModel> getPayLoads(String system, String role)
      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

      public List<PayloadModel> getPayLoads(String system, String entity, String role)
      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

      public String processWorkflow(int payloadId, String userAction)
      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

      public String approveWorkflowEntity(Integer payloadId)
      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

      public String rejectWorkflowEntity(Integer payloadId)
      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

      public static void main(String[] args)
      This main method is used for testing the workflow service client.
      Parameters:
      args - the command-line arguments.