search cancel

Converting Local Component into Shared Component

book

Article ID: 145986

calendar_today

Updated On:

Products

CA Release Automation - Release Operations Center (Nolio) CA Release Automation - DataManagement Server (Nolio)

Issue/Introduction

If a component you've created in one application is a component that you believe would be valuable to other applications then this makes it a candidate for converting it to a shared component. 

Converting it to a shared component can be done by clicking on the drop down menu to the right of the component - as shown below. However, if you would like to do this then it is helpful to understand the warnings that are raises - also shown below. 









Cause

A Shared Component can be very helpful. If you're creating a new component that you think you'll want to use across multiple applications then it you could:
  • Created it as a shared component from the very beginning; or
  • Create it as a local component and then convert it later once you believe it's first version is ready. 
The warnings shown above (while converting a local component to a shared component) are: 
  • No use of Non built-in Application Parameters
  • No overridden values in Actions or Flows both in the Component design and in Processes
  • Flows do not contain actions or flows that are executed on a Remote Server. 

These warnings are given because these conditions aren't allowed when converting. If the conditions exist when clicking the Share button then it will present you with an error - as can be seen below.




The error observed here is: 
Couldn't share component. ["There are usages of non built-in application parameters in the following Actions / Flows: The Action [git clone - https] is using [git_repo_path]. "]

Environment

Release : 6.6+

Resolution

The error shown above is being shown because of the first warning:
  • No use of Non built-in Application Parameters
This means that the actions cannot use any Application Parameters that are NOT built-in. For example, in the screenshot showing the error above you can see the Application Parameters folder expanded. In it is a parameter git_repo_path. This parameter was manually created. It is not a Built-in Application Parameter. Therefore, it cannot be used. So, before converting this component to a shared component you will need to remove this parameter from the action where it is being used (as mentioned in the error - in this case: git clone - https). 

This message is true throughout the entirety of Shared Components - because you are not allowed to create custom Application Parameters in Shared Components (at least not in 6.6 and 6.7). 


The next/second warning is: 
  • No overridden values in Actions or Flows both in the Component design and in Processes

This condition will also generate an error. Here is an example of how/when this condition would generate an error. The very first screenshot in this article shows the Command Line String field whose value is:
git clone https://[E] git_username:[E] [email protected]<>git_repo_path

This is the value as it is defined in the action. But let's say I wanted to use this action in a process. But instead using the action as is I wanted to change it so that it was without the username and password. For ex:
git clone https://<>git_repo_path

If you made this change to the action inside of a process then you have overridden the value of the action. This is also not allowed in Shared Components. So, if you get an error about this condition then you need to make the adjustments you need in order to allow the actions to maintain their original values throughout flows and processes. This might mean using parameters (local, which can be changed at process levels, environment, etc.) in your actions so that you can tailor for different use cases or maybe creating more than one action. Maybe one action for each combination of input parameters you might frequently use. 



The last warning is: 
  • Flows do not contain actions or flows that are executed on a Remote Server. 
If this condition exists then it will return the following error: 

Couldn't share component. ["An inner flow/action of this component is currently marked for remote execution in some process"]

This is the one condition where you can still do, what it's telling you will generate an error, after it has become a shared component. In general, the "Execute on Remote Server" is not something that is frequently seen/needed/used. There are cases for it. But it is not something that is used a lot. Before converting the local component to a shared component it will generate this error if you have a flow inside of a process and that flow has an action that is set to "Execute On Another Server". Example shown below.

Note: When an action or flow is set to "Execute On Another Server" its color changes to orange.





To get rid of the error, right click on the action and select "Remove Remote Server Execution". Then save the process and try converting it again. 

Attachments