Using activity patterns in Gosu

About this task

Important: You must use the activity pattern code to refer to an activity pattern in Gosu code. Do not use a pattern ID or PublicID value.

There are two operations that you can perform in Gosu involving activity patterns:

  • One is to test which activity pattern an existing activity uses.
  • The other is to retrieve an activity pattern for use in creating a new activity.

To test for a specific activity pattern

Use the following Gosu code, which compares an activity pattern Code value with a string value that you supply.

Entity.ActivityPattern.Code == "activity_pattern_code"

To retrieve an activity pattern

To find (retrieve) a specific activity pattern, use one of the following Gosu find or get methods. The find method returns a query object and the get method returns an ActivityPattern object.