cancel
Showing results for 
Search instead for 
Did you mean: 

User Defined Functions

Former Member
0 Kudos

Hi

I gone through the existed threads.. but really confused... my doubt is.. when exactly we can go for Simple functions..( cache = Value) .. i try to create a UDF.. but if i take the value.. it does't have any Result.. then how it will work.. because all the standard functions it will take some input and perform some caliculation and return the result... but here if we select the the cache = value then there is no result...

and also i'm fully confused about Context and Queue .. when exactly we can go for context and queue.. and what is the difference between these two.. and also if i choose cache = Context or Queue then is it called an advanced function... because.. in my editor i was unable to find two types of functions...

Thanks

Babu

Accepted Solutions (0)

Answers (2)

Answers (2)

aashish_sinha
Active Contributor
0 Kudos

Hi,

Advanced user-defined functions can access more than just individual field values. Instead, you can import a complete context or an entire queue for a field as an array before your function is called. This enables you, for example, to perform calculations on all field values of a context as well as to divide up the contexts themselves further by inserting context changes.

Integration

When the instance for a source structure is parsed, a message mapping works by using queues.

Advanced user-defined functions can import either just one context into the input arrays, or complete queues. Make your selection by selecting or deselecting the Save Entire Queue in Cache checkbox in the function editor.

Context : Advanced functions that only import one context do not have an identifiable context change. You can of course insert a context change into the results list.

Queue : Since one or more entire queues are imported in this case, this option is more memory-intensive and is not suitable for very large messages.

The input arrays do not contain the context change at the start and end of the context (or of the queue). These context changes are implicitly always available and cannot be identified or deleted from the user-defined function.

The removeContexts() standard function assigns the fields assigned to it to the root node. You will get the same effect if you assign the root context to this type of field.

Technically speaking, the XML instance is imported into the queues before the target field mappings are processed. The contexts are separated in the queue by a context change. You can address these queues directly in advanced user-defined functions.

Hope this will add a value in your knowledge.

Regards

Aashish Sinha

PS : reward points if helpful

Former Member
0 Kudos

Hi,

Just to give u breif idea about both the function:

Simple Functions (Cache = Value)

This function type can process individual field input values for each function call. Therefore, simple functions expect strings as input values and return a string.

● Advanced Functions (Cache = Context or Cache = Queue)

This function type can process multiple field input values for each function call. Before you call the function, you can either import all the field values of a context or the whole queue for the field in an array.

Advanced user-defined functions can import either just one context into the input arrays, or complete queues. Make your selection by selecting or deselecting the Save Entire Queue in Cache checkbox in the function editor.

Working with Contexts or Queues

Information in Cache

1) Context

Advanced functions that only import one context do not have an identifiable context change. You can of course insert a context change into the results list.

2) Queue

Since one or more entire queues are imported in this case, this option is more memory-intensive and is not suitable for very large messages.

If u see the display queue of both of them then u get the more idea what is the difference between them,

When u create the UDF that time u get the option of selecting either value,context or queue.

Thnx

Chirag