Class WorkflowExecutionContext

java.lang.Object
flexagon.ff.common.core.pojos.BasePOJO
flexagon.fd.core.workflow.WorkflowExecutionContext
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
MockWorkflowExecutionContext

public class WorkflowExecutionContext extends BasePOJO implements Cloneable
Represents context information related to the current plugin execution, such as the target environment and instance, properties, inputs, output, etc.
See Also:
  • Field Details

    • mUnfilteredPackageObjectList

      protected List<PackageObject> mUnfilteredPackageObjectList
  • Constructor Details

    • WorkflowExecutionContext

      public WorkflowExecutionContext(Project pProject, Environment pEnvironment, Instance pInstance, Long pWorkflowRequestId, Map<String,PropertyValue> pInputs)
      INTERNAL USE ONLY
    • WorkflowExecutionContext

      public WorkflowExecutionContext()
      INTERNAL USE ONLY
    • WorkflowExecutionContext

      public WorkflowExecutionContext(Project pProject, Environment pEnvironment, Instance pInstance, Long pWorkflowRequestId, Properties pProperties)
      INTERNAL USE ONLY
  • Method Details

    • copyState

      public void copyState(WorkflowExecutionContext pFrom)
    • clone

      public Object clone() throws CloneNotSupportedException
      INTERNAL USE ONLY
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • getWorkflowExecutionState

      public WorkflowExecutionState getWorkflowExecutionState()
      INTERNAL USE ONLY - this method will return null on Plugins
    • setWorkflowRequestId

      public void setWorkflowRequestId(Long pWorkflowRequestId)
      INTERNAL USE ONLY
    • getWorkflowRequestId

      public Long getWorkflowRequestId()
      Returns the workflow request id of the current execution.
      Returns:
      the workflow request id
    • setOrginatingWorkflowExecutionId

      public void setOrginatingWorkflowExecutionId(Long pOrginatingWorkflowExecutionId)
      INTERNAL USE ONLY
    • getOrginatingWorkflowExecutionId

      public Long getOrginatingWorkflowExecutionId()
      Returns the workflow execution id of the current execution. If workflow is a child workflow, this still returns main workflow execution id.
      Returns:
      the originating workflow execution id
    • setPluginExecutionId

      public void setPluginExecutionId(Long pPluginExecutionId)
      INTERNAL USE ONLY
    • getPluginExecutionId

      public Long getPluginExecutionId()
      Returns the plugin execution id
      Returns:
      the plugin execution id
    • setWorkflowType

      public void setWorkflowType(String pWorkflowType)
      Sets the workflow type name
    • getWorkflowType

      public String getWorkflowType()
      Returns the workflow type name
      Returns:
      string the workflow type name
    • getWorkflowExecutionId

      public Long getWorkflowExecutionId()
      Returns the id of the current workflow execution
      Returns:
      the workflow execution id
    • setWorkflowExecutionId

      public void setWorkflowExecutionId(Long pWorkflowExecutionId)
      INTERNAL USE ONLY
    • setProject

      public void setProject(Project pProject)
      INTERNAL USE ONLY
    • getProject

      public Project getProject()
      Returns the project which the current workflow execution is for
      Returns:
      the project
    • getEnvironment

      public Environment getEnvironment()
      Returns the target environment which the current workflow is executing in
      Returns:
      the environment
    • setEnvironment

      public void setEnvironment(Environment pEnvironment)
      INTERNAL USE ONLY
    • getInstance

      public Instance getInstance()
      Returns the target instance which the current workflow is executing on
      Returns:
      the instance
    • setInstance

      public void setInstance(Instance pInstance)
      INTERNAL USE ONLY
    • setMainInstance

      public void setMainInstance(Instance pMainInstance)
      INTERNAL USE ONLY
    • getMainInstance

      public Instance getMainInstance()
      INTERNAL USE ONLY
    • getProperties

      public Properties getProperties()
      Returns the properties for the current workflow execution
      Returns:
      the properties for the current workflow execution
    • getInput

      public Object getInput(String pName)
      Returns the input with the given name as an Object. Returns null if the input is not found.
      Parameters:
      pName - the name of the input
      Returns:
      the input object
    • getInputMap

      public Map<String,PropertyValue> getInputMap()
      Returns the inputs for the current workflow execution
      Returns:
      a Map of all inputs for the current execution
    • setProperties

      public void setProperties(Properties pProperties)
      INTERNAL USE ONLY
    • getPrintablePropertyValue

      public Object getPrintablePropertyValue(String pKey)
      Returns a project property value suitable for printing, in that encrypted values are masked.
      Parameters:
      pKey - the key of the property to find
      Returns:
      the project property value
    • getPropertyValue

      public Object getPropertyValue(String pKey)
      Returns a project property value. WARNING: Values of encrypted properties are not masked.
      Parameters:
      pKey - the key of the property to find
      Returns:
      the project property value
    • getPropertyValueOrDefault

      public Object getPropertyValueOrDefault(String pKey, Object pDefault)
      Returns a project property value. If value is not set, pDefault will be returned. WARNING: Values of encrypted properties are not masked.
      Parameters:
      pKey - the key of the property to find
      pDefault - the default value
      Returns:
      the project property value
    • getPrintablePropertyValue

      public Object getPrintablePropertyValue(String pInstanceCode, String pKey)
      Returns an Target property value for the given instance which is suitable for printing, in that encrypted values are masked.
      Parameters:
      pInstanceCode - the instance code
      pKey - the key of the property to find
      Returns:
      the Target property value
    • getPropertyValue

      public Object getPropertyValue(String pInstanceCode, String pKey)
      Returns an environment property value for the given instance. WARNING: Values of encrypted properties are not masked.
      Parameters:
      pInstanceCode - the instance code
      pKey - the key of the property to find
      Returns:
      the Target property value
    • getPropertyValueOrDefault

      public Object getPropertyValueOrDefault(String pInstanceCode, String pKey, Object pDefault)
      Returns an Target property value. If value is not set, pDefault will be returned. WARNING: Values of encrypted properties are not masked.
      Parameters:
      pInstanceCode - the instance code
      pKey - the key of the property to find
      pDefault - the default value
      Returns:
      the Target property value
    • addProperty

      public void addProperty(String pKey, Object pValue, DataTypeEnum pDataType, boolean pIsEncrypted)
      INTERNAL USE ONLY
    • addProperty

      public void addProperty(String pInstanceCode, String pKey, Object pValue, DataTypeEnum pDataType, boolean pIsEncrypted)
      INTERNAL USE ONLY
    • setOutput

      public void setOutput(String pName, Object pValue, DataTypeEnum pDataType)
      INTERNAL USE ONLY
    • getOutputMap

      public Map<String,PropertyValue> getOutputMap()
      Returns the map of Outputs.
      Returns:
      the outputs
    • getBaseWorkingDirectory

      public String getBaseWorkingDirectory()
      Returns the base working directory of the target endpoint. The base working directory is located in the "work" subdirectory of the base install directory of the endpoint.
      Returns:
      the base working directory
    • getWorkingDirectory

      public String getWorkingDirectory()
      Returns the working directory of the target endpoint. The working directory is generated uniquely within the base working directory, and has the following structure:

           [base working directory]/[project id]/[workflow execution id] 
           (e.g. /u01/flexdeploy/work/10009/12801) 
      Returns:
      the working directory
    • getInternalDirectory

      public String getInternalDirectory()
      Returns the internal directory of the target endpoint, which is used to store temporary files generated by the plugin execution lifecycle and its plugins. The internal directory is located in the "internal" sub-folder of the working directory.
      Returns:
      the internal directory
    • getTempDirectory

      public String getTempDirectory()
      Returns the temp directory of the target endpoint, which is used to store temporary files generated by the plugin executions. The temp directory is located in the "temp" sub-folder of the working directory.
      Returns:
      the temp directory
    • getArtifactsDirectory

      public String getArtifactsDirectory()
      Returns the artifacts directory of the target endpoint, which is used to store artifacts produced or consumed by plugin operations. The artifacts directory is located in the "artifacts" sub-folder of the working directory.
      Returns:
      the artifacts directory
    • getBackupsDirectory

      public String getBackupsDirectory()
      Returns the backups directory of the target endpoint, which is used to store backup artifacts produced or consumed by plugin operations. The backups directory is located in the "backups" sub-folder of the working directory.
      Returns:
      the backups directory
    • getTransferDirectory

      public String getTransferDirectory()
      Returns the transfer directory of the target endpoint, which used for sharing files between plugin operations within a single workflow. The transfer directory is located in the "transfer" sub-folder of the working directory.
      Returns:
      the artifacts directory
    • getReportsDirectory

      public String getReportsDirectory()
      Returns the reports directory of the target endpoint. The reports directory is located in the "reports" sub-folder of the working directory. RESERVED FOR FUTURE USE.
      Returns:
      the reports directory
    • getTestResultsDirectory

      public String getTestResultsDirectory()
      Returns the test results directory of the target endpoint, which is used to store test results produced by test plugin operations. The test results directory is located in the "test-results" sub-folder of the working directory.
      Returns:
      the test results directory
    • getScanResultsDirectory

      public String getScanResultsDirectory()
      Returns the scan results directory of the target endpoint, which is used to store test results produced by scan plugin operations. The scan results directory is located in the "scan-results" sub-folder of the working directory.
      Returns:
      the scan results directory
    • getObjectResultsDirectory

      public String getObjectResultsDirectory()
      Returns the object results directory of the target endpoint, which is used to store results produced by partial deployment plugin operations. The object results directory is located in the "object-results" sub-folder of the working directory.
      Returns:
      the object results directory
    • getProjectSourcesDirectory

      public String getProjectSourcesDirectory()
      INTERNAL USE ONLY
    • getBaseInstallDirectory

      public String getBaseInstallDirectory()
      The base install directory is the directory defined by the "Base Working Directory" on the target endpoint.
      Returns:
      the base installation directory
    • setBaseInstallDirectory

      public void setBaseInstallDirectory(String pDirectory)
      INTERNAL USE ONLY
    • getInstallPluginsDirectory

      public String getInstallPluginsDirectory()
      Returns the plugin installation directory on the target endpoint. The plugin installation directory is located in the "plugins" subdirectory of the base install directory on the endpoint.
      Returns:
      the plugin installation directory
    • getInstallPluginsDirectory

      public String getInstallPluginsDirectory(String pluginName, String pluginVersion)
      Returns the plugin installation sub-directory for the given plugin name and plugin version. This directory is located in the following path on the endpoint:

         [plugin installation directory]/[plugin name]/[plugin version] 
      Parameters:
      pluginName - the name of the plugin
      pluginVersion - the plugin version
      Returns:
      the plugin installation directory for a specific plugin name and version
    • setLastEndPoint

      public void setLastEndPoint(Long pLastEndPoint)
      INTERNAL USE ONLY
    • getLastEndPoint

      public Long getLastEndPoint()
      INTERNAL USE ONLY
    • setForceDeploy

      public void setForceDeploy(boolean pForceDeploy)
      INTERNAL USE ONLY
    • isForceDeploy

      public boolean isForceDeploy()
      Returns whether "force deploy" was selected on the submit build/deploy request.
      Returns:
      whether force deploy was selected for this request
    • setPackageObjects

      public void setPackageObjects(List<PackageObject> pPackageObjects)
      INTERNAL USE ONLY
    • getPackageObjects

      public List<PackageObject> getPackageObjects()
      INTERNAL USE ONLY
    • toString

      public String toString()
      Description copied from class: BasePOJO
      Returns custom String representation implemented by walking complete object structure.
      Overrides:
      toString in class BasePOJO
      Returns:
      a String representation of this object
    • isWindows

      public boolean isWindows()
    • setPostRefresh

      public void setPostRefresh(boolean pPostRefresh)
    • isPostRefresh

      public boolean isPostRefresh()
    • setProducesArtifacts

      public void setProducesArtifacts(boolean pProducesArtifacts)
    • isProducesArtifacts

      public boolean isProducesArtifacts()
    • setConsumesArtifacts

      public void setConsumesArtifacts(boolean pConsumesArtifacts)
    • isConsumesArtifacts

      public boolean isConsumesArtifacts()
    • isBuildWorkflow

      public boolean isBuildWorkflow()
    • isDeployWorkflow

      public boolean isDeployWorkflow()
    • isSyncStateWorkflow

      public boolean isSyncStateWorkflow()
    • isPreDeployWorkflow

      public boolean isPreDeployWorkflow()
    • isUtilityWorkflow

      public boolean isUtilityWorkflow()
    • isTestWorkflow

      public boolean isTestWorkflow()
    • isDeployOrUtilityWorkflow

      public boolean isDeployOrUtilityWorkflow()
    • isDeployOrPreDeployWorkflow

      public boolean isDeployOrPreDeployWorkflow()
    • setPropertyDefinitions

      public void setPropertyDefinitions(Map<String,PropertyDefinition> pPropertyDefinitions)
      INTERNAL USE ONLY
    • getPropertyDefinitions

      public Map<String,PropertyDefinition> getPropertyDefinitions()
    • setIssues

      public void setIssues(List<ITSIssue> pIssues)
      INTERNAL USE ONLY
    • getIssues

      public List<ITSIssue> getIssues()
      Returns all Issues included in the current execution. If deploy this will include all the issues that are to be deployed since previous deployment.
      Returns:
      list of all Issues included in the current execution
    • setCommits

      public void setCommits(List<ScmCommit> pCommits)
      INTERNAL USE ONLY
    • getCommits

      public List<ScmCommit> getCommits()
      Returns commits included in current execution. If deploy this will include all the commits that are to be deployed since previous deployment.
      Returns:
      list of all commits included in current execution
    • getUnfilteredPackageObjectList

      public List<PackageObject> getUnfilteredPackageObjectList()
    • setUnfilteredPackageObjectList

      public void setUnfilteredPackageObjectList(List<PackageObject> pUnfilteredPackageObjectList)