IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Advanced development topics > Customize behavior with visual snippets > Create a custom visual snippet

Selecting a standard visual snippet

Many types of snippets are available in the editor, and you can use them when composing your own visual snippet.

The visual snippets view to the left of the editor contains a categorized list of standard visual snippets that are included with the product as well as custom visual snippets that have been user-defined. Proceed as follows to add one of them to your snippet:


Procedure

  1. In the Visual Snippets view, expand the category and choose the snippet that you would like to add as shown in the image.

  2. Drag this snippet onto the canvas.


Results

The snippet appears as an node on the canvas, and you can wire it up as needed.

Standard activities are fixed and cannot be modified. However, a custom activity can be opened in a new editor by double-clicking it.

A list and description of the available standard visual snippets.
Category Standard visual snippet Description
arrays array length Returns the number of elements in the array.
copy array element Makes a copy of a specific element in the array.
get array element Returns the value of a specific array element.
set array element Specifies the value of a specific array element.
converter convert integer to string Changes the value of the integer into a string.
convert primitive type to string Changes the value of the primitive into a string.
convert string to double Changes the value of the string into a double.
convert string to float Changes the value of the string into a float.
convert string to integer Changes the value of the string into an integer.
convert string to long Changes the value of the string into a long.
convert to lower case Makes all of the characters in the string into lower case characters.
convert to upper case Makes all of the characters in the string into upper case characters.
date are dates equal Compares two dates to see if they are the same. Returns true if they match.
create date from pattern Creates a date object by combining a given pattern and date string.
create GMT date from pattern Creates a date object by combining a given pattern and a date string that is in Greenwich Mean Time format.
current date and time Returns a value that is equal to the current date and time.
day of the month Returns a value that is equal to the current day of the month.
day of the week Returns a value that is equal to the current day of the week.
day of the year Returns a value that is equal to the current day of the year.
difference between two dates Compares two separate dates, and returns the difference between them in number of days.
format date to GMT string using pattern Takes a patterned date as input and transforms it into a string that is based on Greenwich Mean Time.
format date to string using pattern Takes a patterned date as input and transforms it into a string.
format locale date to string using pattern Determines the current date and time based on the computer's locale, and uses a pattern to transform it into a string.
get date pattern Returns a pattern that can be used to compose date and time formulas.
is date after Compares two dates as input and returns true if the value of the first date is after the second date.
is date before Compares two dates as input and returns true if the value of the first date is before the second date.
Diffgram set diffgram schema Set the diffgram schema for working with Microsoft ADO.NET services. For more details, see Work with Microsoft ADO.NET services
events emit BO event Declares a business-related message that can be logged in the runtime environment.
list add item to list Takes an existing list and a new object as inputs, and add that new object to the end of the existing list.
clear all items from list Clears an existing list of all elements.
get item at index Takes an existing list and an index value as input, and returns the specific item that is at the index point.
index of item Takes an existing list and a list object as inputs, and returns the index of the specified list item.
is list empty Evaluates the list and returns true if it is empty, and false if it contains any elements.
list contains item Takes an existing list and a list object as inputs, and returns true if the list contains the specified object.
list size Returns a value that represents the number of items in the list.
list to sort Takes the contents of a list, and arranges them alphabetically.
remove item at index Takes an existing list and an index value as input, and deletes the item that is at the specified index point.
remove item from list Takes an existing list and a list object as inputs, and deletes the specified list item.
set item at index Takes an existing list, an index value, and an object as input, and places the item at the given index point in the list.
logic and Takes two boolean inputs, and returns true when they themselves are both true.
inverse Takes a boolean input and converts it to its opposite. If it comes in as true, it is changed to false and vice versa.
or Takes two boolean inputs, and returns true when either one of them is true.
mapping service advanced mapping The advanced mapping snippet builds on the basic mapping snippet (see below). It includes similar terminals, but accepts a map of input and a map of output business objects. It also provides an additional terminal for an execution context (which may be null).
basic mapping Use a basic mapping snippet for general mappings between two business objects. This standard visual snippet provides terminals that you can use link to the name and namespace of the map, the business objects that you are working with, and three exceptions.
specific mapping Uses a specific mapping snippet to reference an existing business object map. Like the previous two options, this standard visual snippet has terminals for inputs (that automatically refer to the business objects as defined in the business object map), exceptions and for execution context.
math absolute value Returns the absolute value of a number.
add Takes two numbers as input, and returns their sum.
divide Takes two numbers as input, and returns their quotient.
equal to Takes two numbers as input, and returns true if their values are the same.
greater than Takes two numbers as input, and returns true if the value of the first number is higher than that of the second.
greater than or equal to Takes two numbers as input, and returns true if the value of the first number is higher than or the same as that of the second.
less than Takes two numbers as input, and returns true if the value of the first number is lower than that of the second.
maximum Takes two numbers as input, and returns the value that is greater.
minimum Takes two numbers as input, and returns the value that is lesser.
multiply Takes two numbers as input, and returns their product.
not equal to Takes two numbers as input, and returns true if the value of the first number is different than that of the second.
power Takes a base and an exponent value as inputs, and returns a value that is equal to the base number raised to the power of the exponent.
square root Returns the positive square root of the number given as input.
subtract Takes two numbers as input, and returns the difference between them.
numbers format number to string Takes a maximum fraction digit and a number as inputs, and returns the value as a string.
format number using pattern Takes a pattern and a number as inputs, and returns the value as a string.
parse number for locale Formats a number according to the standards of the current locale (for example either '1,000' or '1000' or '1 000)
relationship service create participant Takes a relationship name, role name, and a business object as inputs, and creates a new participant for this relationship service.
create participant with ID Takes a relationship name, role name, specified instance ID, and a business object as inputs, and creates a new participant for this relationship service.
deactivate participant Takes a relationship name, role name, and a business object as inputs, uses them to identify a specific user, and disables this user without completely removing it from the system.
deactivate participant by instance Takes a relationship name, role name, and instance ID as input, uses them to identify a specific user, and disables this user without completely removing it from the system.
delete participant Takes a relationship name, role name, and a business object as inputs, uses them to identify a specific user, and completely removes this user from the system.
delete participant by instance Takes a relationship name, role name, and instance ID as input, uses them to identify a specific user, and completely removes this user from the system.
foreign key lookup Takes the following as input:

  • foreign relationship name
  • foreign input role name

  • DataObject business object
  • foreign keys business object
  • foreign output role name
  • output business object
  • output business object foreign keys
  • original input business object
  • original output business object
  • calling context

foreign key xref Returns a cross reference of a foreign key with the following as input:

  • foreign relationship name
  • foreign input role name

  • DataObject business object
  • foreign keys business object
  • foreign output role name
  • output business object
  • output business object foreign keys
  • original input business object
  • original output business object
  • calling context

get relationship property Takes a relationship name, a property name, and an instance ID as inputs, and returns a relationship property.
get role property Returns a role property with the following as input:

  • relationship name
  • role name
  • property name
  • instance ID
  • business object

maintain identity relationship Maintains the identity of a relationship with the following as input:

  • relationship name
  • role name
  • input business object
  • output business object
  • original input business object
  • original output business object
  • calling context

retrieve instances Takes a relationship name, a role name, and a business object as inputs, and returns a matching instance.
retrieve participants by instance Takes a relationship name, a role name, and an instance ID as inputs, and returns all matching participants.
retrieve participants by relationship name Takes a relationship name and an instance ID as inputs, and returns all matching participants.
retrieve participants by role name Takes a relationship name, a role name, and an instance ID as inputs, and returns all matching participants.
set relationship property Specifies a relationship property with the following as input:

  • relationship name
  • property name
  • property value
  • instance ID

set role property Specifies a role property with the following as input:

  • relationship name
  • role name
  • property name
  • property value
  • instance ID
  • business object

unset relationship property Removes a relationship property as specified by following inputs:

  • relationship name
  • property name
  • instance ID

unset role property Removes a role property as specified by following inputs:

  • relationship name
  • role name
  • property name
  • instance ID
  • business object

SCA services add item to soap-encoded array Takes two business objects as input (one of them is an item, and the second is a soap-encoded array), and adds the item to the array.
are BO's Equal Takes two business objects as input, and returns true if their values are the same.
are BO's Equal (shallow) Takes two business objects as input, and returns true if their values are the same. A shallow function looks only at that information which is on the first level of the BO. If the BO contains a reference to another BO, then that information will not be considered.
copy BO Takes either a business object or a business graph as input, and duplicates it.
copy BO (shallow) Takes either a business object or a business graph as input, and duplicates it. A shallow copy takes only that information that is on the first level of the BO. If the BO contains a reference to another BO, then that information will not be copied.
create BO from specific XML file Creates a business object from the contents of a specific (fixed) XML file. This differs from the snippet “create XML string from BO” in that the contents come from a file rather than a string.
create BO from XML file Creates a business object from the contents of an XML file. This is similar to the snippet create BO from specific XML file except that the location of the file is provided when the application is running.
create BO from XML string Creates a business object from the contents of a string which contains XML data. See also create XML string from BO in this table.
create simple type BO Creates a commonj.sdo.Type from a simple XSD type
create XML string from BO Creates an XML string that contains the contents of a business object. It does this by adding a CDATA tag around the BO XML string. The CDATA tag can cause a JDBC adapter to send encoded XML to the database. To make sure the XML string is not encoded and to not store the CDATA tag with the message, use a combination of the get BOXMLSerializer Service Standard snippet and the BOXMLSerializer.writeDataObject Java snippet to create an XML string that contains the contents of a business object.
copy list contents Takes two lists as input, and copies the contents of the source list into the target list. (Copies are made for business objects)
create BO Takes a namespace and a name as input, and returns a new business object.
create specific BO Uses the Data Type selection wizard to create a specific business object.
get BOChangeSummary Service Returns data from the business object Change Summary Service.
get BODataObject Service Returns data from the business object Data Object Service.
get BOEventSummary Service Returns data from the business object Event Summary Service.
get BOMetadata Service Returns data from the business object Metadata Service.
get BOXMLSerializer Service Returns data from the business object XML Serializer Service.
get property for global attribute Gets the global property that corresponds to a global attribute with of a given name and namespace. This property can be used as input to the snipppet, set wildcard XSD:anyAttribute with global attribute.
get property for global element Gets the global property that corresponds to a global element with of a given name and namespace. This property can be used as input to the snippet, set wildcard xsd:any with global element BO.
locate service Takes a service name as input, and obtains a reference to the it.
set wildcard XSD:anyAttribute with global attribute Sets a global property of a given name with a value for a business object that contains XSD:anyAttribute.
set wildcard xsd:any with global element BO Sets a global element with a business object for a business object that contains XSD:any.
SMO services create HTTP header Adds an HTTP header in the Service Message Object (SMO). This is valid for mediation flows.
copy SMO Takes a Service Message Object as input, and duplicates it.
create SMO body Takes a namespace and a message as input, and creates a body for the Service Message Object.
create SOAP header Creates a SOAP header from the following inputs:

  • SOAP header name
  • SOAP header namespace
  • SOAP header prefix
  • Business object

create specific SMO body Uses the Message selection wizard to create a specific Service Message Object body.
get SMO attachment using content ID Retrieves the attachment from the SMO with the given content ID. This is valid for mediation flows.
get SMO body Takes a Service Message Object as input and returns its body.
get SMO part Takes a Service Message Object and an XPath expression as input, and returns the part specified by XPath.
set SMO body Takes a Service Message Object and an SMO body as input, and specifies its body.
text append text Takes two string as input, and combines their contents into one.
remove whitespace from text Takes a text string as input, and clears all of the empty characters from it.
split text Take as text string, a start index, and an end index as inputs, and creates a substring of the given text using the given indexes.
text equal to Takes two text strings as input and returns true if they are both the same.
text equal to (ignore case) Takes two text strings as input and, while ignoring case, returns true if they are both the same.
text length Takes a text string as input, and returns its length in characters.
utility BO print to logger Uses the Select Log Level wizard to specify granularity of the log. You can choose from the following:

  • Off
  • Severe
  • Warning

  • Info
  • Config
  • Fine
  • Finer
  • Finest

  • All

Then, the snippet takes the log message and business object as inputs, and prints it to System.out.

print BO to log Takes a business object as input, and prints a textual representation of it to System.out.
print to log Takes an object as input, and prints a textual representation of it to System.out.
print to logger Uses the Select Log Level wizard to specify granularity of the log. You can choose from the following:

  • Off
  • Severe
  • Warning

  • Info
  • Config
  • Fine
  • Finer
  • Finest

  • All

The snippet uses the log message and business object as inputs, and prints the message to the SystemOut.log or trace.log files, as defined:

  • Severe, Warning, Info and Config messages are printed to SystemOut.log. If tracing is enabled, the messages are also printed to the server trace.log file.

  • If tracing is enabled, the Fine, Finer and Finest messages are only printed only to the trace.log file.
  • Setting the level of the log wizard to OFF or ALL causes the messages to be printed only to the SystemOut.log file.

to text Takes an object as input, and returns a textual representation of it.
soap add global element item to soap-encoded array Adds a business object defined by a global element to a soap-encoded array which contains that type of element.
add item to soap-encoded array Adds a business object to a soap-encoded array which contains elements of anyType.
get item at index from soap-encoded array Retrieves the object at the specified index from a soap-encoded array.
remove item at index from soap-encoded array Removes the object at the specified index from a soap-encoded array.
soap-encoded array size Returns the size of a soap-encoded array.

Create a custom visual snippet


Related concepts:
Work with Microsoft ADO.NET services