Additional Variables for Script Plugins (Groovy, WLST)

Additional variable(s) defined below are specific to Script based plugins and are not available in Workflow editor and Shell based plugins.

Variable Name

Description

Variable Name

Description

wfcontext

POJO object representing execution details.

wfcontext for WLST Operation only works when using wlserver as WLST Script Folder.

Groovy and WLST scripts can invoke Java methods on variables supplied in environment. Here are the available methods for use by script based plugins. If method returns POJO object, other methods can be called to find specific value. For example, wfcontext.getInstance() returns Instance POJO, which provides additional methods like getInstanceID(), getName() and getCode() etc.

  • wfcontext

    • Long getWorkflowExecutionId()

    • Long getWorkflowRequestId()

    • Long getPluginExecutionId()

    • String getWorkflowType()

      • Value will be either BUILD, DEPLOY, PREDEPLOY, TEST or UTILITY.

    • Instance getCurrentTargetGroup()

      • Target Group object has the following methods

        • Long getInstanceID()

        • String getName()

        • String getCode()

    • String getCurrentTargetGroupCode()

    • Object getCurrentTargetGroupPropertyValue(String pKey)

      • Returns environment target group property value for current target group and key name.

      • If property is overridden at project level, overridden value is returned.

    • Object getCurrentTargetGroupPropertyValueOrDefault(String pKey, Object pDefault)

    • Environment getCurrentEnvironment()

      • Environment object has the following methods.

        • Long getEnvironmentID()

        • String getName()

        • String getCode()

          • Same as FD_ENVIRONMENT_CODE

    • String getCurrentEnvironmentCode()

      • Same as FD_ENVIRONMENT_CODE

    • Project getCurrentProject()

      • Project object has the following methods.

        • String getName()

          • Same as FD_PROJECT_NAME

        • Long getProjectId()

        • String getSCMType()

          • Values will be either SVN, GIT, PVCS, CVS, TFVC,PERF,FILE,OIC,SURROUND,NONE.

    • String getCurrentProjectName()

      • Same as FD_PROJECT_NAME

    • String getArtifactsDirectory()

      • Same as FD_ARTIFACTS_DIR

    • String getTempDirectory()

      • Same as FD_TEMP_DIR

    • String getInternalDirectory()

      • Internal directory used by FlexDeploy for temporary scripts

    • Object getInput(String pName)

      • Returns value for specified input name.

    • Object getPropertyValue(String pKey)

      • Returns Project property value specified by key name.

    • Object getPropertyValue(String pInstanceCode, String pKey)

      • Returns environment instance property value for specified instance and key name.

      • If property is overridden at project level, overridden value is returned.

    • Object getPropertyValueOrDefault(String pKey, Object pDefault)

    • Object getPropertyValueOrDefault(String pInstanceCode, String pKey, Object pDefault)

    • boolean isForceDeploy()

    • boolean isBuildWorkflow()

    • boolean isDeployWorkflow()

    • boolean isPreDeployWorkflow()

    • boolean isUtilityWorkflow()

    • boolean isTestWorkflow()

    • boolean isDeployOrUtilityWorkflow()

    • boolean isDeployOrPreDeployWorkflow()

    • Map<String, PropertyDefinition> getPropertyDefinitions()

      • PropertyDefinition object has the following methods.

        • Long getPropertyKeyDefinitionId()

        • String getPropertyKeyName()

        • String getDisplayName()

        • String getPropertyScope()

        • String getDataType()

        • String getSubDataType()

        • boolean isEncrypted()

        • boolean isRequired()

        • boolean isCustom()

    • List<ITSIssue> getIssues()

      • ITSIssue object has the following methods.

        • String getIssueNumber()

        • Long getIssueId()

        • Long getInstanceId()

        • String getDescription()

    • List<ScmCommit> getCommits()

      • ScmCommit object has the following methods.

        • String getRevision()

        • Long getCommitId()

        • String getCommitterEmail()

        • Timestamp getCommitDate()

        • String getCommitMessage()

        • String getCommitUser()

        • Long getInstanceId()

    • Instance getCurrentInstance()- Deprecated

      • Instance object has the following methods

        • Long getInstanceID()

        • String getName()

        • String getCode()

          • Same as FD_TARGET_GROUP_CODE

    • String getCurrentInstanceCode() - Deprecated use getCurrentTargetGroupCode

    • Object getCurrentInstancePropertyValue(String pKey)- Deprecated - use getCurrentTargetGroupPropertyValue(String pKey)

      • Returns environment instance property value for current instance and key name.

      • If property is overridden at project level, overridden value is returned.

    • Object getCurrentInstancePropertyValueOrDefault(String pKey, Object pDefault)- Deprecated - use getCurrentTargetGroupPropertyValueOrDefault(String pKey, Object pDefault)

      • Returns environment instance property value for current instance and key name.

      • If property is overridden at project level, overridden value is returned.

The following macros are not currently supported in the footer:
  • style