13 Extending Solution Designer

This chapter describes how to extend Oracle Communications Service Catalog and Design - Solution Designer using an extended designer class. The extended designer class provides extension points using which you can customize the intended default behavior in the run-time application.

About Extending Solution Designer

You can extend the default behavior that Solution Designer offers using the extended designer class. The extended designer class is an extended java class that provides the ability to add or customize logic to the automatically generated implementation using predefined extension points. Extension points are the specific points where the custom code is run. Each extension point specification contains a signature of a method that calls the extension point.

When you publish the initiative to a workspace in the Solution Designer user interface, the DevOps engine generates the cartridge artifacts and the cartridge workspace. See "Publishing Initiatives to Workspaces" in Solution Designer User's Guide for information on publishing initiatives. You can download the cartridge workspace and import in to Design Studio Eclipse Workspace. The cartridge workspace has the following java files:

  • SpecificationNameDesigner.java: This is the base class which contains the implementation that will be run by default. Oracle recommends that you do not modify the base class.

  • SpecificationNameExtendedDesigner.java: This is extended designer class or implementation class which lets you write the implementation based on your business requirements. Oracle provides predefined extension points for the methods in base class; however you can extend any method from the base class by copying and editing the method signatures from the existing extension points.

Where SpecificationName is the specification name that you entered in the Solution Designer application. The specification includes CFS, RFS, and resource.

These files are located at UIM_DomainName_DesignJ\src\oracle\communications\inventory\techpack\SpecificationName where DomainName is the name of the domain that you entered in the Solution Designer application.

About Extended Designer Class

Extended designer class is an extended java class that lets you add or customize logic based on your business requirements to the automatically generated implementation using predefined extension points. This section lists the predefined extension points and also provides the sample extended designer class.

About Extension Points

Extension points are the specific points where the custom code is run. Each extension point specification contains a signature of a method that calls the extension point. This section provides the list of available extension points and their description. Table 13-1 lists the extension points that are available in the extended designer class.

Table 13-1 Predefined Extension Points

Extension Points Description

chooseSpecForComponent

where Component is the component that you selected while defining an advanced policy in Solution Designer application. See "Defining Advanced Policies" in Solution Designer User's Guide for information on defining advanced policies.

Add custom logic to implement the advanced design policy.

preDesignAdd

Add custom logic to run before the default design and assign logic for add action.

postDesignAdd

Add custom logic to run after the default design and assign logic for add action.

preDesignChange

Add custom logic to run before the default design and assign logic for change action.

postDesignChange

Add custom logic to run after the default design and assign logic for change action.

preDesignDisconnect

Add custom logic to run before the default design and assign logic for disconnect action.

postDesignDisconnect

Add custom logic to run after the default design and assign logic for disconnect action.

postDesignSuspend

Add custom logic to run after the default design and assign logic for suspend action.

postDesignResume

Add custom logic to run after the default design and assign logic for resume action.

postDesignMove

Add custom logic to run after the default design and assign logic for move action.

preDesign

Add custom logic to run before the Design method in the base class. The Design method is the boilerplate method for automating the design and assign logic.

postParseActionParameters

Add custom logic to run after ParseActionParameters method in the base class. ParseActionParameters method parses the design parameters from the inbound request.

postAutoconfigProperties

Add custom logic to run after AutoconfigProperties method in the base class. AutoconfigProperties method is used to populate characteristics based on the action parameters from the inbound request.

validate

Add custom validation logic based on your business requirements.

beforeComplete

Add custom logic that must be run after the beforeComplete method in the base class.

complete

Add custom logic that must be run after the Complete method in the base class.

cancel

Add custom logic that must be run for canceling the service for various design actions such as add, disconnect, suspend, and so on.

issue

Add custom logic that must be run for changing the service status to issued for various design actions such as add, disconnect, suspend, and so on.

suspend

Add custom logic to run after the default design and assign logic for suspend action.

resume

Add custom logic to run after the default design and assign logic for resume action.

postSetChildSpecificationForComponent

Add custom logic to map any design parameters from the specification to its child specifications.

Working with Extended Designer Class

You can write the custom logic in the extended designer class for defining advanced policy, design action mapping, delivery action mapping, parameter mapping, and so on. Oracle provides predefined extension points for the methods in the base class. You can extend any method that is available in the base class and override the default behavior in the extended designer class. The extended designer class is generated for each specification in the cartridge. When you define custom logic in the extended designer class, the custom logic is included in the cartridge only when you enter the advanced policy implementation assets information in the Solution Designer application.

To extend using extended designer class:

  1. Publish the initiative to the Test workspace to generate the Design Studio workspace for an initiative in advanced configuration phase. See "Publishing Initiatives to Generate Design Studio Workspaces" in Solution Designer User's Guide for information on how to publish an initiative.

  2. Download the Design Studio workspace from the location that is displayed in the initiative that you published.

  3. Import the Design Studio workspace into Design Studio Eclipse environment. See "Importing Projects" in Design Studio Modeling Basics for more information on importing projects.

  4. Locate the extended designer class at UIM_DomainName_DesignJ\src\oracle\communications\inventory\techpack\SpecificationName.

  5. You can write the custom code for the predefined extension points. You can also extend and override any of the methods available in the base class. The notes that you add in the advanced policies in the Solution Designer user interface are added as comments in the extended designer class. See "About Extension Points" for the list of predefined extension points.

  6. After you complete the custom code in Design Studio, upload the information to Solution Designer manually or by running Object Store Utility.

    To upload the details to Solution Designer manually:

    1. After you complete the custom code, upload the extended designer class with the file extension as java in S3-compatible object store.

    2. Add the object store's relative path in the Solution Designer user interface and also select the advanced policies for which the custom code has been implemented in the extended designer class. See "Adding Advanced Policy Implementation Assets" in Solution Designer User's Guide for information on adding implementation assets for advanced policies manually.

    3. (Optional) You can use helper classes in the extended designer class. Helper Class is a Java class that contains reusable basic functions such that you do not have to implement repeatedly. You must compress the helper class java files to a ZIP file and upload the ZIP file in S3-compatible object store. Add the ZIP file's relative path in the Implementation Assets field in Domains in the Solution Designer user interface. See "Creating Domains" in Solution Designer User's Guide for information on adding helper class details.

    4. (Optional) You can use third-party libraries in the extended designer class. Third-party libraries are reusable software components that are available either freely or sold by an entity. Third-party libraries are typically JAR files and you must upload the JAR files in S3-compatible object store. Add the JAR file's relative path in the Implementation Assets section in Domains in the Solution Designer user interface. See "Creating Domains" in Solution Designer User's Guide for information on adding third-party library details.

    To upload the details using Object Store Utility, see "Working with Object Store Utility". You can use Object Store Utility to upload the extended designer class, helper class and third party libraries in S3-compatible object store and then update the relative paths in Solution Designer.

  7. After advanced policy implementation assets information is added, re-publish the initiative until the publish operation is successful. Download and deploy the cartridge artifacts in the UIM run-time environment. See "Publishing Initiatives to Workspaces" in Solution Designer User's Guide for information on publishing initiatives.

The base class contains the design and assign logic for the add action. You can choose to override the implementation for add action in the extended designer class. For all the other actions such as change, suspend, resume, disconnect, and so on, you can write the implementation code using the extension points in the extended designer class.

Example: Extended Designer Class

The DevOps engine generates the extended designer class with a placeholder for custom logic. The following java methods are an example for adding custom logic for design and assign for add action. Similarly, the DevOps engine generates methods for all the extension points that is listed in Table 13-1.

// Custom code blocks for actions specific operations starts here.	
	
	/**
	 * Custom code that executes at the beginning of the designAdd method.
	 */
	@Override
	protected void preDesignAdd(ServiceConfigurationVersion config) 
			throws ValidationException {
		
		// Custom code can be added here if needed.
	}
      /**
	 * Custom code that executes at the end of the designAdd method.
	 */
	@Override
	protected void postDesignAdd(ServiceConfigurationVersion config) 
		throws ValidationException {
			
		// Custom code can be added here if needed.
		
		// Like switching the context to a specific BI by setting its 
		// value to a specific BI value or setting it to null as shown 
		// below based on the requirement.
		
		// BusinessInteraction currentBi = oracle.communications.inventory.api.entity.utils.ConfigurationUtils.getAssociatedBusinessInteraction(config);
		// biManager.switchContext(currentBi, null);
	}