Class SetApprovalInformationScriptTask

java.lang.Object
com.orchestranetworks.workflow.ScriptTaskBean
com.apgar.common.lib.workflow.scripttask.SetApprovalInformationScriptTask

public class SetApprovalInformationScriptTask extends com.orchestranetworks.workflow.ScriptTaskBean
Updates the approval information for records in a specified dataset within a workflow context.

The task identifies records that have been created or modified, and sets the approval date and the user who approved the records.

The following input parameters should be configured in the workflow model step:

  • Mandatory Parameters:
    • Parameter name: workSpace (e.g., ${workSpace})
    • Parameter name: dataSet (e.g., ${dataSet})
    • Parameter name: lastUser (e.g., ${user}) - represents the user who approved the records.
  • Optional Parameters:
    • Parameter name: approvedDate (e.g., ./approvedDate). If not specified, the default path will be ./tracking/approvedDate.
    • Parameter name: approvedBy (e.g., ./approvedBy). If not specified, the default path will be ./tracking/approvedBy.

To be utilized, the bean must be defined in the module.xml file like

  <beans>
    <bean className="com.apgar.common.lib.workflow.scripttask.SetApprovalInformationScriptTask"> 
          <documentation xml:lang="en-US">
              <label>Update Approval Information for Records</label>
              <description></description> 
          </documentation> 
          <properties> 
              <property name="workSpace" input="true"> 
                  <documentation xml:lang="en-US">
                      <label>Workspace</label> 
                  </documentation> 
              </property>         
              <property name="dataSet" input="true"> 
                  <documentation xml:lang="en-US"> 
                      <label>Dataset</label> 
                  </documentation> 
              </property> 
              <property name="lastUser" input="true"> 
                  <documentation xml:lang="en-US"> 
                      <label>Last User</label> 
                  </documentation> 
              </property>
              <property name="approvedDate" input="true"> 
                  <documentation xml:lang="en-US"> 
                      <label>Approved Date Field Path</label> 
                  </documentation> 
              </property>
              <property name="approvedBy" input="true"> 
                  <documentation xml:lang="en-US"> 
                      <label>Approved By Field Path</label> 
                  </documentation> 
              </property> 
          </properties> 
      </bean> 
  </beans>
 
Author:
APGAR Consulting
  • Constructor Details

    • SetApprovalInformationScriptTask

      public SetApprovalInformationScriptTask()
  • Method Details

    • executeScript

      public void executeScript(com.orchestranetworks.workflow.ScriptTaskBeanContext context) throws com.orchestranetworks.service.OperationException
      Executes the script task to update the approval information for records.

      It scans the tables within the dataset dataSet and the dataspace workSpace for any records that have been created or modified during the workflow. If such records are found, it updates the "Approval Date" and "Approved By" fields accordingly.

      If the lastUser context variable is not specified, the task will not do anything.

      Specified by:
      executeScript in class com.orchestranetworks.workflow.ScriptTaskBean
      Parameters:
      context - the context of the script task bean
      Throws:
      com.orchestranetworks.service.OperationException - if there is an error updating the records with the approval information