FAQ (Frequently Asked Questions)

From jABC Manual Wiki
Jump to: navigation, search

Feel free to add questions. We will answer as soon as possible...

jABC Handling

How do I find SIBs for my purposes? Is there an overview from where I can select SIBs?

The jABC lists the SIBs that are currently loaded and available for process modeling in the SIB browser in the upper left corner of the jABC window. By default, the SIBs are sorted according to their location in the file system (which also corresponds to the Java package structure). The Taxonomy Editor plugin can be used to define own categories and sort SIBs accordingly. The SIB browser has furthermore a simple filtering mechanism (directly below the list of SIBs) that can be used to search for specific SIBs.

The jABC installer comes with a number of standard SIBs that belong to the Common SIBs collection, such as the Basic SIBs (for working with the execution context), the Collection SIBs (for dealing with arrays, collections and maps), the GUI SIBs (providing dialog for user interaction) or the IO SIBs (performing file-related tasks).

As for obtaining new SIBs, there is currently no public repository where SIBs could be shared or downloaded. Please contact the jABC project manager or people working on particular projects if you are looking for specific functionality.

How do I have to set the parameters in the SIB inspector?

If the parameter is a plain data type, simply enter the value directly into the corresponding field. If the parameter is a ContextKey, enter the name under which the corresponding object is available from the context. If the parameter is a ContextExpression, you can enter a direct value or a ContextKey (marked by a Dollar sign and braces: "${contextkey}") or a combination of both, which is then evaluated agains the context at runtime and replaced by the resulting value.

And don't forget to hit the Enter key after typing in a parameter value, otherwise it will be discarded by the SIB inspector!

What is the difference between a ContextKey and a ContextExpression?

A ContextKey ContextKey is simply a name for an object in the execution context. A ContextExpression is an expression (for instance a string) that is evaluated against the execution context during execution, and in which ContextKeys can be used to refer to objects from the context by using a $-notation. For example: the ContextExpression "Hello ${name}!" would be evaluated to "Hello Joe!" if there is an object "name" with the value "Joe" in the context.

How can I enter tabs or newlines in (String) parameters?

As usually the Enter key is used to finish parameter insertion and the Tabulator key jumps to the next field, there is a special mode for including tabs end newlines into (string) parameters: holding the jABC key (usually the ALT key, configurable in the" Options" menu in the "General" tab, property "JavaABC ALT key") while clicking on the parameter field in question opens a slightly larger text field in which also tabs and newlines can be inserted. Pressing the jABC key together with the Enter key closes this text field and sends the multi-line and/or tabbed value to the SIB inspector (don't be worried when it looks as if it is transformed into a single line again - this is just for visualization in the inspector).

How do I handle the error messages that can occur when a SIB is executed?

When an error occurs during execution, the SIB will take the "error" exit and put the corresponding exception into the execution context under the name "exception", which can subsequently be accessed and shown or handled further.

What is the purpose of the different Contexts?

Local contexts are connected to one model (one model level, not including submodels), providing a local scope for the variables (ContextKeys) that are used there. In addition, there is a global context that can be accessed by all models (including submodels) and where object can be made globally available, beyond the scopes of single models.

Where can I see the current values of variables in the Tracer?

As soon as execution has been started, the available context are listed in the "Context" tab in the Tracer window (you may have to hit the "details >>>" button first to see it). Choose the context that you want to examine from the "Stack:" list. The "Context:" table below displays the ContextKeys, their values and the data types of the values (you may have to enlarge the Tracer window in order to properly see all context information).

How can I create submodels?/How can I create a hierarchy of models?/How can I connect models?

Use MakroSIBs to create submodels of a model (MakroSIBs are Tracer ControlSIBs). There are two related ControlSIBs: the GraphSIB and the ThreadSIB.

Where is the difference between GraphSIB and MacroSIB - which one is recommended to use?

The GraphSIB creates an own context for the execution of the submodel and thus a hierarchy of contexts. This is only required in rather rare cases, e.g. if you want to model recursion, or if you have a complex hierarchy of models and you want to assure that you have separated variable scopes. The MakroSIB is suitable and sufficient for most cases: You will most likely have a quite simple hierarchy with a simple structure of context manipulation, so that there is no danger of using a context key twice (for two different purposes).

GraphSIBs/MacroSIBs: How do I define outgoing branches?

SIB branches that are not used by the model itself can be marked as "model branches" (within the "Branches" tab of the SIB inspector: right-click on the branch name, and then select "Add as new model branch" or "Map to an existing model branch"). The Graph inspector lists all these model branches. They will be the outgoing branches of GraphSIBs and MacroSIBs to which the model is assigned as submodel. The names of the model branches can be edited in the "Branches" tab of the Graph inspector in order to provide more suitable branch names for the supermodel.

GraphSIBs/MacroSIBs: How can I pass values to submodels?

SIB parameters that are not set within the model itself can be marked as "model parameters" (within the "Parameters" tab of the SIB inspector: right-click on the parameter name, and then "Select as model parameter" ). The Graph inspector lists all these model parameters. They will be the SIB parameters of GraphSIBs and MacroSIBs to which the model is assigned as submodel. The names of the model parameters can be edited in the "Parameters" tab of the Graph inspector in order to provide more suitable parameter names for the supermodel.

Is there a special SIB to define the end of a model?/What should happen to the branches in the "last" SIB of a model?

No, there is no special "End-SIB". The execution simply stops if the chosen branch is not defined in the model. This should only be the case in the main model. In a submodel the end of the exeuction should always be at a model branch.

How to relocate/curve a branch?

Use the Spline Funktion of an edge. See Connecting SIBs for more information.

What does the error mean: "Cannot invoke service adapter for SIB"?

This most likely means that the service adapter for the affected SIB could not be found. Either a JAR is missing in the project classpath or the SIB path, or the service adapter descriptor in the SIB code is not correct.

Some/all SIBs in a model are (suddenly) loaded as ProxySIBs ?

This is a common problem and there is no out-of-the-box solution for this. Typically, jABC has a problem to load the SIB class or the SIB implementation if it has been changed incompatibly. First check if the SIB is available in the SIB Browser, and if you can drop the SIB in a clean model, save and reload the model. Sometimes a required library may be missing.

A recent problem was due to the fact that a SIB was available in two different implementations, one in a SIB path and one in a project classpath. The second implementation was not detected by the ambiguous object mechanismus and led to strange loading behavior.

See also: Debugging of SIB Loading exceptions