using Sagitec.Rules.Core.Instance.Attributes;
using Sagitec.Rules.Core.Interface;
using Sagitec.Rules.Interface.Context;
using System;
using System.Collections;
using System.Collections.Generic;
namespace Sagitec.Interface
{
/// <summary>
/// Defines methods for performing various actions on BPM map.
/// </summary>
[GlobalSingletonInstance]
public interface IInstanceBpmHelper : ICoreInstance
{
/// <summary>
/// Initiates the BPM Request and Case Instance.
/// </summary>
/// <param name="astrCaseName">Name of the Case which needs to be initiated.</param>
/// <param name="astrProcessName"> Name of the Process which needs to be initiated.</param>
/// <param name="aobjPassInfo"> PassInfo object of the type iutlPassInfo.</param>
/// <param name="astrRequestSource"> Source for the request can either be Online, Batch, Scanning and Index, Message Flow, or Trigger. The default value is "ONLI".
</param>
/// <param name="astrFirstBpmUserActivityNameToBeCompleted">Name of the User Activity that needs to be completed. The default value is null.</param>
/// <param name="adctCaseInstanceParametersToSetBeforeCompletingFirstUserActivity">The parameters of the case instance that needs to be set before
completing the user activity. The default value is null.</param>
/// <param name="astrUserIdToWhomActivityToBeAssigned"> User Id to whom the activity will be assigned. The default value is null.</param>
/// <param name="adctRequestParameters">A dictionary of mandatory or optional request parameters that are passed during initiation of the map. The default value
is null.</param>
/// <param name="ablnCheckForExistingInstance">If true, it checks for an existing instance; otherwise, it doesn’t. The default value is "true".</param>
/// <param name="astrRequestPriority">Priority of the request which can either be High or Normal. The default value is "NORM".</param>
/// <param name="abusParentBpmProcessInstance">An object of the parent process instance. The default value is null.</param>
/// <param name="ablnPersistRequestPriority">If true, it saves the request priority in database; otherwise, it doesn’t. The default value is "false".</param>
/// <param name="abjKeyTypeValues">A dictionary of mandatory or optional BPM key variables that is stored in Json_Value column of request(sgw_bpm_request)
and case instance(sgw_bpm_case_instance) tables. The default value is null.</param>
/// <param name="ablnReturnCaseInstance">If true, it returns the case instance; otherwise, it doesn’t. The default value is "false".</param>
/// <param name="aenmActivityInitiateType">Id of the Activity Initiation type. The default value is "1".</param>
/// <param name="aintMultiTenantId">MultiTenant Id which is required only for MultiTenant applications, or 0 in case, if it is not a MultiTenant application. The
default value is "0".</param>
/// <param name="astrRequestSubTypes">String of comma separated Request Sub-Type. The default value is null.</param>
/// <returns>An Array list of the initiated Case Instance.</returns>
ArrayList InitiateCaseInstance(string astrCaseName, string astrProcessName, IutlPassInfo aobjPassInfo, string astrRequestSource, string
astrFirstBpmUserActivityNameToBeCompleted, Dictionary<string, object> adctCaseInstanceParametersToSetBeforeCompletingFirstUserActivity,
string astrUserIdToWhomActivityToBeAssigned , Dictionary<string, object> adctRequestParameters, bool ablnCheckForExistingInstance, string astrRequestPriority,
IentBase abusParentBpmProcessInstance, bool ablnPersistRequestPriority, Dictionary<string, object> abjKeyTypeValues, bool ablnReturnCaseInstance,
int aenmActivityInitiateType, int aintMultiTenantId, string astrRequestSubTypes);
/// <summary>
/// Initiates the BPM Request.
/// </summary>
/// <param name="astrCaseName">Name of the Case which needs to be initiated.</param>
/// <param name="astrProcessName">Name of the Process which needs to be initiated.</param>
/// <param name="aobjPassInfo">PassInfo object of the type iutlPassInfo.</param>
/// <param name="astrRequestSource">Source for the request which can either be Online, Batch, Scanning and Index, Message Flow or Trigger. The default value is
"ONLI".</param>
/// <param name="adctRequestParameters">A dictionary of mandatory or optional request parameters that are passed during initiation of the map. The default value
is null.</param>
/// <param name="ablnCheckForExistingInstance">If true, it checks for an existing instance; otherwise, it doesn’t. The default value is "true".</param>
/// <param name="astrRequestPriority">Priority of the request can either be High or Normal. The default value is "NORM".</param>
/// <param name="abusParentBpmProcessInstance">An object of the parent process instance. The default value is null. </param>
/// <param name="ablnPersistRequestPriority">If true, it saves the request priority in database; otherwise, it doesn’t. The default value is "false".</param>
/// <param name="ablnPerformanceTest">If true, it executes performance test; otherwise, it doesn’t. The default value is "false".</param>
/// <param name="abjKeyTypeValues">A dictionary of mandatory or optional BPM key variables that is stored in Json_Value column of request(sgw_bpm_request)
and case instance(sgw_bpm_case_instance) tables. The default value is null.</param>
/// <param name="aintMultiTenantId">MultiTenant Id which is required only for MultiTenanat applications, or 0 in case, if it is not a MultiTenant application. The
default value is "0".</param>
/// <param name="astrRequestSubTypes">String of comma separated Request Sub-Type. The default value is null.</param>
/// <returns>An Array list of initiated Requests. </returns>
ArrayList InitiateRequest(string astrCaseName, string astrProcessName, IutlPassInfo aobjPassInfo, string astrRequestSource, Dictionary<string, object>
adctRequestParameters, bool ablnCheckForExistingInstance, string astrRequestPriority, IentBase abusParentBpmProcessInstance, bool ablnPersistRequestPriority,
bool ablnPerformanceTest, Dictionary<string, object> abjKeyTypeValues, int aintMultiTenantId, string astrRequestSubTypes);
/// <summary>
/// Initializes the BPM Request and BPM Case Instance when an Execute button(that calls this method) is clicked on the maintenance form. It also auto-checks out
the user activity to the user that performed that clicked the button.
/// </summary>
/// <param name="CaseName">Name of the Case which needs to be initialized.</param>
/// <param name="ProcessName">Name of the Process which needs to be initialized.</param>
/// <param name="adctRequiredParamteres">A dictionary of required parameters that needs to be passed during initiation of the map.</param>
/// <param name="adctKeyParameter">A dictionary of mandatory or optional BPM key variables that is stored in Json_Value column of request(sgw_bpm_request)
and case instance(sgw_bpm_case_instance) table.</param>
/// <param name="aobjPassInfo">PassInfo object of the type iutlPassInfo.</param>
/// <param name="astrRequestSubTypes"> String of comma separated RequestSubTypes of type. The default value is null.</param>
/// <returns>An Array list of the initiated Case Instances.</returns>
ArrayList InitializeProcessAndAutoCheckoutThroughRule(string CaseName, string ProcessName, Dictionary<string, object> adctRequiredParamteres,
Dictionary<string, object> adctKeyParameter, IutlPassInfo aobjPassInfo, string astrRequestSubTypes);
/// <summary>
/// Complete the specified Activity Instance and starts the next activity instance.
/// </summary>
/// <param name="astrCaseName">Name of the Case for which the current activity instance needs to be completed.</param>
/// <param name="astrProcessName">Name of the Process for which the current activity instance needs to be completed.</param>
/// <param name="astrBpmUserActivityNameToBeCompleted">Name of the User Activity which needs to be completed.</param>
/// <param name="aobjPassInfo">PassInfo object of the type iutlPassInfo.</param>
/// <param name="aintCaseInstanceId">Id of the Case Instance for which the current activity instance needs to be completed. The default value is "0".</param>
/// <param name="adctCaseInstanceParametersToSetBeforeCompletingUserActivity">A dictionary of parameters of the case instance that needs to be set before
completing the user activity. The default value is null.</param>
/// <param name="astrUserIdToWhomActivityToBeAssigned">User Id to whom the activity will be assigned. The default value is null.</param>
/// <param name="KeyTypeValues">A dictionary of mandatory or optional BPM key variables that is stored in Json_Value column of request(sgw_bpm_request) and
case instance(sgw_bpm_case_instance) tables. The default value is null.</param>
/// <returns>An array list of next Activity Instances.</returns>
ArrayList CompleteAndGetNextActivityInstance(string astrCaseName, string astrProcessName, string astrBpmUserActivityNameToBeCompleted, IutlPassInfo
aobjPassInfo, int aintCaseInstanceId, Dictionary<string, object> adctCaseInstanceParametersToSetBeforeCompletingUserActivity, string
astrUserIdToWhomActivityToBeAssigned, Dictionary<string, object> KeyTypeValues);
/// <summary>
/// Gets the Case Instance Parameter details (from SGW_BPM_CASE_INST_PARAMETER) for the given Activity Instance ID and Param Name.
/// </summary>
/// <param name="aintActivityInstanceId">Id of the Activity Instance for which the details needs to be fetched.</param>
/// <param name="astrParamName">Name of the Parameter for which the details needs to be fetched.</param>
/// <param name="aintParentActivityInstanceId">Id of the Parent Activity Instance, if the parameter name is for a child map, or 0 in case, if the parameter name is for
a single map. The default value is "0".</param>
/// <returns>A string containing the details of the Case Parameter.</returns>
string GetDetailsofCaseParameter(int aintActivityInstanceId, string astrParamName, int aintParentActivityInstanceId);
/// <summary>
/// Gets all Case Instance parameter (from SGW_BPM_CASE_INST_PARAMETER) for the given Case Name.
/// </summary>
/// <param name="CaseName">Name of the Case for which the parameter details needs to be fetched.</param>
/// <returns>A dictionary containing details of all Case Instance parameter.</returns>
Dictionary<string, object> GetDetailsOfLinkedParameter(string CaseName);
/// <summary>
/// Updates the parameter value in Case Instance parameter (SGW_BPM_CASE_INST_PARAMETER) table for the specified Activity Instance Id.
/// </summary>
/// <param name="aintActivityInstanceId">Id of the Activity Instance for which the table needs to be updated.</param>
/// <param name="astrParamName">Name of the Parameter to be updated.</param>
/// <param name="astrParamValue">The new value that needs to be updated for the specified parameter.</param>
void UpdateCaseInstanceParameterByActivityInstanceId(int aintActivityInstanceId, string astrParamName, string astrParamValue);
/// <summary>
/// Updates the Case Instance parameter (SGW_BPM_CASE_INST_PARAMETER) by Case Instance Id.
/// </summary>
/// <param name="aentBpmCaseInstnace">Id of the Case Instance for which case instance parameter needs to be updated.</param>
/// <param name="Parameter">A dictionary of parameter that needs to be updated.</param>
void UpdateCaseInstanceParameterByCaseInstanceId(IentBase aentBpmCaseInstnace, Dictionary<string, int> Parameter);
/// <summary>
/// Updates the status of the Activity Instance depending on the action type.
/// </summary>
/// <param name="aintActivityInstanceId">Id of the Activity Instance for which the action needs to be updated.</param>
/// <param name="astrAction">It is the type of action like Suspend (SUSP), Terminate (TERM), or Resume (RESU).</param>
/// <param name="astrTerminationReason">The reason of termination, if the action is Terminate; otherwise, it is null. The default value is null.</param>
void PerformBPMAction(int aintActivityInstanceId, string astrAction, string astrTerminationReason);
/// <summary>
/// Terminates the Case Instance.
/// </summary>
/// <param name="astrCaseName">Name of the Case which needs to be terminated.</param>
/// <param name="aintCaseInstanceId">Id of the Case instance which needs to be terminated. The default value is "0".</param>
void TerminateCaseInstance(string astrCaseName, int aintCaseInstanceId);
/// <summary>
/// Resumes the Activity Instance.
/// </summary>
/// <param name="lbusBpmActivityInstance">An object of the Activity Instance that needs to be resumed.</param>
void ResumeActivityInstance(IentBase lbusBpmActivityInstance);
/// <summary>
/// Queues the Job from Bpm.
/// </summary>
/// <param name="astrBatchName"> Name of the Batch file that needs to be queued.</param>
void QueueJobFromBpm(string astrBatchName);
/// <summary>
/// Updates the checkout user for an Activity Instance.
/// </summary>
/// <param name="aintActivityInstanceId">Id of the Activity Instance for which the checkout user needs to be updated.</param>
/// <param name="aintUserSerialId">The value of User Serial Id to be used for updation. The default value is "0".</param>
/// <param name="astrUserName">The value of User Name to be used for updation. The default value is null.</param>
void UpdateCheckoutUser(int aintActivityInstanceId, int aintUserSerialId, string astrUserName);
/// <summary>
/// Terminates the Case Instance by Id.
/// </summary>
/// <param name="aintCaseInstanceId">Id of the Case Instance that needs to be terminated.</param>
/// <param name="astrTerminationReason">The reason of termination.</param>
void TerminateByCaseInstanceID(int aintCaseInstanceId, string astrTerminationReason);
/// <summary>
/// Terminates the Case Instance by Name.
/// </summary>
/// <param name="astrCaseName">Name of the Case that needs to be terminated.</param>
/// <param name="astrProcessName">Name of the Process that needs to be terminated.</param>
/// <param name="astrTerminationReason">The reason of termination.</param>
/// <param name="aobjKeyTypeValues">A dictionary of BPM Key variables.</param>
void TerminateCaseInstanceByName(string astrCaseName, string astrProcessName, string astrTerminationReason, IDictionary<string, object> aobjKeyTypeValues);
/// <summary>
/// Resumes the Activity Instance by Id.
/// </summary>
/// <param name="aintBpmActivityInstanceId">Id of the Activity Instance that needs to be resumed.</param>
void ResumeActivityInstanceById(int aintBpmActivityInstanceId);
/// <summary>
/// Resumes the Activity Instance by Name.
/// </summary>
/// <param name="astrCaseName">Name of the Case that needs to be resumed.</param>
/// <param name="astrProcessName">Name of the Process that needs to be resumed.</param>
/// <param name="aobjKeyTypeValues">A dictionary of BPM key variables.</param>
void ResumeActivityInstanceByName(string astrCaseName, string astrProcessName, IDictionary<string, object> aobjKeyTypeValues);
/// <summary>
/// Suspends the Activity Instance by Id.
/// </summary>
/// <param name="aintBpmActivityInstanceId">Id of the Activity Instance that needs to be suspended.</param>
/// <param name="astrSuspensionReason">The reason for suspension.</param>
/// <param name="astrComments">Additional comments, if any. </param>
/// <param name="adatEndDate">The date and time at which the activity will be suspended.</param>
/// <param name="astrResumeAction">The type of action to be resumed like All documents or Any document. The default value is null.</param>
void SuspendActivityInstanceById(int aintBpmActivityInstanceId, string astrSuspensionReason, string astrComments, DateTime adatEndDate, string
astrResumeAction);
/// <summary>
/// Suspends the Activity Instance by Name.
/// </summary>
/// <param name="astrCaseName">Name of the Case that needs to be suspended.</param>
/// <param name="astrProcessName">Name of the Process that needs to be suspended.</param>
/// <param name="aobjKeyTypeValues">A dictionary of BPM key variables.</param>
/// <param name="astrSuspensionReason">The reason for suspension.</param>
/// <param name="astrComments">Additional comments, if any.</param>
/// <param name="adatEndDate">The date and time at which the activity will be suspended.</param>
/// <param name="astrResumeAction">The type of action to be resumed like All documents or Any document. The default value is null.</param>
void SuspendActivityInstanceByName(string astrCaseName, string astrProcessName, IDictionary<string, object> aobjKeyTypeValues, string astrSuspensionReason,
string astrComments, DateTime adatEndDate, string astrResumeAction);
/// <summary>
/// Forcefully triggers the timer from an application object before the timer elapses.
/// </summary>
/// <param name="aintBpmActivityInstanceId">Id of the Activity Instance for which timer needs to be triggered.</param>
/// <param name="aintBpmCaseInstanceId">Id of the Case Instance for which timer needs to be triggered.</param>
void TriggerTimerByActivityAndCaseInstId(int aintBpmActivityInstanceId, int aintBpmCaseInstanceId);
/// <summary>
/// Modifies the checklist for the Activity Instance.
/// </summary>
/// <param name="aobjActivityInstance">An object of the Activity Instance that needs to be modified.</param>
void ModifyBPMActivityInstanceChecklist(IentBase aobjActivityInstance);
}
}
#Rules