context variables in user routine

One Star

context variables in user routine

Hi,
I've defined a context group and i want to make use of these context variables in my own user routine.
Is it possible to make to include the context group in user routines?
Thanks.
Community Manager

Re: context variables in user routine

Hi
It is impossible to use directly context variables in routine yet, you can define some input parameter and pass context variables to routine when calling the routine in the job, for example:
RoutineName.methodName(context.host, context.database);
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: context variables in user routine

Is this a design choice, or is it possible that passing in context will be supported sometime? Since routines can't hold their own state (no method variables can be used in static methods) it means you may have to pass a lot of variables into a routine.
Perhaps there's a better way to accomplish my goal:
I have a state machine that controls the workflow of my data pipeline. The plan is to use talend to coordinate the separate silos of operation in the pipeline at the lowest level of detail, but keep text programming at finer grained levels. I'd like to have each silo/stage encapsulated in an object. The workflowManager needs to know the states of all the silos to determine what to do next.
I was hoping to have my silo objects as routines which would use context variables to get and set information about its state.
In summary:
SiloControllers - can get and set their own state, but don't need to know other silo's states.
WorkflowController - can read and write any SiloControllers state.
This could all be done with graphical programming, but i find that i'm faster developing with text based code, and i think it may be more maintainable, at least for my purpose. So what is the best strategy for passing variables between custom coded modules in the talend framework?
kesten
One Star

Re: context variables in user routine

Hi,
Is there any way to use context parameters in routines without passing them explicitly