Knowing Parameters being passed in various code blocks

Knowing Parameters being passed in various code blocks

Yashpat
Not applicable
18 Views
4 Replies
Message 1 of 5

Knowing Parameters being passed in various code blocks

Yashpat
Not applicable

[ FlexSim 24.2.1 ]

Where we go and write any code node they Usually start out like

Object current = param(1);
treenode activity = param(2);
Token token = param(3);

Where the value of parameters change based on the place where the code is being written. So, If I want to know what value a certain parameter will have where can I look instead of guessing. Because If I go and write custom code it usually start blank and will not tell me what are the available parameters.

In continuation of this, if I add a code block in process flow show will I know that what paraments are being passed to that code block.

I tried to find in the classes documentation but, it seems I am missing something.

Any type of help will be hugely appreciated.

0 Likes
Accepted solutions (1)
19 Views
4 Replies
Replies (4)
Message 2 of 5

moehlmann_fe
Observer
Observer
Accepted solution

I don't think there's any documentation for this. The basic parameters that appear a lot are mostly pretty self explanatory based on their name though.

current is the object the code is written on (in Process Flow this is either the Process Flow itself or the instance object in case of an Object Process Flow).

More specific parameters are often times commented to explain their function.

1728454114493.png

If the purpose/value of a parameter is unclear, I'm afraid the best and only method to learn is to place a break point in the code and simply look what values get assigned to the variables.

The only codes that start completely empty without a predefined header that I can think of right know are model triggers (which don't have any parameters) or user commands (where the user specifies what needs to be passed into the function and should thus know what to add to the header).

Message 3 of 5

Yashpat
Not applicable
Thank Felix, a follow up question. If a code block already has some parameter used, but can there be other parameters that are there but not being passed in the code block but we can use it somehow.


like for the example the screen shot you shared there are 2 params being used but, can there be param 3 param 4 from the model itself and we are not just using them? In that case is there a way for me too know what they might be?

0 Likes
Message 4 of 5

moehlmann_fe
Observer
Observer
You can always check if there are further parameters available by adding more Variant variables to the header. But generally this should not be the case. If you require more information for your code then you should look into other ways to make it accessible (labels, tables, global variables, etc.).
0 Likes
Message 5 of 5

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Yash Patel, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes