Organization Scripts
Manage scripts associated with an organization on the API platform.
For general information on using scripts, refer to:
- Getting Started with Scripts (Policy Manager help)
- Managing Scripts (Policy Manager help)
Table of Contents
- What is a script?
- How do I manage scripts for my business organization on the platform?
- How do I add a script to an organization on the API platform?
- How do I view scripts for an organization on the API platform?
- How do I modify a script associated with an organization on the API platform?
- How do I move a script from one organization to another?
- How do I delete a script associated with an organization on the API platform?
- What roles can manage scripts for my business organization on the platform?
What is a script?
In the API Platform, a script is a reusable sequence of commands that can be used to automate the execution of tasks associated with managing the platform and its resources.
You can build scripts for automating common tasks relating to your APIs. You can build a library of reusable scripts, which you can then import into a process.
A process is an ordered sequence of activities performed by an API Gateway that supports the virtualization capability. For example, the logic performed in a virtual service operation is defined as a process. When a message is received by the container, once the virtual service operation is identified, its process is executed. As determined by the activities in the process, down-stream services might be invoked. When the process is complete, a response to the original message is generated.
In Policy Manager or in the Community Manager developer portal, you can define one or more scripts that can be assigned to one or more processes to assist in automation.
In Policy Manager, the Add Process Wizard allows you to define a library of reusable scripts with common activities. For example, you might define a script to retrieve user information based on an account number, or to build a custom form, and you could use the same script in multiple processes.
In the Community Manager developer portal, you can do exactly the same thing. You can define a custom process:
- For a specific operation within a specific implementation of an API; see How do I edit an API implementation?
- For use within a business organization; see topics below.
Using the Process Palette, you can:
- Define the sequence of messages as they flow through for each virtual service operation.
- Configure a variety of different types of activities, each represented by a separate icon in the Process Palette user interface, for achieving the results required for each operation.
How do I manage scripts for my business organization on the platform?
The API platform allows you to manage the scripts that are available for your business organization. You can:
- Add scripts
- Modify scripts
- View scripts
- Delete existing scripts
- Move a script from one organization to another
All the scripts available for your business organization are available for all child organizations also.
How do I add a script for my organization?
There are two steps to adding a script:
- Define the basic information about the script, such as name, description, and script type: see To add a script below.
- Configure the script to define what it actually does: see To configure a script below.
To add a script
- In the Community Manager developer portal, go to the Organizations List (see To access the Organizations List).
- Find your organization on the list, and then click the title to view the Details page for the organization.
- On the left navigation bar, choose Scripts. All scripts associated with the organization are displayed.
- Click Add.
- In the Add script page, specify:
- Script Name: A short, descriptive name for the script; for example, Get-User-Info-For-AccountNo or Build-Custom-Form-Request. Used on the script summary page.
- Script Type: The scripting language you want to use to write the script. Supported types: BeanShell Engine, Jython, or JavaScript.
- Script Description: A brief description of the script. Include any key information relating to how the script is used and what it does.
- Click Save. The script is added to the list of scripts for the organization.
To configure a script
- First, add the script; see To add a script above.
- Go to the scripts list for the organization (Organizations > organization > Scripts).
- Find the script on the list and click the title to access the details page for the script.
- In the second section, Script Summary, click Edit. The Script Editor appears. Here, you can use all the features of the Script Editor to build the script you want.
- When done, click Finish.
Some things you can do in the Script Editor:
- Import scripts that you've already defined.
- Use default methods: Type CTRL+Spacebar and then choose from the list of available objects; in most cases, type a period after the object to view available methods. Options vary according to the selected scripting language.
For more information on using the Script Editor, see Getting Started with Scripts).
How do I view scripts for an organization on the API platform?
If you're a Business Admin, you have full rights to add, view, edit, or delete scripts that are set up for your organization.
To view scripts for a business organization
- In the Community Manager developer portal, go to the Organizations List (see To access the Organizations List).
- Find your organization on the list, and then click the title to view the Details page for the organization.
- In the left menu, click Scripts. All scripts associated with the organization are displayed. An example is shown below.
- To view details of a specific script, click the link in the title to access the Details page for the script. The script is displayed in the bottom section.
How do I modify a script associated with an organization on the API platform?
If you're a Business Admin, you have full rights to add, view, edit, or delete scripts that are set up for your organization.
To modify a script associated with a business organization
- In the Community Manager developer portal, go to the Organizations List (see To access the Organizations List).
- Find your organization on the list, and then click the title to view the Details page for the organization.
- In the left menu, click Scripts. All scripts associated with the organization are displayed.
- Find the script on the list, and click the link in the title. The Details page for the script is displayed, as shown below.
- You can edit in two ways:
- To edit the script name, type (scripting language), and description, click Edit in the top panel.
- To edit the script details, click Edit in the second panel to access the Script Editor. See To configure a script above.
How do I move a script from one organization to another?
You can move a script that's in the context of one of your business organizations into another organization, as long as you are a Business Admin for both organizations. For example, you might have created the script in the context of a child organization by mistake. You can easily move it to the parent organization. Follow the steps below.
To move a script from one business organization to another
- In the Community Manager developer portal, go to the Organizations List (see To access the Organizations List).
- Find the organization that the script currently exists under, and then click the title to view the Details page for the organization.
- On the left navigation bar, choose Scripts. All scripts associated with the organization are displayed.
- Find the script that you want to move, and then click the title to view the Details page for the script.
- In the top section, click Edit.
- In the Organization Name field, start typing the name of the organization you want to move it to. After the first three characters, the platform displays a list of matching organizations for you to choose from.
- Click the entry for the new organization so that the full name is displayed in the field.
- Click Save. The script is moved to the new organization.
How do I delete a script associated with an organization on the API platform?
If you're a Business Admin, you have full rights to add, view, edit, or delete scripts that are set up for your organization.
To delete a script associated with a business organization
- In the Community Manager developer portal, go to the Organizations List (see To access the Organizations List).
- Find your organization on the list, and then click the title to view the Details page for the organization.
- In the left menu, click Scripts. All scripts associated with the organization are displayed.
- Find the script on the list, and click the link in the title. The Script Details page is displayed.
- Click Delete.
- At the confirmation prompt, click OK. The script is deleted.
What roles can manage scripts for my business organization on the platform?
The Business Admin has full responsibility for all scripts, created at the organization level. The API Admin can create and manage scripts at the API level, but only the Business Admin can manage scripts for the organization.