Notice: Use of undefined constant ‘file - assumed '‘file' in /home/jpalio/vhosts/jpaliowikien.torn.com.pl/LocalSettings.php on line 154

Notice: Use of undefined constant bi’ - assumed 'bi’' in /home/jpalio/vhosts/jpaliowikien.torn.com.pl/LocalSettings.php on line 154
Module:Proc - Jpaliowiki EN

Module:Proc

From Jpaliowiki EN

Jump to: navigation, search



Contents

Introduction

Module's function and definition of basic terms

The proc module supports the processing of any elements that feature a certain internal state. A set of possible states and relations between them must be possible to be described by means of a graph, which vertices constitute states and edges are relations between states. Edges will be hereinafter called transitions and the graph of states and transitions will be called a process. A process is executed in a particular system. So, a process is a certain template, the template of possible changes of certain elements' states. There can be many elements, which states change in a way determined by the process, but each of those elements can, at any given time, be in any state defined in the process. Elements will be called process instances.

The reason the module was created was to formalize descriptions of states and transitions, which would enable decomposition of the process and bind activities in the process to specific states and transitions, and thus allow to control a large number of activities within the process. At the same time, the module was designed in such a way as not to limit the user's freedom in execution of various processes.

The basic task of the proc module is to support execution of business processes in the jPalio technology, which determines the method of execution of activities within the process. It is assumed that a process instance being in a specific state is presented to the system's user in a certain way. For this purpose a selected html page, made with jPalio, is used. This page contains information related to the instance's state and controls that allow the user to trigger an action involving transition of the process instance into another state, i.e. execution of a transition. Triggering an action performs the submit of an html form to the same page of jPalio, where the presentation of a particular state is located. A suitable function of the proc modules detects the action triggering, performs activities related to the transition and calls objects responsible for presentation of the process instance in the new state. Then, the user can perform another action and the sequence of activities is repeated. An instance in any state can be presented any number of times, which means that we can display the presentation of an instance in a particular state multiple times without performing any actions or interrupt realization of the process at any time, by e.g. going to another html page, and then re-displaying the page with the presentation of the instance in a particular state and executing subsequent actions in the process.

 Example:
 
 A certain sales process consists of four states:
 A - entering customer information, 
 B - entering order information,
 C - order execution, 
 D - order completed,
 So, the state graph is very simple A -> B -> C -> D. Here, the process instance is 
 the customer's order (request).
 
 Beginning of the order placement by the customer creates a request (the process instance, 
 which is assigned the state A, and triggers a movement to a page, where the request 
 in the state A is presented. Presentation of the request in the state A contains a form 
 for entering the customer information and the "save" button. Clicking the "save" button 
 executes the submit of the form to the same page, causes detection of a transition into 
 the state B, execution of the action bound to the transitions from the state A to the 
 state B (saving the form with the customer information), a change of the request's state 
 from A to B and display of the request in the state B. Presentation of the request in the 
 state B contains a form with the order information and another save button.
 
 Clicking the "save" button performs the form's submit to the same page, detects a transition 
 into the state C, executes an action related to the transitions from the state B to the 
 state C (saving the form with the order information), a change of the request's state from B 
 to C and display of the request in the state C. At this time the customer interrupts 
 realization of the process, by moving to another page or by closing the browser's window. 
 Each request added in this way by the customer has (except for a state) a certain unique
 identifier.
 
 The employee that handles the sales process has a list of customer requests. He selects one 
 of the requests and opens the page, where it is presented in its current state, usually C. 
 The request's identifier is passed on to the page, based on which the proc module can determine
 the state, in which the request is at the time. In the state C both the customer information 
 and the request information is displayed and the button "request completed". The employee 
 performs the activities related to fulfilment of the order and clicks the "save" button, 
 which performs the form's submit to the same page, detects a transition to the state D, 
 executes an action related to the transition from the state C to the state D (if any), 
 and changes the request's state from C do D and displays the request in the state D. 
 No transitions are defined in the state D, we can present there the same information as 
 in the state C, but no buttons are displayed.
 
 The module requires creation in the database of tables described in the chapter 
 "table diagram".  The script that creates tables is available 
 in the chapter "Script that creates tables for Oracle". 

The page that presents the process instance

A code of the simplest page to present the process instance can look like this (assuming that the executed process has id 618):

 $// the page that displays  requests
 $// _RowID - id of a request to be displayed (process instance id)
 
 $=(@orderId, $toLong($toString($_RowID)) )
 $=(@executionStatus, $proc.executeProcess(618, $@orderId, (String)null) )

$proc.executeProcess() is the main function of the proc module, containing the dispatcher that performs all activities related to handling the process and calling objects that execute actions within the process.

Types of objects and their role in the process

The proc module uses several types of objects that execute various functions within the process. These objects can be divided into:

  • objects that perform activities common for the process
  • objects that perform activities related to specific states and transitions

Objects common of the process are individual jPalio objects. Action objects for states and transitions are complex objects, i.e. each of those objects is an element composed of a few jPalio objects executed in a specific, user-defined sequence.

Complex objects have been introduced in order to avoid duplication of objects that perform certain basic activities related to states and transitions - we can create a set of such objects once and then build complex objects out of them for states and transitions. Naturally, similar functionality can be achieved without the necessity to introduce complex objects, by creating analogous objects with basic functionalities, and then by building from them the functionality necessary for the activity related to a state or a transition inside the jPalio object. However, the solution involving complex objects has an advantage - it gives a suitably trained end-user of the application a chance to modify the process from the interface level.

Objects defined for the process

These are objects built from a single jPalio object. Only one such object of each type is defined for each process.

State object

The proc module gives users full freedom as to the choice of location and method of storage of the process instance. The method of storage must meet two conditions:

  • together with the process instance a state must be stored, which it is in, as a numeric identifier
  • process instances must be distinguishable, thus each of them must have an identifier

The simplest table that meets the conditions for storage of process instances (e.g. requests) looks like this:

 create table orders (
   id number(30) not null constraints ord_id_pk primary key using index tablespace indx,
   state_nr number(12) not null
 );
 

The above conditions impose a necessity to introduce an interface, with which the proc module could be able to read or change the state of an instance with a specific identifier. Therefore, it is necessary to define the so called state object for each of the processes that will allow to perform the listed operations. With this solution we can store instance information at any location, e.g. in a database table or in session variables.

 The solution involving the state object also allows to execute fragments of the process 
 without writing data to the database - we can create an instance by giving it another 
 identifier or the beginning state, save the state of the instance in a session variable 
 with a name that contains the instance's identifier and execute the process until 
 a certain stage, on which the proper instance is created in the database (this solution 
 can be used e.g. to create pages, where customers can answer a set of questions before 
 actually adding a request). 

The state object can be called more than once per single display of the process instance. The object should not display anything. See invoking details and a template of the state object.

Error object

Two kinds of errors can occur during execution of a process:

  1. errors (e.g. exceptions) inside jPalio objects that perform activities within a process
  2. internal errors of the proc module related to:
    • process structure errors (e.g. missing definition of the state with a specific number)
    • operation of the state object (e.g. erroneous operation of the state object involving a failure to return a value in a specific global variable)
    • passing on of necessary variables during form submits (e.g. failure to pass on id of the process when submitting a form)
    • insufficient user rights for the state

Errors of the first type are ignored by the proc module, i.e. exceptions are not trapped and the control goes to objects that call methods of the proc module.

Errors of the second type are handled by the error object. This object is called upon detection of an error, with parameters that enable handling of the error, e.g. display of a message on insufficient rights with a header and a footer used in a particular system.

See invoking details and a template of the error object.

Objects defined for states and transitions

To define activities related to states the proc module uses the following types of objects:

  • P - presentation object - a basic object that displays a state (presentation_object)
  • S - stay in state object - displayed, when user should be able to see the process instance in the new state when a transition is completed (stay_in_state_object)
  • I - state initialization object - initializes a state, executed upon entering the state (state_init_object)
  • F - check for subprocesses finish object - determines whether subprocesses, for which we wait in a particular state have already finished (wait_for_subpr_condition)
  • W - wait for subprocesses to finish object - displays a wait for subprocesses to finish (wait_for_subpr_object)

To perform activities related to transitions the proc module uses the following types of objects:

  • O - transition object - executed upon a transition between states (on_transition_object)
  • C - condition object - determines whether a particular transition is possible at the moment or not (condition_object)

Due to the fact that a jPalio object can be executed within several complex objects and objects of a different character, it is suggested to add letters in parenthesis at the end of an object's name to describe the object's functions. A suggested set of letters is located on the above lists, at the beginning of each position. An object used as presentation_object, stay_in_state_object and on_transition_object should have a suffix "(PSO)".

The role of objects of different type have been presented on a diagram below that shows an example of a transition from the state A, B or C to the state D.

Types and a way of application of objects for states and transitions.
Types and a way of application of objects for states and transitions.

Presentation object

It is a basic object for a state. It must always be defined. The function of this object is to present to the system's user the process instance in a particular state, which usually means displaying of a form with the customer information, request information, etc.

The form presented to users usually requires reading data. You must always remember that when displaying the process instance all form data was read and set. This requirement also applies to fields which value is to be null - during the data read they must be set to null. When opening a page, where the instance is being presented, e.g. from a list of available instances, this setting of values of global variables to null is a redundant activity. However, you should remember that the instance can be displayed in a particular state immediately after making a transition using the submit, and then the assumption on the null value of global variables does not gave to be true.

 Let us assume that a certain sales process contains states F and G. The presentation object 
 for the state F contains the customer information form with an input field named "type". 
 Upon clicking the button that triggers a transition to the state G the customer information 
 is saved and there is a change in the request's state from F to G. The presentation object 
 with the state G contains a form with the order information. In the order information there 
 is also a field named "type" that is not initialized, because its value is expected to be 
 entered by the user.
 If we open a request that is in the state G from the list of requests, the field "type" will 
 be empty and the form will work in accordance with expectations. If the request in state G 
 is opened directly after the transition from the state F (after the submit of the customer
 information form), then the value of the "type" field in the form will be the same as the 
 value that was entered in the "type" field in the customer information form. To prevent 
 this situation you should - upon reading information for the form in the state G - set the 
 value of the "type" variable to null.

 Thus, you should not forget about initialization of variables, even the null ones. Erroneous 
 initialization of a variable, as in the example, does not usually cause any catastrophe but 
 but sometimes the consequences can be serious, depending on the functions of non-initialized 
 variables in the presentation object.
 

If information in the form is edited by the system user and - upon triggering a transition action - checked and saved with the transition object, then another problem emerges: to correctly read information from the form in a specific state it is necessary to detect, whether the previous submit caused a change in the state. It comes from the fact that checking the form in the transition object can prevent the change f state (e.g. due to erroneous information in the form). Then, despite the performed submit, the form information should not be readable again.

 The simplest way to ensure a correct read out of information is to use the following structure:

  - in the state object, in the part pertaining to the change of state, you should place 
    the command setting a variable that is not used in any other place, e.g.
    $=(stateChangeFlag, "Y")
  
  - in the presentation object check the variable stateChangeFlag and the variable that 
    informs about the completed read out:
      
   ...
   
   $if( $or($isNull($readFlag), $isNotNull($stateChangeFlag)) ,{
     $// odczytaj dane formularza
     $*sellProcess.stateF.form.read
   })
   
   ...
   
   <form method="post" action="$page.url($currentPageCode())">
     <input type="hidden" name="readFlag" value="Y">
   </form>
   
   ...
   
 The $isNull($readFlag) condition reads information from the form upon displaying the request
 opened from the list of requests, the condition $isNotNull($stateChangeFlag) causes the read 
 out during displaying of the form after a change of state.

For the correct operation of the proc module it is required that the submitted form, contained in the presentation object, passed on additional hidden variables. Appropriate hidden fields are displayed by the function proc.displayHiddenFields(), e.g.

 <input type="hidden" name="ProcessExecutionInstanceId" value="2">
 <input type="hidden" name="ProcessExecutionProcessId" value="618">

Due to passing those variables the function proc.executeProcess(), invoked on the page that presents the process instances can - after the submit - determine the instance and the process according to which it is executed the function's call applies to (some arguments of a typical call, e.g. proc.executeProcess(681, $_RowID, (String)null), after the submit are usually equal null).

 Invoking the function proc.displayHiddenFields() inside the submitted form is the simplest 
 way to pass on required variables. It is however recommended to pass those variables in the
 parameters of the URL passed on in the action argument of the <form> tag. This solution is 
 much more secure - on the page protected with privileges the check sum is then not possible 
 to manipulate the identifier of the currently processed instance. An example of the solution 
 of this type can look like this:  
 
   <form method="post" name="orderForm" id="orderForm"
     action="$page.url($currentPageCode(), null, 
     $+(["&ProcessExecutionInstanceId=", $toString($ProcessExecutionInstanceId),
     "&ProcessExecutionProcessId=", $toString($ProcessExecutionProcessId)) ]) )">

Apart from the hidden fields, the form displayed by the presentation object should also contain elements that enable triggering the instance's state change action. Usually, buttons with appropriate names are displayed for this purpose. However, there are also other ways to trigger a transition. The following functions can be used to display the discussed elements:

  • displayTransitionsButtons() - displays transitions allowed in the current state as a set of buttons
  • displayTransitionsOptions() - displays the transitions allowed in the current state as a list of options for the <select> tag
  • displayTransitions() - displays the transitions allowed in the current state; the jPalio code is invoked for each of the transitions that display html elements that trigger a transition
  • displayTransitionButton(), displayTransition() - analogous to the functions displayTransitionsButtons() and displayTransitions(), whereas only a single transition with the provided text identifier is displayed

Before displaying each transition, each of the above functions checks the user's rights to execute the transition and an additional condition for displaying the transition, if it has been defined (more in description of the condition object).

Knowledge of the transition detection method by the function executeProcess() can be helpful in selecting one of the above functions. To detect a transition this function checks the variable named _ActionTransition. The expected value of the variable is id of the transition from the table j_transitions. If this variable has the null value, the variables _ActionTransitionXX (where XX is the transition's id) are checked - the value other than null means execution of a transition with id contained in the variable's name, The variable _ActionTransition has the higher priority than _ActionTransitionXX.

Naturally, displaying elements that allow to trigger an action is not obligatory - the lack of those elements can be a conscious decision, e.g. aimed at obtaining a read-only form for users with insufficient privileges.

Detection of transitions based on the analysis of the transition’s database identifier, passed on by means of _ActionTransition or _ActionTransitionXX and limiting the list of analyzed transitions to the list of transitions available in the current state protects, to some degree, processing of the instance against multiple execution of the action during refreshing of the page in the browser. The only exception here is the situation, where the transition is a loop in a graph (the transition leads to the same state, where it is defined).

 In the state F there are transitions with identifiers 7,8,9. The system;s user clicks the 
 button named _ActionTransition8 and executes the transition with id=8 to the state G. In 
 the state G there are transitions with identifiers 10 and 11. Performing a refresh of the 
 page in the browser forces sending of a form from the state F with the variable
 _ActionTransition8 set, but this time the transition (and the action object defined in it) 
 will not execute because the process instance is already in the state G, where there is 
 no transition with id=8. Only the process instance in the state G will be displayed.

See invoking details and a template of the presentation object.

Stay in state object

The stay in state object is used to inform the system's user that he no longer participates in the processing of the process instance. A typical task of the object is to display information to the system's user and an element that allows him to move to another location in the system, e.g. the homepage. It is invoked instead of the presentation object, when in the transition's data the flag "stay in state after transition" (see description of the html interface) has been marked. The executed stay in state object is defined in the description of the state from which the transition was made with the stay in state flag marked.

 A typical application of the stay in state object:
 In a certain process the system user (X), e.g. a customer, enters - in the state F - 
 order information and saves it, and thus executes a transition from the state F to G. The 
 request in the state G is processed by another system user (Y), e.g. an employee. The user X 
 does not have right to view requests in the state G. In order for the user X not to see an 
 error message on insufficient rights to the request in the state G you should set the stay 
 in state flag in the description of the transition that saves the order information (F->G) 
 and define the stay in state object for the state F. With this, after a change of state from F 
 to G the user X will see the stay in state object with an appropriate message (e.g. "Your order
 has been accepted. Thank you and feel free to visit us again.") and no attempt will be made 
 to display the request in the state G, which would cause the insufficient rights error.

It is not required to define the object in the state's description. See invoking details and a template of the stay in state object.

State initialization object

The state initialization object is executed after completing a transition (upon a change of the instance's state to the state, to which the initialization object is defined), but once per each performed transition. The task of the object is to perform initialization activities for an instance in a specific state, e.g. preparation of records in the database that are required by the process instance on a specific stage of the processing.

 The initialization object is not a good place for e.g. reading information from 
 a form displayed by the presentation object - while displaying a request in the state G, 
 selected from the list of requests, the initialization object will not execute. However, 
 it will be invoked after a successful transition from the state F to the State G but before
 displaying the presentation object defined for the state G or the stay in state object 
 defined for the state F. 

 The initialization object can be used e.g. to prepare - in the state G - database records, 
 that are required by the state G and subsequent states, so they should exist already in the 
 state G e.g. because their values are displayed in the form, but they will be gradually filled 
 in and modified during execution of actions defined in the states subsequent to the state G.

It is not required to define the object in the state's description. The object should not display anything. See invoking details and a template of the state initialization object.

Check for subprocesses finish object

A description of functions that the check for subprocesses finish object performs is contained in the chapter Subprocesses execution method.

It is not required to define the object in the state's description. The object should not display anything. See invoking details and a template of the check for subprocesses finish object.

Wait for subprocesses to finish object

A description of functions that the wait for subprocesses to finish object performs is contained in the chapter Subprocesses execution method.

It is not required to define the object in the state's description. See invoking details and a template of the wait for subprocesses to finish object.

Transition object

It's an object where actions related to a transition are executed. You can place here any action, e.g. checking and saving a form, creating a subprocess, generating an event for an external system, etc.

In the transition object you should not place the change of an instance's state action. A change of state is performed with a help of the state object by the proc module upon execution of the transition object.

In the transition object it is possible to set a flag that informs the proc module that the action related to the transition has not been performed correctly (e.g. erroneous information was provided in the form), and thus the transition should not be executed.

It is not required to define the object in the transition's description. The object should not display anything. See invoking details and a template of the transition object.

Condition object

The condition object is used to check, whether it is possible to display a transition to which it is assigned. This object, as long as it is defined, is invoked by the functions displayTransitionsButtons(), displayTransitionsOptions(), displayTransitions(), displayTransitionButton(), displayTransition().

The object is not invoked upon execution of a transition.

 The condition object may be used e.g. to display a selected transition only in a certain 
 time range, e.g. from 8 to 16. If it is necessary for this same condition was checked also 
 upon execution (not displaying) of the transition, you should create a proper transition 
 object.

It is not required to define the object in the transition's description. If no object was provided, it is assumed by default that the transition is always possible (as long as the user has rights to the transition). The object should not display anything. See invoking details and a template of the condition object.

The rights system

In the proc module you can define rights both to states and to transitions of the process. Rights are associated with jPalio roles and not with privileges. Rights are checked by the proc module's functions before execution of the presentation object or while waiting for the subprocesses to finish (rights to a state) and before execution of the condition object and the transition object (rights to a transition). If the system user does not have rights to display a state or to execute a transition the error object is invoked.

Except for the very existence of a right to a state and a transition it is also possible to define a type of the right. The right's type is a single letter.

 Rights' types can be used to e.g. define a way a form is displayed.
 Let's assume that two types of rights to a state are used (E from "edit" and V from "view").
 Using the process building interface you can define that 
 users with the role X will have the right E to the state F, and users with the role Y will 
 have the right V to the state F. Using in the presentation object  associated with the 
 state F the following structure:
 ...
 $=(@stateNr, $toLong($toString($3)) )
 ...
 $// sprawdź uprawnienia
 $=(isReadonly, true)
 $if( $proc.hasRightForState($user.userID(), $proc.getStateIdByNumber($proc.getProcessExecutingProcessId(),$@stateNr), "E") ,{
   $=(isReadonly, false)
 })
 
 you can control - from the interface level - displaying of a form for editing or a form 
 for reading only depending on the roles possessed by the user. 

The proc module handles two independent set of rights to states and transitions. Functions related to the second set of rights have the word "owner" for historical reasons (the second set of rights was once used in one of the portals, which was developed in parallel to the proc module).

 The second set of rights can be used when the user is to possess different rights to 
 documents in a specific state, depending on a specific condition. An example: processing 
 of applications e.g. for  holiday leave. Such document (after its submittal) is approved by
 a superior. If the document's approval is performed in the state F and the system allows to 
 send the document for approval only to a superior, then each user should be able to approve 
 all holiday leave applications in the state F, which he can view except for those he had
 submitted himself.

Subprocesses execution method

A subprocess in the proc module can be either a fragment of the main process, other process or any other entity not related to the proc module. Two objects have been introduced to simplify handling of subprocesses: the check for subprocesses finish object and the wait for subprocesses to finish object. Let's assume that a certain process look like on the diagram below.

An example of a process with subprocesses.
An example of a process with subprocesses.

A transition from the state A to the state B creates a subprocess no. 2 (it is an action executed in full by the user inside the transition object). A transition from the state B to the state C creates a subprocess no. 1. For some time execution of the main process and subprocesses proceeds independently. The structure of the process requires that before the execution of the activities scheduled for the state G both subprocesses were finished - so before the execution of the presentation object for the state G we should check if the two subprocesses have already finished. This functionality can be achieved through an adequate structure of the presentation object in the state G, but this significantly complicates the code of such object. In the proc module the presented situation is handled by the check for subprocesses finish object and the wait for suprocesses to finish object.

The check for subprocesses finish object is invoked before the presentation object (as long as it is defined, it is invoked both after the instance's state is changed to the state, in which the object is defined, and when displaying the instance that is in the state, in which the object is defined). The user should perform a subprocesses state check in this object and return information if they have been finished or not. The user's creation of the condition gives full flexibility in determining a way to wait for subprocesses, the object can (apart from checking if the subprocesses have finished) also check e.g. if a specific event has occurred in the external system.

If the check for subprocesses finish object returns information that subprocesses have been finished, then the presentation object is executed. Otherwise the wait for subprocesses to finish object is executed, where you can display information to the system user about waiting for the subprocesses to finish, e.g. "Subprocess no. 1 has been finished. The request waits for the subprocess no. 2 to finish."

Methods of storing subprocesses in the database

User can store subprocesses in any way allowed by the system's structure. Tables that store instances of the process must also store the state's number.

The structure of tables that store process instances can be linked with processes in many different ways. The most typical cases have been presented below.

A hierarchical structure of the process instance.
A hierarchical structure of the process instance.

A hierarchical organization is convenient because the process instance contains many small subprocesses dependent directly on the main process. Then, both the main process and the subprocesses can be conveniently executed using a single process in the proc module, where the subprocesses are defined as fragments of the process that are not connected with each other or the main process. A single state object is sufficient for such structure (reading and a change of state involves reading and writing the same field from the same table both for all the subprocesses and the main process). Another advantage of this structure is that there is no limit as to the depth of embedding of the subprocesses - you can execute a subprocesses of the type "a query to", which can contain other subprocesses "a query to", etc. Thus, you achieve a query tree of any depth, where each query is processed independently without modifying the database structure. In the hierarchical concept you can also store the instance data in a single table, and execute processes separately, assigning to each of them the same state object and giving a proper process identifier in a call to the $executeProcess() function, depending on the instance type.

A distributed structure of the process instance.
A distributed structure of the process instance.

Another typical structure, presented on the above diagram, should be used when there are multiple large processes in the system, bound loosely to one another. Because the process instances of different type are stored in separate tables, it is more convenient to execute each process or subprocess as a separate process in the proc module. Then, to each process in the proc module you can assign the state object that reads and writes the state from appropriate tables.

Naturally, it is possible to freely combine the above concepts, e.g. to execute some subprocesses as fragments of the processes, and some as independent processes; or to store a part of the instance in the hierarchical structure and another part in separate tables.

External execution of transitions

Apart from triggering transitions by users, it is possible - during execution of the process - to execute transitions externally (in respect to the process), e.g. transitions executed by a jPalio task. The executeTransition() function is used to execute a transition externally. During execution of the executeTransition() function the user's rights to the state are checked, the transition object is executed (if it has been defined), then the instance's state is changed with the state object and the initialization object is executed.

It is also possible to move the instance to the state by means of the moveInstanceToState() function. When moving to the state no rights are checked, the transition object is not executed, and the transition between the current state of the process and the target state does not have to be defined. The state of the object is changed using the state object. Also, the initialization object for the new state is executed, if provided.

It is recommended to call transitions using their text identifiers (j_transitions.text_id) and not numerical identifiers (j_transitions.id).

Simplified operational diagram of the executeProcess() function

A simplified operational diagram of the $proc.executeProcess() function has been presented below.

A simplified operational diagram of the executeProcess() function.
A simplified operational diagram of the executeProcess() function.

The document also contains a detailed execution diagram of the executeProcess() function.

Process description cache

In the current version of the module, the process structure is not buffered, so the majority of the proc module's functions operate directly on the database.

Internationalization

In the current version of the module there are not translations of the standard error messages.

Interface for editing processes

The proc module offers the html interface that allows to edit processes, complex objects and rights to states and transitions. Interface objects are contained in the jPalio.jar file, which makes it easy to add them in any system. For this you should execute the function $proc.createOrReplaceHtmlInterface() once in any object. After executing the function you should refresh the folder tree in jDesigner. A folder "Process management" will appear in the main folder, containing the interface objects. To gain access to the interface pages, you should add links to pages 90010, 90020, 90030, 90050.

The interface is based on identifiers of objects and pages, and not on codes (it was created for the jPalio version that didn't yet support codes). Folders, objects and pages have identifiers >90000.

The interface was tested on the Oracle and postgreSQL databases.

In the "Process management > 03 Reference objects for processes" folder you can find examples of various types of objects.

Object names

Due to a large number of jPalio objects that usually exist in the system, when pointing to those objects in the interface's forms it was necessary to limit the number of objects displayed on the list. In order for jPalio objects to be displayed on the lists, it is necessary to add certain prefixes to them (not in code):

  • "Proc state" for the state objects
  • "Proc error" for the error objects
  • "Proc obj" for other objects used to build complex objects

It is also recommended to give appropriate letter suffixes to object names, defined in the chapter "Objects defined for states and transitions".

Interface configuration

The html interface allows to adjust interface colours (the object 90041) and the method of defining rights (the object 90040). Various systems can use either one or two sets of rights. The UseOwnerRights variable is used to indicate the number of sets used; null means a single set of rights and not null means two sets of rights. In the StateRightTypes, StateRightTypesOwner, TransitionRightTypes, TransitionRightTypesOwner variables you can define three types of rights to states and transitions; providing a single position of the table will cause checkboxes to be displayed in the form for editing rights; providing a bigger number of types will generate a drop-down list.

Editing of processes

Editing on processes is available of the page 90010.

The process table.
The process table.

Defined processes are displayed in the process table. The buttons "Disable" and "Enable" allow to change the status of a process. The "Remove" button removes the process and all states, transitions and complex objects assigned to it. You should observe extra caution when using this button, because this action is not confirmed in any way. The "Copy" button cerates a copy of the process and all states, transitions, complex objects and rights to states and transitions assigned to it. Clicking the process name will switch to the process properties form.

The process properties form.
The process properties form.

The process properties form allows to define the name of the process, its text identifier and the state object and the error object for the process. For the jPalio objects to be visible on the list of state and error objects their names must start with "Proc state" or "Proc error", respectively.

Editing objects

Editing of objects is available on the page 90020.

The object table.
The object table.

On the page with the object table you can add, remove and copy complex objects. Clicking an object name switches to the object properties form.

The object properties form.
The object properties form.

The complex object properties form allows to define a name, affiliation to the process and components of jPalio objects. Affiliation to the process means that the object will be copied and removed together with the process. Objects not assigned to processes will be displayed on the lists of complex objects in the state and transition properties forms of all processes. The button with the "^" character is used to change the sequence of execution of component objects - it moves a component object one position up. Selecting an item on the list "nty obiekty jpalio" and saving the object information will display another list "nty obiekty jpalio" that will allow to add the next object. Saving the item "nty obiekty jpalio" with the null value will cause removal of a specific item.

The table of states and transitions, where the object is used, is displayed under the object properties form. Clicking the table's item will switch to the specific state's properties form.

Editing states and transitions

Editing states and transitions is available on the page 90030.

Table of states.
Table of states.

There are two tables displayed on the states and transitions editing page. Clicking an item in the first of them switches to the edition of the clicked state and its transitions. Clicking an item in the second table allows to edit the whole process at a time.

The state properties form.
The state properties form.

The state properties form is used to edit the properties of a state and transitions related to it. Transition information is indented as compared with the state information. States are displayed in a sequence that corresponds to the state's number.

Meaning of the fields of the state properties form, starting from the top:

  • id stanu – the database id of the state (state id in the j_states table)
  • zaznacz - a field used to select several states when removing states using the "remove selected states" button
  • numer stanu - an obligatory field, it is a numerical identifier of the state, the value of this identifier is stored together with the process instance and shows its current state,
  • text_id - a text identifier of the state, it has been introduced in order to enable calls to states without the need to use states' numbers or states' database id. Calling states using their text identifiers allows to copy the process, modify it and execute an action using the very same jPalio objects as in the previous version of the process (it is not necessary to change the modified states' numbers inside jPalio objects). The text identifier allows to determine the database id of the state using the getStateIdByTextId() function. The database id allows to retrieve any state property, e.g. a state's number, using the getStateNumber() function.
  • nazwa stanu - a name of the state
  • tytuł strony - a page title set in global variables PageTitle and _PageTitle before executing the state object, the stay in state object or the wait for subprocesses to finish object
  • komunikat - a message for the system user set in global variables InfoStr and _InfoStr before executing the state object, the stay in state object or the wait for subprocesses to finish object, e.g. "Please fill in the request's form"
  • ostrzeżenie - a message for the system user set in global variables ErrorStr and _ErrorStr before executing the state object, the stay in state object or the wait for subprocesses to finish object, e.g. "The request will expire in 2 days. Please confirm or decline the request."
  • stan nie chroniony uprawnieniami - when this field is selected, the user's rights to the state are not checked when an instance is displayed in a particular state (the state is always displayed, regardless of the rights).
  • stan archiwum - an information flag, to be used by users in any way
  • początkowy stan procesu - when this flag is selected the state is treated as a potential beginning state of the process and is not displayed on the list of target states in the transition properties form, which allows to execute inter-process transitions
  • początkowy stan podprocesu - when this flag is selected, the state is treated as a potential beginning state of the subprocess and appears of the list of states "subprocesses with beginning states start in the state" in the state properties form
  • końcowy stan (pod)procesu - an information flag, to be used by users in any way, usually used in combination with the isStateLastInProcess() function when changing the state in the state object to mark the process instance as finished.
  • obiekty i parametry: I - the initialization object (the field with a list) and a parameter passed on to the object (the text field),
  • obiekty i parametry: P - the presentation object (the field with a list) and a parameter passed on to the object (the text field),
  • obiekty i parametry: S - the stay in state object (the field with a list) and a parameter passed on to the object (the text field),
  • obiekty i parametry: F - The check for subprocesses finish object
  • obiekty i parametry: W - The wait for subprocesses to finish object
  • obiekty i parametry: W & F - a parameter passed on to the objects: the check for subprocesses finish object and the wait for subprocesses to finish object
  • w stanie rozpoczynają się podprocesy o stanach początkowych - the list of states in the current process that have their "beginning subprocess state" flag set. Numbers of states selected on the list are passed on as one of the parameters of a call to the presentation object
  • pozycja stanu w grafie, X, Y - not used at this time
  • zapisz zmiany - saves changes in the whole form (changes of information concerning the state, the transition and other states and their transitions as long as the whole process is being edited)
  • odśwież - reloads the state information form, ignoring entered changes
  • uprawnienia - displays a window with the rights to a state
  • kopiuj - copies a state, the copy is assigned a state number that is consecutive in respect to the biggest state number in the process
  • usuń - irrevocably deletes a state, this action is executed without any confirmation
  • dodaj przejście, dodaj 2 przejścia, dodaj 3 przejścia, dodaj 4 przejścia - adds a respective number of transitions to a state

Meaning of the fields of the transition properties form, starting from the top:

  • id przejścia - the transition's database id (state id in the j_transitions table)
  • zaznacz - a field used to select several transitions when removing transitions using the "remove selected transitions" button
  • text_id - a transition's text identifier, it has been introduced to enable calls to transitions without using the transition's database id
  • nazwa przejścia - a text displayed on the control that triggers the transition action, e.g. on a button
  • stan następny (N) - a state, to which the transition leads
  • warunek przejścia (C) - the condition object
  • obiekt przejścia (O) - the transition object (action)
  • parametr dla C i O - a parameter passed on to the condition object and the transition object
  • nie chronione uprawnieniami - when this field is selected, the system user's rights to the transition are not checked when transitions are displayed (the transition is always displayed, regardless of the rights).
  • nie wyświetlaj (przejście automatyczne) - when this field is selected the transition is not considered when transitions are displayed
  • po wykonaniu przejścia pozostań w poprzednim stanie - when this field is selected, after execution of a transition the stay in state object defined for the current state should be displayed - not the process instance in the next state
  • uprawnienia - displays a window with the rights to a transition
  • przesuń wyżej - changes the display sequence of the current and the previous transition. Transitions in the form for editing states and transitions are displayed in the same sequence as they will be displayed in the presentation object using the displayTransitionsButtons(), displayTransitionsOptions() and displayTransitions() functions.
  • kopiuj - copies a transitions, the copied transition is placed at the end of the transition list
  • usuń - irrevocably deletes a transition, this action is executed without any confirmation

The role of controls located under the states and transitions table.

  • dodaj stan, dodaj 2 stany, dodaj 3 stany, dodaj 5 stanów, dodaj 10 stanów - adds a respective number of states to the process
  • zapisz zmiany - saves changes in the whole form (changes of information concerning the state, the transition and other states and their transitions as long as the whole process is being edited)
  • odśwież - reloads the state information form, ignoring entered changes
  • lista stanów - switches to the table of states and transitions of all processes
  • usuń zaznaczone stany - removes states, in case of which the field "zaznacz" was selected
  • usuń zaznaczone przejścia - removes transitions, in case of which the field "zaznacz" was selected
  • wyświetl - switches to the form for editing a state selected from the list next to it

Two navigation tables are also located under the states and transitions table. They are used to quickly switch to the edition of objects used by the state and to switch to the edition of states, which transitions lead to the current state or to switch to the edition of states, to which transitions of the current state lead to.

Changes made to the form's field are saved only upon clicking one of the "save changes" buttons. Clicking any other button or using a navigation table loses the changes.

The rights to state form.
The rights to state form.

The above form is displayed upon clicking the "rights" button in the form for editing a state or a transition. The figure shows the edition of rights to a state, the edition of rights to a transition looks and is handled in the same manner. In order to define rights to a state, you should select from the list a type of right for the required roles and click the "save" button. The "refresh" action reloads the form, ignoring the introduced changes. If the interface was configured to use only one set of rights, check-box fields would be displayed instead of the drop-down lists. Selecting a check-box means granting the right.

Editing the rights to states and transitions

Editing the rights to states and transitions is available on the page 90050.

The rights form.
The rights form.

This page provides a significantly more convenient interface to edit the rights than the one available in the form for editing states and transitions. The rights to all states and transitions of the selected process are displayed simultaneously (the field "states and transitions of the process") and to all or selected roles. Roles can be limited to a single role using the "rights to a role" field, to a selected role or the roles subordinate to it (the field "rights to the roles subtree") or to a group of selected roles (the field "rights to selected roles", you can select multiple roles by clicking them with the shift or ctrl key pressed). If the interface is configured to use only one set of rights for states/transitions, check-box fields will be displayed instead of the drop-down lists. Selecting a check-box means granting the right. Changes made to the rights are saved upon clicking the "set associations" button located under the rights table.

Detailed descriptions of objects used in a process and object templates

Communication with objects invoked by the proc module's functions is conducted through jPalio global variables, and it applies both to passing on values to the objects and to returning values by the objects. The proc module does not recognize values returned by objects using the return() function because it's older than the return() function. To retain compatibility with the existing process realizations no changes have been made to the way of returning values by objects.

State object - details

See the description of the role this object plays.

Calling parameters:

0 - the identifier of an instance, which state should be read or written
1 - an additional process parameter passed on to each of the used objects (the third argument for calling the executeProcess() function)
2 - null - read the instance's state, not null - write (change) the instance's state, then the new state's number is passed on in this parameter that has to be set for the instance with the number provided in the parameter 0
3 - null when reading the state, the current (being changed) state's number when writing, it can be used e.g. to record history

Variables set before calling the object:

  • ProcessExecutionStateNr - null,
  • ProcessExecutionInstanceId - null,
  • ProcessExecutionIsOwnersDocument - null upon reading, when writing: not null if the document is processed by the owner, null if not

Variables that the object can set (when reading the state):

  • ProcessExecutionStateNr - the number of a state, in which the process instance is in (the variable should be set obligatorily)
  • ProcessExecutionInstanceId - a change of id of the processed instance of a request, e.g. after adding the new process instance
  • ProcessExecutionIsOwnersDocument - not null means execution of the instance of a process, which owner is currently logged in as user.

Variables that the object can set (when writing the state):

  • ProcessExecutionInstanceId - a change of id of the processed instance of a request, e.g. after adding the new process instance
  • ProcessExecutionIsOwnersDocument - not null means execution of the instance of a process, which owner is currently logged in as user.
   
$// ------------------------------------------------------------------------------------
$// --- the state object ---------------------------------------------------------------
$// ------------------------------------------------------------------------------------

$=(@instanceId, $toLong($toString($0)))
$=(@processExtraParam, $toString($1))
$=(@newStateNr, $toLong($toString($2)))
$=(@oldStateNr, $toLong($toString($3)))

$if( $isNull($@newStateNr) ,{ $// read state 

  $// adding a request upon the first display of the instance
  $// request can be also added in a different way - e.g. outside the process or in the transition or state initialization object
  $if( $==($@instanceId,0) ,{ $// symbolic identifier that represents a document that does not yet exist in the system
    $// add a request
    $=(ProcessExecutionInstanceId, $xxx.addOrder(...) )
    
    $// record in the history the fact of adding the request
    $=(@BlackHole, $history.recordChange("orders", "add", $toLong($toString($ProcessExecutionInstanceId)), (String)null, " ") )
  },{
    $// read state
    $=(ProcessExecutionStateNr, $xxx.getOrderStateNumber($@instanceId) )
  })
  
},{

  $// change state
  $if( $<>($@instanceId,0) ,{   $// o not change the state of the non-existing document
    $// change state
    $xxx.setOrderStateNr($@instanceId, $@newStateNr)
    
    $// record in the history the fact of changing the state 
    $=(BlackHole, $history.recordChange("orders", "state_nr", $@instanceId, $toString($@oldStateNr), $toString($@newStateNr) ) )
    
    $// setting the flag of completing the request cycle
    $=(@nextStateId, $proc.getStateIdByNumber($proc.getProcessExecutingProcessId(),$@newStateNr) )
    $if( $proc.isStateLastInProcess($@nextStateId) ,{
      $xxx.setOrderStatus($@instanceId, "F")
    })
  })
  
})
  

Error object - details

See the description of the role this object plays.

Calling parameters:

0 - identifier of the process instance, to which the call of the object relates to
1 - additional parameter passed on to each of the used objects (the third argument for calling the executeProcess() function)
2 - error code that occurred during execution of the process
3 - default error text
4 - identifier of the process being executed
5 - number of the state which the process instance is in
6 - identifier of the transition being executed (as long as the transition is being executed, if not then null)
7 - identifier of the state which the executed transition leads to

Variables set before calling the object: none

Variables that the object can set: none

Error codes passed on in 2 parameter of the call (error names can also be retrieved by invoking the $proc.getErrorName($toLong($toString($2))) function):

0 - correct execution (no errors)
1 - process id has not been provided
2 - wrong process id
3 - number of the instance to execute has not been provided
4 - no state object set for the executed process
5 - state object has not set the state's number in the variable 'ProcessExecutionStateNr'
6 - no state number has been defined in the process, which the process instance is in
50 - state object has not set the state's number in the variable 'ProcessExecutionStateNr'
51 - no state number has been defined in the process, which the process instance is in
52 - no display object has been defined for the state
53 - insufficient rights to display the state
54 - no stay i state object has been defined
55 - no wait for subprocesses to finish object has been defined for the state
100 - no next state has been defined for the transition
101 - unable to determine the next state's number for the transition
102 - insufficient rights to execute the transition
103 - wrong text_id of the transition (returned from the executeTransition() function)
104 - reserved
105 - reserved
106 - reserved
107 - wrong next state's number (returned from the moveInstanceToState() function)
108 - reserved
109 - reserved

   
$// ------------------------------------------------------------------------------------
$// --- error object -------------------------------------------------------------------
$// ------------------------------------------------------------------------------------
 
$=(@instanceId, $toLong($toString($0)))
$=(@processExtraParam, $toString($1))
$=(@errorCode, $toLong($toString($2)))
$=(@defaultErrorDescription, $toString($3))
$=(@processId, $toLong($toString($4)))
$=(@stateNr, $toLong($toString($5)))
$=(@transitionId, $toLong($toString($6)))
$=(@nextStateId, $toLong($toString($7)))
 
$=(@errorString, $+(["There was the error no ",$toString($@errorCode)," during process execution: <br>",$@defaultErrorDescription,"."]))
 
$// header
$*xxx.header
 
<center>
  <b>$@errorString</b><br>
</center>
 
<br><br>
 
<input type="button" name="action" value="Home page" onclick="window.location='$page.url("xxx.mainpage")';">

$// footer
$*xxx.foot
  

Presentation object - details

See the description of the role this object plays.

Calling parameters:

0 - character of a call to the object - "presentation_object"
1 - identifier of the process instance which the call to the object relates to
2 - additional process parameter passed on to each of the used objects (the third argument for calling the executeProcess() function)
3 - number of the state which the process instance is in
4 - information generated by the on_transition_object in the variable ProcessExecutionTransitionInfo, (as long as before displaying the instance the transition was executed, otherwise - null)
5 - additional state parameter defined in the states table of the process (j_states.presentation_param)
6 - list of numbers of the first states of subprocesses that can be started in this state. This is a list of numbers separated with semicolons (e.g.: "1;2;3"), so you can use the standard $split to separate numbers. Usually, the list contains a single value. If in a particular state more than one subprocess could begin (a list with multiple items), then to identify beginning state of subprocesses we should use the state's text identifier (or the state's name or number - you should select the field that remains unchanged for different version of the same process). The value passed on in this parameter originates from j_states.starting_subpr_states

Variables set before calling the object:

  • ProcessExecutionProcessId - id of the executed process (variable should not be changed)
  • ProcessExecutionInstanceId - id of the executed instance (variable should not be changed)
  • ProcessExecutionProcessExtraParameter - additional process parameter passed on to each of the used objects (third argument of a call to the executeProcess() functions)
  • PageTitle, _PageTitle - if before a call to the object the variable had the null value, then it is set to j_states.page_title, if the value was not null then its value is not changed
  • InfoStr, _InfoStr - if before a call to the object the variable had the null value, then it is set to j_states.info_str, if the value was not null then its value is not changed
  • ErrorStr, _ErrorStr - if before a call to the object the variable had the null value, then it is set to j_states.warning_str, if the value was not null then its value is not changed

Variables that the object can set: none

 
$// ------------------------------------------------------------------------------------
$// --- presentation object ------------------------------------------------------------
$// ------------------------------------------------------------------------------------

$=(@callType, $toString($0))

$if( $==($@callType,"presentation_object") ,{

  $=(@instanceId, $toLong($toString($1)))
  $=(@processExtraParam, $toString($2))
  $=(@stateNr, $toLong($toString($3)))
  $=(@lastTransitionInfo, $toString($4))
  $=(@stateExtraParam, $toString($5))
  $=(@subprocessesFirsStatesId, $toString($6))
  
  $// ----------------------------------------------------------------------------
  
  $// simple form with possible transitions:

  <form method="post" action="$page.url($currentPageCode())">

    $// additional variables to be passed on
    <input type="hidden" name="xxx" value="yyy">
    
    $proc.displayHiddenFields()
    $proc.displayTransitionsButtons("button","    ")
    
  </form>
  
  $// ----------------------------------------------------------------------------
  
  $// form with reading and writing

  $// setting form parameters provided in the parameter
  $proc.parseObjectParams($@stateExtraParam)
  
  $// stateChangeFlag is set to non null in the state object, in the part concerning a change of state
  $if( $or($isNull($readFlag), $isNotNull($stateChangeFlag)) ,{
    $// reading data from the form
    $*xxx.readFormData($@instanceId)
  })
  
  $// displaying the form
  <form method="post" action="$page.url($currentPageCode())">
  
    <input type="hidden" name="readFlag" value="Y">
    
    ... 
    
    $proc.displayHiddenFields()
    $proc.displayTransitionsButtons("button","    ")
    
  </form>
  
})
  

Stay in state object - details

See the description of the role this object plays.

Calling parameters:

0 - character of a call to the object - "stay_in_state_object"
1 - identifier of the process instance which the call to the object relates to
2 - additional process parameter passed on to each of the used objects (the third argument for calling the executeProcess() function)
3 - number of the state which the process instance is in
4 - information generated by the on_transition_object in the variable ProcessExecutionTransitionInfo, (as long as before displaying the instance the transition was executed, otherwise - null)
5 - additional state parameter defined in the states table of the process (j_states.stay_in_state_param).

Variables set before calling the object:

  • PageTitle, _PageTitle - if before a call to the object the variable had the null value, then it is set to j_states.page_title, if the value was not null then its value is not changed
  • InfoStr, _InfoStr - if before a call to the object the variable had the null value, then it is set to j_states.info_str, if the value was not null then its value is not changed
  • ErrorStr, _ErrorStr - if before a call to the object the variable had the null value, then it is set to j_states.warning_str, if the value was not null then its value is not changed

Variables that the object can set: none

 
$// ------------------------------------------------------------------------------------
$// --- displaying stay in state -----------------------------------------------
$// ------------------------------------------------------------------------------------

$=(@callType, $toString($0))

$if( $==($@callType,"stay_in_state_object") ,{

  $=(@instanceId, $toLong($toString($1)))
  $=(@processExtraParam, $toString($2))
  $=(@stateNr, $toLong($toString($3)))
  $=(@lastTransitionInfo, $toString($4))
  $=(@stateExtraParam, $toString($5))
  
  $// setting form parameters provided in the parameter
  $proc.parseObjectParams($@stateExtraParam)
  
  $// header
  $*xxx.header

  <center>
    <b>Request has been saved</b><br>
  </center>

  <br><br>

  <input type="button" name="action" value="Strona główna" onclick="window.location='$page.url("xxx.mainpage")';">

  $// footer
  $*xxx.foot
  
})
  

State initialization object - details

See the description of the role this object plays.

Calling parameters:

0 - character of a call to the object - "state_init_object"
1 - identifier of the process instance which the call to the object relates to
2 - additional process parameter passed on to each of the used objects (the third argument for calling the executeProcess() function)
3 - number of the state which the process instance is in
4 - information generated by the on_transition_object in the variable ProcessExecutionTransitionInfo, (as long as before displaying the instance the transition was executed, otherwise - null)
5 - additional state parameter defined in the states table of the process (j_states.init_param)
6 - number of the previous state (from which the process reached the current state)

Variables set before calling the object:

  • ProcessExecutionInstanceId - null,
  • ProcessExecutionIsOwnersDocument - not null if the document is processed by the owner, null if not

Variables that the object can set:

  • ProcessExecutionInstanceId - a change of id of the processed instance of a request, e.g. after adding the new process instance
  • ProcessExecutionIsOwnersDocument - not null means execution of the instance of a process, which owner is currently logged in as user.
 
$// ------------------------------------------------------------------------------------
$// --- state's initialization ---------------------------------------------------------
$// ------------------------------------------------------------------------------------

$=(@callType, $toString($0))

$if( $==($@callType,"state_init_object") ,{

  $=(@instanceId, $toLong($toString($1)))
  $=(@processExtraParam, $toString($2))
  $=(@stateNr, $toLong($toString($3)))
  $=(@lastTransitionInfo, $toString($4))
  $=(@stateExtraParam, $toString($5))
  $=(@previousStateNr, $toLong($toString($6)))

  $// perform activities that initialize the process instance in a particular state, e.g.
  $// adding a request's parameter. The object is executed just once upon
  $// entering a particular state, and not upon each display of the request in this state.
  ...
  
})
  

Check for subprocesses finish object - details

See the description of the role this object plays.

Calling parameters:

0 - character of a call to the object - "wait_for_subpr_condition"
1 - identifier of the process instance which the call to the object relates to
2 - additional process parameter passed on to each of the used objects (the third argument for calling the executeProcess() function)
3 - number of the state which the process instance is in
4 - information generated by the on_transition_object in the variable ProcessExecutionTransitionInfo, (as long as before displaying the instance the transition was executed, otherwise - null)
5 - additional state parameter defined in the states table of the process (j_states.wait_for_subpr_param). The check for subprocesses finish object has the state parameter that is common with the wait for subprocesses to finish object

Variables set before calling the object:

  • ProcessExecutionSubprocessesFinished - null

Variables that the object can set:

  • ProcessExecutionSubprocessesFinished - not null means that subprocesses have finished and the process should continue
 
$// ------------------------------------------------------------------------------------
$// --- checking for subprocesses finish -----------------------------------------------
$// ------------------------------------------------------------------------------------

$=(@callType, $toString($0))

$if( $==($@callType,"wait_for_subpr_condition") ,{

  $=(@instanceId, $toLong($toString($1)))
  $=(@processExtraParam, $toString($2))
  $=(@stateNr, $toLong($toString($3)))
  $=(@lastTransitionInfo, $toString($4))
  $=(@stateExtraParam, $toString($5))

  $if( podprocesy_zakończone ,{
    $=(ProcessExecutionSubprocessesFinished, "Y")
  },{
    $=(ProcessExecutionSubprocessesFinished, null)
  })

})
  

Wait for subprocesses to finish object - details

See the description of the role this object plays.

Calling parameters:

0 - character of a call to the object - "wait_for_subpr_object"
1 - identifier of the process instance which the call to the object relates to
2 - additional process parameter passed on to each of the used objects (the third argument for calling the executeProcess() function)
3 - number of the state which the process instance is in
4 - information generated by the on_transition_object in the variable ProcessExecutionTransitionInfo, (as long as before displaying the instance the transition was executed, otherwise - null)
5 - additional state parameter defined in the states table of the process (j_states.wait_for_subpr_param). The wait for subprocesses to finish object has the state parameter that is common with the check for subprocesses finish object

Variables set before calling the object:

  • PageTitle, _PageTitle - if before a call to the object the variable had the null value, then it is set to j_states.page_title, if the value was not null then its value is not changed
  • InfoStr, _InfoStr - if before a call to the object the variable had the null value, then it is set to j_states.info_str, if the value was not null then its value is not changed
  • ErrorStr, _ErrorStr - if before a call to the object the variable had the null value, then it is set to j_states.warning_str, if the value was not null then its value is not changed

Variables that the object can set: none

 
$// ------------------------------------------------------------------------------------
$// --- waiting for subprocesses to finish ---------------------------------------------
$// ------------------------------------------------------------------------------------

$=(@callType, $toString($0))

$if( $==($@callType,"wait_for_subpr_object") ,{

  $=(@instanceId, $toLong($toString($1)))
  $=(@processExtraParam, $toString($2))
  $=(@stateNr, $toLong($toString($3)))
  $=(@lastTransitionInfo, $toString($4))
  $=(@stateExtraParam, $toString($5))

  information about waiting for the subprocesses to finish, e.g. a list of finished and non-finished instances of subprocesses
   
})
  

Transition object - details

See the description of the role this object plays.

Calling parameters:

0 - character of a call to the object - "on_transition_object"
1 - identifier of the process instance which the call to the object relates to
2 - additional process parameter passed on to each of the used objects (the third argument for calling the executeProcess() function)
3 - number of the state which the process instance is in
4 - number of the next state of the process instance
5 - additional state parameter defined in the states table of the process (j_transitions.objects_param)
6 - list of numbers of the first states of subprocesses that can be started in this state. This is a list of numbers separated with semicolons (e.g.: "1;2;3"), so you can use the standard $split to separate numbers. Usually, the list contains a single value. If in a particular state more than one subprocess could begin (a list with multiple items), then to identify beginning state of subprocesses we should use the state's text identifier (or the state's name or number - you should select the field that remains unchanged for different version of the same process). The value passed on in this parameter originates from j_states.starting_subpr_states

Variables set before calling the object:

  • ProcessExecutionTransitionSuccessful - set to not null
  • ProcessExecutionTransitionInfo - set to null
  • ProcessExecutionAfterTransitionAction - set to the "stay_in_state" field's value from the j_transitions table before execution of the on_transition object (not null if after execution of the transition the stay in state object is to be displayed)
  • ProcessExecutionInstanceId - set to null
  • ProcessExecutionIsOwnersDocument - not null if the document is processed by the owner, null if not

Variables that the object can set:

  • ProcessExecutionTransitionSuccessful - if not null, it means that the transition has been successful; if the transition is successful then the instance's state is changed automatically, if not - the instance in the current state is displayed again.
  • ProcessExecutionTransitionInfo - information passed on to the presentation_object object, e.g. information about adding something or about an error
  • ProcessExecutionAfterTransitionAction - if null, the instance in the new state is displayed after the transition; if not null the stay_in_state_object of the old state is used. If the stay_in_state_object is displayed, the function that displays transitions will not display any buttons
  • ProcessExecutionInstanceId - you can set here the id of the current request, which enables adding of the instance to the table that stores it only after execution any beginning state (or a sequence of states)
  • ProcessExecutionIsOwnersDocument - if set to not null it means execution of the instance of a process (document), which owner is the currently logged in user.
 
$// ------------------------------------------------------------------------------------
$// --- execution of a transition ------------------------------------------------------
$// ------------------------------------------------------------------------------------

$=(@callType, $toString($0))

$if( $==($@callType,"on_transition_object") ,{

  $=(@instanceId, $toLong($toString($1)))
  $=(@processExtraParam, $toString($2))
  $=(@stateNr, $toLong($toString($3)))
  $=(@nextStateNr, $toString($4))
  $=(@stateExtraParam, $toString($5))
  $=(@subprocessesFirsStatesId, $toString($6))

  $if( dane_formularza_poprawne ,{
    $// save the form
    ...
  },{
    $// error in the form data, do not change the state
    $=(ProcessExecutionTransitionSuccessful, null)
    
    $=(errorString, "Please add a value in the field ...")
  })
  
})
  
 

Condition object - details

See the description of the role this object plays.

Calling parameters:

0 - character of a call to the object - "condition_object"
1 - identifier of the process instance which the call to the object relates to
2 - additional process parameter passed on to each of the used objects (the third argument for calling the executeProcess() function)
3 - number of the state which the process instance is in
4 - number of the next state of the process instance
5 - additional state parameter defined in the states table of the process (j_transitions.objects_param)
6 - list of numbers of the first states of subprocesses that can be started in this state. This is a list of numbers separated with semicolons (e.g.: "1;2;3"), so you can use the standard $split to separate numbers. Usually, the list contains a single value. If in a particular state more than one subprocess could begin (a list with multiple items), then to identify beginning state of subprocesses we should use the state's text identifier (or the state's name or number - you should select the field that remains unchanged for different version of the same process). The value passed on in this parameter originates from j_states.starting_subpr_states

Variables set before calling the object:

  • ProcessExecutionTransitionPossible - set to not null

Variables that the object can set:

  • ProcessExecutionTransitionPossible - if set to null it means that the transition - the html code that generates the transition (e.g. a button or an item on the list of possible transitions) should not be displayed
 
$// ------------------------------------------------------------------------------------
$// --- transition display condition ---------------------------------------------------
$// ------------------------------------------------------------------------------------

$=(@callType, $toString($0))

$if( $==($@callType,"condition_object") ,{

  $=(@instanceId, $toLong($toString($1)))
  $=(@processExtraParam, $toString($2))
  $=(@stateNr, $toLong($toString($3)))
  $=(@nextStateNr, $toString($4))
  $=(@stateExtraParam, $toString($5))
  $=(@subprocessesFirsStatesId, $toString($6))

  $if(transition_display_condition, {
    $// transition can be displayed
    $=( ProcessExecutionTransitionPossible, "Y")
  },{
    $// transition can not be displayed
    $=( ProcessExecutionTransitionPossible, null)
  })
  
})
  

Tables used by the proc module

Diagram of the tables

Diagram of the tables used by the proc module.
Diagram of the tables used by the proc module.

The script that creates tables is available in the chapter "Script that creates tables for Oracle".

j_processes table

The table stores the process data.

column name field type not empty description
id number(6) yes process identifier
status char(1) yes N - process active, L - process disabled
error_object number(6)   jpalio object's id (from p_objects) that functions as the state object
state_object number(6)   jpalio object's id (from p_objects) that functions as the error object
name varchar2(200) yes process name
text_id varchar2(50) yes process text identifier

j_states table

The table stores descriptions of the processes' states.

column name field type not empty description
id number(6) yes state identifier
not_protected char(1)   not null - a transition not protected by privileges, null - protected
process_first_state char(1)   not null - the first state of the process
subprocess_first_state char(1)   not null - the first state of the subprocess
process_last_state char(1)   not null - the last state of the process or subprocess
archive_state char(1)   not null - the flag set, null - not set
process_id number(6) yes id of the process to which the state belongs
state_nr number(12) yes a number of a state in a process (the number which is stored together with the process instance in the field that defines the instance's state)
stay_in_state_object number(6)   id of a complex object from j_objects that functions as the stay in state object
wait_for_subpr_condition number(6)   id of a complex object from j_objects that functions as the check for subprocesses finish object
wait_for_subpr_object number(6)   id of a complex object from j_objects that functions as the wait for subprocesses to finish object
init_object number(6)   id of a complex object from j_objects that functions as the state initialization object
presentation_object number(6)   id of a complex object from j_objects that functions as the presentation object
position_x number(12)   not used
position_y number(12)   not used
name varchar2(200) yes state name
text_id varchar2(50)   state text identifier
init_param varchar2(500)   a parameter for the parameter object for the object
wait_for_subpr_param varchar2(500)   a parameter for the check for subprocesses finish object and the wait for subprocesses to finish object
presentation_param varchar2(500)   a parameter for the presentation object
stay_in_state_param varchar2(500)   a parameter for the stay in state object
page_title varchar2(200)   a page title set during execution of the process in the PageTitle and _PageTitle variables
info_str varchar2(200)   information for the system's user set during execution of the process in the InfoStr, _InfoStr variables
warning_str varchar2(200)   information - warning for the system's user set during execution of the process in the ErrorStr, _ErrorStr variables
starting_subpr_states varchar2(200)   a list of id of the first states of subprocesses that can be started in this state. This is a list of state identifiers (id from j_states) separated with semicolons (e.g.:+ "1;2;3")

j_states_p_roles and j_states_p_roles_owner tables

The tables store jpalio roles' privileges to the process states. The j_states_p_roles tables stores the basic set of rights, and the j_states_p_roles_owner stores the additional set of rights.

column name field type not empty description
role_id number(6) yes a role's identifier (from p_roles)
state_id number(6) yes a state's identifier (from j_states)
type char(1) yes a one-letter right type. If right types are not used (the right/no right system is used) then the contents of this field can be any but must be provided, anyway

j_transitions table

The table stores a description of transitions in the processes.

column name field type not empty description
id number(6) yes a transition identifier
not_protected char(1)   not null - a transition not protected by privileges, null - protected
stay_in_state char(1)   not null - after the transition the stay in state object is displayed instead of the process instance in the next state
dont_display char(1)   the transition is not displayed but it exists and can be triggered manually
state_id number(6) yes a state identifier (from j_states) to which the transition is assigned (the state from which the transition originates)
condition_object number(6)   id of a complex object from j_objects that functions as the transition object
on_transition_object number(6)   id of a complex object from j_objects that functions as the condition object
next_state_id number(6)   a target state identifier for the transition (from j_states)
display_order number(12)   the transition display order, the lower numbers are displayed first, and if several transitions have the same display_order value then those with the lower id are displayed first
name varchar2(200) yes transition name, displayed on html elements (e.g. buttons) that trigger the transition
text_id varchar2(50)   the transition's text identifier
objects_param varchar2(500)   a parameter for the condition object and the transition object

j_transitions_p_roles and j_transitions_p_roles_owner tables

The tables store jpalio roles' privileges to transitions in the process. The j_transitions_p_roles table stores the basic set of rights, and the j_transitions_p_roles_owner stores the additional set of rights.

column name field type not empty description
role_id number(6) yes a role's identifier (from p_roles)
transition_id number(6) yes the transition identifier (from j_transitions)
type char(1) yes a one-letter right type. If right types are not used (the right/no right system is used) then the contents of this field can be any but must be provided, anyway

j_objects table

The table stores the list and description of complex objects.

column name field type not empty description
id number(6) yes the complex object identifier
process_id number(6)   assignment of a complex object to the process (process id from j_processes), null means that the object is not assigned to any process
name varchar2(200) yes the complex object's name

j_objects_p_objects table

The table defines which jpalio objects form individual complex objects. The execute_order field also determines the jpalio objects execution order during execution of a complex object.

column name field type not empty description
id number(6) yes record id in j_objects_p_objects
p_object_id number(6) yes jpalio object's identifier (from p_objects)
j_object_id number(6) yes complex object's identifier (from j_objects)
execute_order number(12)   the order of execution, jpalio objects with lower values in execute_order are executed first, if several objects have the same execute_order value then objects with lower id in j_objects_p_objects are executed first

Functions of the proc module

Editing and reading the process properties

function name function description
addProcess adds a process
copyProcess copies a process and the states subordinate to it, complex objects and rights to states and transitions
removeProcess removes a process, states assigned to it, transitions and rights to them
lockProcess locks the specific process
unlockProcess unlocks the specific process
getProcessStates returns a table of state ids available in the specific process
getProcessErrorObject returns an identifier of the jpalio object that handles errors that occur during execution of the process (the error object's id)
getProcessIdByName returns id of a process with the specific name
getProcessIdByTextId returns id of a process with the specific text identifier
getProcessName returns the process' name
getProcessStateObject returns an identifier of the jpalio object that performs reading and writing of the process' states (the state object's id)
getProcessStatus returns status of the specific process: N - process unlocked, L - locked
getProcessTextId returns a text identifier of the process
setProcessErrorObject sets an identifier of the jpalio object that handles errors that occur during execution of the process (the error object's id)
setProcessName changes the process' name to name
setProcessStateObject sets an identifier of the jpalio object that performs reading and writing of the process' states (the state object's id)
setProcessTextId sets a text identifier of the process

Editing and reading the state properties

function name function description
addState adds a new state for the process with the default name "new state" and having the next free state number
copyState copies a state within the process
removeState removes a state with the specific identifier
getStateTransitions returns a table of transitions ids available in the specific state
getStateIdByNumber returns id of the state with the specific number
getStateIdByTextId returns id of a state with the specific text identifier
getStateInfoString returns the information string for the state with the specific identifier
getStateInitObject returns id of the process objects that initializes the state
getStateInitParam returns the parameter of the state initialization process object with the specific identifier
getStateName returns the name of the state with the specific identifier
getStateNumber returns the number of the state with the specific identifier
getStatePageTitle returns the page title for the state with the specific identifier
getStatePositionX returns the state's x position on the states and transitions graph
getStatePositionY returns the state's y position on the states and transitions graph
getStatePresentationObject returns id of the state initialization process object
getStatePresentationParam returns the parameter of the state initialization process object
getStateProcessId returns id of the process, to which the state with the specific identifier is assigned
getStateRoleOwnerRight returns information whether the specific state and jpalio role are matched for the user who is the instance's owner
getStateRoleRight returns information whether the specific state and jpalio role are matched, i.e. whether the specific role has rights to this state
getStateStartingSubprocesses returns the table of numbers
getStateStartingSubprocessesStr returns the list of numbers
getStateStayInStateObject returns id of the process object displayed on stay in state
getStateStayInStateParam returns the parameter of the process object displayed on stay in state
getStateTextId returns a text identifier of the state with the specific id
getStateWaitForSubprCondition returns id of the process object that checks for subprocesses to finish
getStateWaitForSubprObject returns id of the process object that displays the state while waiting for subprocesses to finish
getStateWaitForSubprParam returns the parameter of the process object that displays the state while waiting for subprocesses to finish
getStateWarningString returns a warning string for the state with the specific identifier
isStateArchive returns information whether the specific state is the archive state
isStateFirstInProcess returns information whether the specific state is the first state of the process
isStateFirstInSubprocess returns information whether the specific state is the first state of the subprocess
isStateLastInProcess returns information whether the specific state is the last state of the process or subprocess
isStateNotProtected returns information whether the state is protected
setStateArchive sets whether the specific state is the archive state
setStateFirstInProcess sets whether the specific state is the first state of the process
setStateFirstInSubprocess sets whether the specific state is the first state of the subprocess
setStateInfoString sets the information string for the state with the specific identifier
setStateInitObject sets id of the state initialization process object with the specific identifier
setStateInitParam sets the parameter of the state initialization process object with the specific identifier
setStateLastInProcess sets whether the specific state is the last state of the process or subprocess
setStateName sets the name of the state with the specific identifier
setStateNotProtected sets protection for the specific state
setStateNumber sets the number of the state with the specific identifier
setStatePageTitle sets the page title for the state with the specific identifier
setStatePosition sets the state's position on the states and transitions graph
setStatePositionX sets the state's x position on the states and transitions graph
setStatePositionY sets the state's y position on the states and transitions graph
setStatePresentationObject sets id of the process object that displays the state
setStatePresentationParam sets the parameter of the process object that displays the state
setStateProcessId sets id of the process, to which the state with the specific identifier is assigned
setStateRoleOwnerRight sets connection of the specific state and the jpalio role
setStateRoleRight sets connection of the specific state and the jpalio role
setStateStartingSubprocesses sets the table of numbers
setStateStartingSubprocessesStr sets the table of numbers
setStateStayInStateObject sets id of the process object displayed on stay in state
setStateStayInStateParam sets the parameter of the process object displayed on stay in state
setStateTextId sets the text identifier of the state with the specific id
setStateWaitForSubprCondition sets id of the process object that checks for subprocesses to finish
setStateWaitForSubprObject sets id of the process object that displays the state while waiting for subprocesses to finish
setStateWaitForSubprParam sets the parameter of the process object that displays the state while waiting for subprocesses to finish
setStateWarningString sets a warning string for the state with the specific identifier

Editing and reading the transition properties

function name function description
addTransition creates a new transition
copyTransition copies a transition with the specific id within the state
removeTransition removes a transition with the specific id and all rights to it
exchangeTransitionDisplayOrder changes the value in the field that determines the display order of two transitions
getTransitionConditionObject returns id of the process object that determines whether the transition can be displayed
getTransitionDisplayOrder returns the number that determines the transitions display order within the state for a state with the specific identifier
getTransitionIdByName returns id of a transition with the specific name
getTransitionIdByTextId returns id of a transition with the specific numeric identifier
getTransitionName returns the name of a transition with the specific identifier
getTransitionNextStateId returns id of the state, to which the transition with the specific identifier leads
getTransitionObjectsParam returns the parameter for the condition_object and on_transition_object objects of the transition with the specified identifier
getTransitionOnTransitionObject returns id of the process object invoked during execution of the specific transition
getTransitionRoleOwnerRight returns information whether the specific transition and the jpalio role are matched for the user who is the instance's owner
getTransitionRoleRight returns information whether the specific transition and the jpalio role are matched, i.e. whether the specific role has rights to this transition
getTransitionStateId returns id of the state, to which the transition with the specific identifier is assigned
getTransitionTextId returns the text identifier of the transition with the specific numeric identifier
isTransitionDontDisplay returns information whether the transition is displayed by the possible transitions display function, or not
isTransitionNotProtected returns information whether the state is not protected
isTransitionStayInState returns information whether the stay in state object should be displayed after the transition or the next state
setTransitionConditionObject sets id of the process object that determine if the transition
setTransitionDisplayOrder sets the number that determines the transitions display order within the state for a state with the specific identifier
setTransitionDontDisplay sets whether the transition is displayed by the possible transitions display function
setTransitionName sets the name of the transition with the specific identifier
setTransitionNextStateId sets id of the state, to which the transition with the specific identifier leads
setTransitionNotProtected sets protection for the specific transition
setTransitionObjectsParam sets the parameter for the condition_object and on_transition_object objects for the transition with the specified identifier
setTransitionOnTransitionObject sets id of the process object invoked during execution of the specific transition
setTransitionRoleOwnerRight sets connection of the specific transition and the jpalio role
setTransitionRoleRight sets connection of the specific transition and the jpalio role
setTransitionStateId sets id of the state, to which the transition with the specific identifier is assigned
setTransitionStayInState sets whether the stay in state object should be displayed after the transition or the next state
setTransitionTextId sets the text identifier of the transition with the specific numeric identifier

Editing and reading the complex objects properties

function name function description
addObject creates a process object (a complex object)
copyObject copies the process object and its associations with jpalio objects
removeObject removes the process object and its associations with jpalio objects
addObjectsAssociation adds a new association of the process object with the palio object
removeObjectsAssociation removes an association of the process object with the palio object
exchangeObjectsExecuteOrder exchanges the order number
getObjectPalioObjects returns a table of association ids of the process object and palio objects available for the specific process object
getObjectIdByName returns id of a process object with the specific name
getObjectName returns the name of a process object with the specific identifier
getObjectProcessId returns the process identifier, to which the specific process object is assigned
getObjectsExecuteOrder returns the order number
getObjectsPalioObjectId returns an identifier of the palio object for the association of the process object and the palio object with the specific id
getObjectsProcessObjectId returns an identifier of the process object for the association of the process object and the palio object with the specific id
setObjectName sets the name of a process object with the specific identifier
setObjectProcessId sets the process identifier, to which the specific process object is assigned
setObjectsExecuteOrder sets the order number
setObjectsPalioObjectId sets the process object identifier for the specific association of the process object and the palio object
setObjectsProcessObjectId sets the process object identifier for the specific association of the process object and the palio object

Editing the rights to states

function name function description
clearStateRoleOwnerRight removes connection of the specific state and the palio role
clearStateRoleRight removes connection of the specific state and the palio role
copyStateRoleOwnerRights copies the owner's rights between states
copyStateRoleRights copies the non-owner's rights between states
removeStateRoleOwnerRights removes all owner's rights to the state and all roles
removeStateRoleRights removes all non-owner's rights to the state and all roles

Editing the rights to transitions

function name function description
clearTransitionRoleOwnerRight sets connection of the specific transition and the jpalio role
clearTransitionRoleRight removes connection of the specific transition and the jpalio role
copyTransitionRoleOwnerRights copies the owner's rights between transitions
copyTransitionRoleRights copies the non-owner's rights between transitions
removeTransitionRoleOwnerRights removes all owner's rights to the transition for all the roles
removeTransitionRoleRights removes all non-owner's rights to the transition for all the roles

Checking the rights to states

function name function description
hasRightForState returns information whether the user has the right to the specific process state
hasRightForStateOwner returns information whether the user, who is the owner of the instance, has the right to the specific process state

Checking the rights to transitions

function name function description
hasRightForTransition returns information whether the user has the right to the specific process transition
hasRightForTransitionOwner returns information whether the user, who is the owner of the instance, has the right to the specific process transition

Process execution

function name function description
executeProcess executes the process instance in accordance with the path defined in the process with the specific id
executeTransition executes the transition with the specific text_id for the specific process instance
moveInstanceToState moves the process instance to the specific state by invoking the state object

Process execution context

function name function description
isProcessExecuting returns true if the process is being executed, i.e. if the executeprocess procedure is being executed at the time
getProcessExecutingInstanceId returns the instance id for the process that is being executed
getProcessExecutingIsOwnersInstance returns information whether the instance of the process being executed belongs to the logged in user or not
getProcessExecutingProcessId returns id of the process being executed
getProcessExecutingStateId returns id of the state, which the instance of the process being executed is in
getProcessExecutingStateNr returns the number of the state, which the instance of the process being executed is in
getProcessExecutingTransitionId returns id of the transition that the current process instance executes

Displaying html elements in the presentation object (transitions and hidden fields)

function name function description
parseObjectParams sets parameters contained in the passed on string to corresponding their values
displayHiddenFields displays hidden-type fields that must be moved by the form containing buttons and transitions
displayTransition displays transitions with the specific text_id, permissible in the current state
displayTransitions displays transitions permissible in this state - in sequence
displayTransitionButton displays a transition with the specific text_id, permissible in the current state, as a button
displayTransitionsButtons displays transitions permissible in the current state as a set of buttons - see the description of the displaytransitionsbuttons function
displayTransitionsOptions displays transitions permissible in the current state as a list of options - see the description of the displaytransitionsoptions function

HTML interface

function name function description
createOrReplaceHtmlInterface creates the HTML interface to manage the structure of processes (adds appropriate objects and jpalio pages)

Other functions

function name function description
getErrorName provides a name of the error returned by any function of the proc module
getVersion returns the module version's number

Tutorial - example

Below, we have provided an example of the execution of a simple process. The example is not described "step by step", since its execution based on the tutorial would be very time consuming. Only the first several steps - to be done by the user in order to start using the proc module - have been described. Preparation of necessary jpalio objects and building the process using the html interface were skipped. Instead of the description of those steps, under the address http://devel.torn.com.pl/palio/html.run?_Instance=proc_test you can find the instance with the execution of the process described in the example that can be copied and then freely modified for learning purposes.

Process diagram

Process diagram - example.
Process diagram - example.

The example process consists of seven states. For the purpose of the example, the states 100.003 and 101.001 are parallel. The transition to the state 100.003 creates a subprocess in the state initialization object 100.003. The state 100.004 should be displayed not sooner than when the subprocess finishes (is in the state 101.002). This function is performed by the check for subprocesses finish and wait for subprocesses to finish objects, defined in the state 100.004. The states 100.005 and 101.002 are the end states in the process.

Creating data structures for the proc module

Yu should create database structures required by the proc module, using the script for the Oracle database or diagram for the Spiral contained in the documentation.

Creating an interface for process editing

You should execute once the $proc.createOrReplaceHtmlInterface() function in any jpalio object once and then refresh data in jdesigner.

Creating data structures for the process instance

You should execute the below script that creates a table to store the data of the process instance (requests). The script for the example described above has been prepared for the Oracle database. For the sake of the example the request's data structure is limited to a single table - it should not be an inspiration when executing real processes (customer information and additional parameters of the request should stored in separate tables).

The request's structure is hierarchical. The state of the subprocess 101 will be stored in the subordinate requests. The subprocess 101 will be modelled as a fragment of the process separate from the superior process (the main process and the subprocess will be seen by the proc module as a single process).

 
create table proc_test_orders
(
 id number(20) not null constraints protesord_id_pk primary key using index tablespace indx,
 state_nr number(20) not null,
 parent_id number(20),
 customer_data varchar2(4000 byte),
 order_data varchar2(4000 byte),
 is_finished char(1 byte) not null,
 creation_date date not null,
 last_state_change date not null
) tablespace users;

alter table proc_test_orders add constraint protesord_parid_fk foreign key (parent_id) references proc_test_orders (id);

create sequence proc_test_orders_s start with 1;
  

Creating folders and objects structure in jdesigner and building the process structure

Steps to create the folders and objects structure in jdesigner and to build the process structure have not been described here. However, you can learn them by duplicating the process available in the instance mentioned in the chapter "tutorial - example".

Comments that may be useful during learning:

  • on the "testPages.mainPage" page there are links "editing processes", "editing objects", "editing states and transitions" and "editing rights". Use them to switch to the interface for editing processes
  • in order to add the first state in the process you should edit the whole process, and thus you have to click the process name in the second table on the page with editing states and transitions
  • To prevent the lack of rights from distracting learning the process building method, select the field "stan nie chroniony uprawnieniami" (state not protected with privileges) and "nie chronione uprawnieniami" (not protected with privileges) in the edition of states and transitions.
  • to make the field "w stanie rozpoczynają się podprocesy o stanach początkowych" (subprocesses with beginning states start in the state) appear in the state's information , select the "początkowy stan podprocesu" (beginning state of the subprocess) field
  • notice that on the object selection lists in the interface you can see only the jpalio objects with the appropriate name prefix: "Proc state" (for the state object), "Proc error" (for the error object) and "Proc obj" (for component objects of complex objects)

Additional information

Detailed execution diagram of the executeProcess() function

Execution diagram of the executeProcess() function - page 1.
Execution diagram of the executeProcess() function - page 1.
Execution diagram of the executeProcess() function - page 2.
Execution diagram of the executeProcess() function - page 2.

Also see the simplified operational diagram of the executeProcess() function.

Script that creates tables for Oracle

 
create table j_objects (
id number(6) not null constraints jobj_id_pk primary key using index tablespace indx,
process_id number(6),
name varchar2(200) not null
) tablespace users;

create table j_objects_p_objects (
id number(6) not null constraints jobjpobj_id_pk primary key using index tablespace indx,
p_object_id number(6) not null,
j_object_id number(6) not null,
execute_order number(12)
) tablespace users;

create table j_processes (
id number(6) not null constraints jpro_id_pk primary key using index tablespace indx,
status char(1) not null,
error_object number(6),
state_object number(6),
name varchar2(200) not null,
text_id varchar2(50) not null
) tablespace users;

create table j_states (
id number(6) not null constraints jsta_id_pk primary key using index tablespace indx,
not_protected char(1),
process_first_state char(1),
subprocess_first_state char(1),
process_last_state char(1),
archive_state char(1),
process_id number(6) not null,
state_nr number(12) not null,
stay_in_state_object number(6),
wait_for_subpr_condition number(6),
wait_for_subpr_object number(6),
init_object number(6),
presentation_object number(6),
position_x number(12),
position_y number(12),
name varchar2(200) not null,
text_id varchar2(50),
init_param varchar2(500),
wait_for_subpr_param varchar2(500),
presentation_param varchar2(500),
stay_in_state_param varchar2(500),
page_title varchar2(200),
info_str varchar2(200),
warning_str varchar2(200),
starting_subpr_states varchar2(200)
) tablespace users;

create table j_states_p_roles (
role_id number(6) not null,
state_id number(6) not null,
type char(1) not null,
constraint jstaprol_rolid_staid_pk primary key(role_id, state_id) using index tablespace indx
) tablespace users;

create table j_states_p_roles_owner (
role_id number(6) not null,
state_id number(6) not null,
type char(1) not null,
constraint jstaprolown_rolid_staid_pk primary key(role_id, state_id) using index tablespace indx
) tablespace users;

create table j_transitions (
id number(6) not null constraints jtra_id_pk primary key using index tablespace indx,
not_protected char(1),
stay_in_state char(1),
dont_display char(1),
state_id number(6) not null,
condition_object number(6),
on_transition_object number(6),
next_state_id number(6),
display_order number(12),
name varchar2(200) not null,
text_id varchar2(50),
objects_param varchar2(500)
) tablespace users;

create table j_transitions_p_roles (
transition_id number(6) not null,
role_id number(6) not null,
type char(1) not null,
constraint jtraprol_traid_rolid_pk primary key(transition_id, role_id) using index tablespace indx
) tablespace users;

create table j_transitions_p_roles_owner (
role_id number(6) not null,
transition_id number(6) not null,
type char(1) not null,
constraint jtraprolown_rolid_traid_pk primary key(role_id, transition_id) using index tablespace indx
) tablespace users;

alter table j_states add (constraint jsta_stainstaobj_fk foreign key(stay_in_state_object) references j_objects(id));
alter table j_states add (constraint jsta_waiforsubcon_fk foreign key(wait_for_subpr_condition) references j_objects(id));
alter table j_states add (constraint jsta_proid_fk foreign key(process_id) references j_processes(id));
alter table j_states add (constraint jsta_waiforsubobj_fk foreign key(wait_for_subpr_object) references j_objects(id));
alter table j_states add (constraint jsta_iniobj_fk foreign key(init_object) references j_objects(id));
alter table j_states add (constraint jsta_preobj_fk foreign key(presentation_object) references j_objects(id));
alter table j_transitions add (constraint jtra_conobj_fk foreign key(condition_object) references j_objects(id));
alter table j_transitions add (constraint jtra_ontraobj_fk foreign key(on_transition_object) references j_objects(id));
alter table j_transitions add (constraint jtra_nexstaid_fk foreign key(next_state_id) references j_states(id));
alter table j_transitions add (constraint jtra_staid_fk foreign key(state_id) references j_states(id));
alter table j_processes add (constraint jpro_errobj_fk foreign key(error_object) references p_objects(id));
alter table j_processes add (constraint jpro_staobj_fk foreign key(state_object) references p_objects(id));
alter table j_objects_p_objects add (constraint jobjpobj_pobjid_fk foreign key(p_object_id) references p_objects(id));
alter table j_objects_p_objects add (constraint jobjpobj_jobjid_fk foreign key(j_object_id) references j_objects(id));
alter table j_objects add (constraint jobj_proid_fk foreign key(process_id) references j_processes(id));
alter table j_states_p_roles add (constraint jstaprol_rolid_fk foreign key(role_id) references p_roles(id));
alter table j_states_p_roles add (constraint jstaprol_staid_fk foreign key(state_id) references j_states(id));
alter table j_transitions_p_roles add (constraint jtraprol_traid_fk foreign key(transition_id) references j_transitions(id));
alter table j_transitions_p_roles add (constraint jtraprol_rolid_fk foreign key(role_id) references p_roles(id));
alter table j_transitions_p_roles_owner add (constraint jtraprolown_rolid_fk foreign key(role_id) references p_roles(id));
alter table j_transitions_p_roles_owner add (constraint jtraprolown_traid_fk foreign key(transition_id) references j_transitions(id));
alter table j_states_p_roles_owner add (constraint jstaprolown_rolid_fk foreign key(role_id) references p_roles(id));
alter table j_states_p_roles_owner add (constraint jstaprolown_staid_fk foreign key(state_id) references j_states(id));

create index jsta_stainstaobj on j_states(stay_in_state_object) tablespace indx;
create index jsta_waiforsubcon on j_states(wait_for_subpr_condition) tablespace indx;
create index jsta_proid on j_states(process_id) tablespace indx;
create index jsta_waiforsubobj on j_states(wait_for_subpr_object) tablespace indx;
create index jsta_iniobj on j_states(init_object) tablespace indx;
create index jsta_preobj on j_states(presentation_object) tablespace indx;
create index jtra_conobj on j_transitions(condition_object) tablespace indx;
create index jtra_ontraobj on j_transitions(on_transition_object) tablespace indx;
create index jtra_nexstaid on j_transitions(next_state_id) tablespace indx;
create index jtra_staid on j_transitions(state_id) tablespace indx;
create index jpro_errobj on j_processes(error_object) tablespace indx;
create index jpro_staobj on j_processes(state_object) tablespace indx;
create index jobjpobj_pobjid on j_objects_p_objects(p_object_id) tablespace indx;
create index jobjpobj_jobjid on j_objects_p_objects(j_object_id) tablespace indx;
create index jobj_proid on j_objects(process_id) tablespace indx;
create index jstaprol_rolid on j_states_p_roles(role_id) tablespace indx;
create index jstaprol_staid on j_states_p_roles(state_id) tablespace indx;
create index jtraprol_traid on j_transitions_p_roles(transition_id) tablespace indx;
create index jtraprol_rolid on j_transitions_p_roles(role_id) tablespace indx;
create index jtraprolown_rolid on j_transitions_p_roles_owner(role_id) tablespace indx;
create index jtraprolown_traid on j_transitions_p_roles_owner(transition_id) tablespace indx;
create index jstaprolown_rolid on j_states_p_roles_owner(role_id) tablespace indx;
create index jstaprolown_staid on j_states_p_roles_owner(state_id) tablespace indx;

create sequence j_states_s start with 1;
create sequence j_transitions_s start with 1;
create sequence j_processes_s start with 1;
create sequence j_objects_p_objects_s start with 1;
create sequence j_objects_s start with 1;
  
 

Table diagram for spiral

The below text should be moved to the file and opened in the spiral. The file contents is correct for the spiral in the version 0.9.1.

 
schema {
  focusedColor = "#0000ff",
  foregroundColor = "#000000",
  backgroundColor = "#ffffff"
}

library basic = spiral.lib.basic.BasicLibrary {}

library erd = spiral.lib.erd.ERDLibrary {}

element ON_TRANSITION_OBJECT = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(508,411)",
  name = "ON_TRANSITION_OBJECT"
}

element J_TRANSITIONS = erd.StdTable {
  bounds = null,
  fields = "Name          v200 n\n" +
           "Text_id       v50  o\n" +
           "Display_order n12  o\n" +
           "Not_protected c1   o\n" +
           "Stay_in_state c1   o\n" +
           "Dont_display  c1   o\n" +
           "Objects_param v500 o",
  location = "(431,491)",
  idName = "ID",
  name = "J_TRANSITIONS",
  idType = "n6"
}

element @109 = basic.DescriptionPane {
  bounds = "(976,380,0,0)",
  content = ""
}

element @108 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_TRANSITIONS(2.7391304347826084)"
}

element @107 = erd.StdConnection {
  pane = "ON_TRANSITION_OBJECT",
  notNull = "false",
  bounds = null,
  secondAnchor = "@28",
  firstAnchor = "@19"
}

element @106 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "P_ROLES(4.402777777777778)"
}

element @105 = erd.LinkAnchor {
  arrow = "erd.tripleExArrow",
  bounds = null,
  dock = "J_TRANSITIONS_P_ROLES(0.2254335260115607)"
}

element J_TRANSITIONS_P_ROLES_OWNER = erd.LinkTable {
  bounds = null,
  fields = "Type c1 n",
  location = "(831,596)",
  name = "J_TRANSITIONS_P_ROLES_OWNER"
}

element @103 = erd.StdConnection {
  pane = "NEXT_STATE_ID",
  notNull = "false",
  bounds = null,
  secondAnchor = "@50",
  firstAnchor = "@37"
}

element @102 = erd.LinkAnchor {
  arrow = "erd.tripleExArrow",
  bounds = null,
  dock = "J_STATES_P_ROLES(4.841726618705036)"
}

element @101 = erd.StdConnection {
  pane = "ERROR_OBJECT",
  notNull = "false",
  bounds = null,
  secondAnchor = "@17",
  firstAnchor = "@49"
}

element STATE_ID@100 = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(923,149)",
  name = "STATE_ID"
}

element NEXT_STATE_ID = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(663,452)",
  name = "NEXT_STATE_ID"
}

element @98 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "P_ROLES(0.8541666666666666)"
}

element @97 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_OBJECTS(4.775510204081632)"
}

element @96 = erd.LinkAnchor {
  arrow = "erd.tripleExArrow",
  bounds = null,
  dock = "J_STATES_P_ROLES(0.7050359712230215)"
}

element @95 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "P_ROLES(4.006944444444445)"
}

element J_STATES_P_ROLES = erd.LinkTable {
  bounds = null,
  fields = "Type c1 n",
  location = "(847,212)",
  name = "J_STATES_P_ROLES"
}

element @93 = erd.StdConnection {
  pane = "PROCESS_ID@71",
  notNull = "false",
  bounds = null,
  secondAnchor = "@84",
  firstAnchor = "@48"
}

element J_OBJECT_ID = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(286,437)",
  name = "J_OBJECT_ID"
}

element @91 = erd.StdConnection {
  pane = "STAY_IN_STATE_OBJECT",
  notNull = "false",
  bounds = null,
  secondAnchor = "@62",
  firstAnchor = "@25"
}

element @90 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "P_ROLES(6.066666666666666)"
}

element @89 = erd.LinkAnchor {
  arrow = "erd.tripleExArrow",
  bounds = null,
  dock = "J_TRANSITIONS_P_ROLES(6.416666666666667)"
}

element @88 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_STATES(2.0054945054945055)"
}

element @87 = erd.LinkConnection {
  pane = "STATE_ID@100",
  notNull = "true",
  bounds = null,
  secondAnchor = "@14",
  firstAnchor = "@96"
}

element P_ROLES = erd.StdTable {
  bounds = null,
  fields = "Name         v150  n\n" +
           "Display_name v150  o\n" +
           "Description  v4000 o",
  location = "(919,310)",
  idName = "ID",
  name = "P_ROLES",
  idType = "n6"
}

element @85 = erd.StdConnection {
  pane = "PRESENTATION_OBJECT",
  notNull = "false",
  bounds = null,
  secondAnchor = "@76",
  firstAnchor = "@34"
}

element @84 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_PROCESSES(2.2333333333333334)"
}

element @83 = erd.StdConnection {
  pane = "WAIT_FOR_SUBPR_OBJECT",
  notNull = "false",
  bounds = null,
  secondAnchor = "@21",
  firstAnchor = "@72"
}

element @82 = erd.StdConnection {
  pane = "J_OBJECT_ID",
  notNull = "true",
  bounds = null,
  secondAnchor = "@97",
  firstAnchor = "@2"
}

element ROLE_ID@81 = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(959,463)",
  name = "ROLE_ID"
}

element J_PROCESSES = erd.StdTable {
  bounds = null,
  fields = "Name    v200 n\n" +
           "Text_id v50  n\n" +
           "Status  c1   n",
  location = "(33,12)",
  idName = "ID",
  name = "J_PROCESSES",
  idType = "n6"
}

element @79 = erd.StdConnection {
  pane = "STATE_OBJECT",
  notNull = "false",
  bounds = null,
  secondAnchor = "@0",
  firstAnchor = "@77"
}

element @78 = basic.DescriptionPane {
  bounds = "(253,255,0,0)",
  content = ""
}

element @77 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_PROCESSES(4.443396226415095)"
}

element @76 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_OBJECTS(0.9285714285714286)"
}

element TRANSITION_ID@75 = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(721,617)",
  name = "TRANSITION_ID"
}

element STATE_ID@74 = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(950,29)",
  name = "STATE_ID"
}

element @73 = erd.LinkConnection {
  pane = "ROLE_ID",
  notNull = "true",
  bounds = null,
  secondAnchor = "@95",
  firstAnchor = "@65"
}

element @72 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_STATES(6.6)"
}

element PROCESS_ID@71 = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(209,204)",
  name = "PROCESS_ID"
}

element @70 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_TRANSITIONS(0.8014705882352942)"
}

element J_OBJECTS = erd.StdTable {
  bounds = null,
  fields = "Name v200 n",
  location = "(249,343)",
  idName = "ID",
  name = "J_OBJECTS",
  idType = "n6"
}

element @68 = erd.LinkConnection {
  pane = "TRANSITION_ID",
  notNull = "true",
  bounds = null,
  secondAnchor = "@108",
  firstAnchor = "@89"
}

element @67 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_OBJECTS_P_OBJECTS(4.50920245398773)"
}

element @66 = erd.StdConnection {
  pane = "INIT_OBJECT",
  notNull = "false",
  bounds = null,
  secondAnchor = "@54",
  firstAnchor = "@61"
}

element @65 = erd.LinkAnchor {
  arrow = "erd.tripleExArrow",
  bounds = null,
  dock = "J_TRANSITIONS_P_ROLES_OWNER(1.0)"
}

element @64 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_OBJECTS(4.0)"
}

element @63 = erd.StdConnection {
  pane = "STATE_ID",
  notNull = "true",
  bounds = null,
  secondAnchor = "@31",
  firstAnchor = "@46"
}

element @62 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_OBJECTS(0.7040816326530612)"
}

element @61 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_STATES(6.8966666666666665)"
}

element @60 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_STATES(6.986666666666666)"
}

element STATE_OBJECT = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(71,296)",
  name = "STATE_OBJECT"
}

element @58 = erd.LinkConnection {
  pane = "STATE_ID@74",
  notNull = "true",
  bounds = null,
  secondAnchor = "@88",
  firstAnchor = "@38"
}

element @57 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "P_ROLES(1.0)"
}

element @56 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_OBJECTS(0.25510204081632654)"
}

element @55 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "P_ROLES(6.983333333333333)"
}

element @54 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_OBJECTS(0.05102040816326531)"
}

element @53 = basic.DescriptionPane {
  bounds = "(722,293,0,0)",
  content = ""
}

element J_STATES_P_ROLES_OWNER = erd.LinkTable {
  bounds = null,
  fields = "Type c1 n",
  location = "(874,81)",
  name = "J_STATES_P_ROLES_OWNER"
}

element J_TRANSITIONS_P_ROLES = erd.LinkTable {
  bounds = null,
  fields = "Type c1 n",
  location = "(843,526)",
  name = "J_TRANSITIONS_P_ROLES"
}

element @50 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_STATES(4.81151832460733)"
}

element @49 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_PROCESSES(2.8833333333333333)"
}

element @48 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_OBJECTS(6.714285714285714)"
}

element STAY_IN_STATE_OBJECT = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(451,241)",
  name = "STAY_IN_STATE_OBJECT"
}

element @46 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_TRANSITIONS(2.5978260869565215)"
}

element @45 = erd.StdConnection {
  pane = "PROCESS_ID",
  notNull = "true",
  bounds = null,
  secondAnchor = "@41",
  firstAnchor = "@60"
}

element @44 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_TRANSITIONS(2.891304347826087)"
}

element @43 = basic.DescriptionPane {
  bounds = "(80,381,0,0)",
  content = ""
}

element P_OBJECT_ID = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(257,603)",
  name = "P_OBJECT_ID"
}

element @41 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_PROCESSES(2.0)"
}

element ERROR_OBJECT = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(138,261)",
  name = "ERROR_OBJECT"
}

element CONDITION_OBJECT = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(464,446)",
  name = "CONDITION_OBJECT"
}

element @38 = erd.LinkAnchor {
  arrow = "erd.tripleExArrow",
  bounds = null,
  dock = "J_STATES_P_ROLES_OWNER(0.6458333333333334)"
}

element @37 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_TRANSITIONS(2.0760869565217392)"
}

element @36 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "P_OBJECTS(2.975806451612903)"
}

element PRESENTATION_OBJECT = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(462,263)",
  name = "PRESENTATION_OBJECT"
}

element @34 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_STATES(6.306666666666667)"
}

element STATE_ID = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(724,484)",
  name = "STATE_ID"
}

element @32 = erd.StdConnection {
  pane = "CONDITION_OBJECT",
  notNull = "false",
  bounds = null,
  secondAnchor = "@64",
  firstAnchor = "@70"
}

element @31 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_STATES(4.172774869109948)"
}

element WAIT_FOR_SUBPR_CONDITION = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(429,197)",
  name = "WAIT_FOR_SUBPR_CONDITION"
}

element TRANSITION_ID = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(727,573)",
  name = "TRANSITION_ID"
}

element @28 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_OBJECTS(2.75)"
}

element @27 = basic.DescriptionPane {
  bounds = "(510,445,0,0)",
  content = ""
}

element WAIT_FOR_SUBPR_OBJECT = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(440,219)",
  name = "WAIT_FOR_SUBPR_OBJECT"
}

element @25 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_STATES(6.456666666666667)"
}

element @24 = erd.StdConnection {
  pane = "WAIT_FOR_SUBPR_CONDITION",
  notNull = "false",
  bounds = null,
  secondAnchor = "@56",
  firstAnchor = "@18"
}

element @23 = erd.StdConnection {
  pane = "PARENT_ID",
  notNull = "true",
  bounds = null,
  secondAnchor = "@55",
  firstAnchor = "@90"
}

element @22 = erd.LinkConnection {
  pane = "ROLE_ID@10",
  notNull = "true",
  bounds = null,
  secondAnchor = "@98",
  firstAnchor = "@102"
}

element @21 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_OBJECTS(0.47959183673469385)"
}

element J_OBJECTS_P_OBJECTS = erd.StdTable {
  bounds = null,
  fields = "Execute_order n12 o",
  location = "(193,473)",
  idName = "ID",
  name = "J_OBJECTS_P_OBJECTS",
  idType = "n6"
}

element @19 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_TRANSITIONS(0.9632352941176471)"
}

element @18 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_STATES(6.75)"
}

element @17 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "P_OBJECTS(0.21641791044776118)"
}

element @16 = erd.StdConnection {
  pane = "P_OBJECT_ID",
  notNull = "true",
  bounds = null,
  secondAnchor = "@36",
  firstAnchor = "@67"
}

element @15 = erd.LinkAnchor {
  arrow = "erd.tripleExArrow",
  bounds = null,
  dock = "J_STATES_P_ROLES_OWNER(4.010416666666667)"
}

element @14 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "J_STATES(2.3666666666666667)"
}

element INIT_OBJECT = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(419,175)",
  name = "INIT_OBJECT"
}

element @12 = erd.LinkAnchor {
  arrow = "erd.tripleExArrow",
  bounds = null,
  dock = "J_TRANSITIONS_P_ROLES_OWNER(6.5)"
}

element J_STATES = erd.StdTable {
  bounds = null,
  fields = "State_nr               n12  n\n" +
           "Text_id                v50  o\n" +
           "Name                   v200 n\n" +
           "Init_param             v500 o\n" +
           "Wait_for_subpr_param   v500 o\n" +
           "Presentation_param     v500 o\n" +
           "Stay_in_state_param    v500 o\n" +
           "Page_title             v200 o\n" +
           "Info_str               v200 o\n" +
           "Warning_str            v200 o\n" +
           "Not_protected          c1   o\n" +
           "Process_first_state    c1   o\n" +
           "Subprocess_first_state c1   o\n" +
           "Process_last_state     c1   o\n" +
           "Archive_state          c1   o\n" +
           "Starting_subpr_states  v200 o\n" +
           "Position_x             n12  o\n" +
           "Position_y             n12  o",
  location = "(616,9)",
  idName = "ID",
  name = "J_STATES",
  idType = "n6"
}

element ROLE_ID@10 = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(971,282)",
  name = "ROLE_ID"
}

element @9 = erd.LinkConnection {
  pane = "ROLE_ID@7",
  notNull = "true",
  bounds = null,
  secondAnchor = "@57",
  firstAnchor = "@15"
}

element @8 = erd.LinkConnection {
  pane = "TRANSITION_ID@75",
  notNull = "true",
  bounds = null,
  secondAnchor = "@44",
  firstAnchor = "@12"
}

element ROLE_ID@7 = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(1079,217)",
  name = "ROLE_ID"
}

element ROLE_ID = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(1075,498)",
  name = "ROLE_ID"
}

element @5 = erd.LinkConnection {
  pane = "ROLE_ID@81",
  notNull = "true",
  bounds = null,
  secondAnchor = "@106",
  firstAnchor = "@105"
}

element PROCESS_ID = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(393,28)",
  name = "PROCESS_ID"
}

element P_OBJECTS = erd.StdTable {
  bounds = null,
  fields = "P_tree_type_id n6    n\n" +
           "Name           v150  n\n" +
           "Tag            clob  o\n" +
           "Created        d     n\n" +
           "Last_updated   d     n\n" +
           "Compression    c1    o\n" +
           "Description    v4000 o",
  location = "(14,489)",
  idName = "ID",
  name = "P_OBJECTS",
  idType = "n6"
}

element @2 = erd.StdAnchor {
  arrow = "erd.tripleArrow",
  bounds = null,
  dock = "J_OBJECTS_P_OBJECTS(0.4723926380368098)"
}

element PARENT_ID = erd.ConnectionPane {
  bounds = null,
  visible = "true",
  cascade = "false",
  location = "(871,353)",
  name = "PARENT_ID"
}

element @0 = erd.StdAnchor {
  arrow = "erd.lineArrow",
  bounds = null,
  dock = "P_OBJECTS(0.04477611940298507)"
}
  


Personal tools