9 1 Plan Your Custom Activity

LANSA Composer

9.1 Plan Your Custom Activity

You should spend some time planning your custom Activity before beginning development. Some of the things you need to think about include:

  • Inputs and outputs: what variable information will this Activity require as input and create as output?

     Your Activity Processor can receive variables and variable lists from the variable pool for the Processing Sequence in which it is running. Equally, it can place variables and variable lists on the variable pool. Variables and variable lists are the means by which your Activity can "communicate" with other Activities and transformations in a Processing Sequence. By receiving and returning variable information to and from the variable pool, you can make your Activity more flexible and able to be used for a wider variety of cases.

  • Performance: how much (or little) work should your custom Activity perform in a single invocation?

     Think about your Activity as a logical "unit of work" that you may wish to combine with other custom Activities, supplied transport and other Activities and/or transformations.

     From the performance point of view, the more work your custom Activity does the better. The processing your custom Activity performs is typically much more efficient than time spent in the Processing Sequence engine switching between Activities. If your custom processing will be used in a high-volume, high-throughput application, you should plan to implement it in fewer Activities.

  • Exception handling: what exceptions might your Activity encounter and how should you prepare for them and handle them?  Can or should your Activity implement support for being restarted?

     You need to understand the capabilities and limitations of the exception handling mechanism provided by the directive CATCH. CATCH is included in a LANSA Composer Processing Sequence and you need to plan how your Activity will interact with it. You also need to plan how you can best use the logging features in LANSA Composer in order to provide adequate diagnostic information in the event of an exception.