Wednesday, March 12, 2008

Forcing Oracle BPEL recompilation on the server

Remove /bpel/domains//tmp/.bpel_/BPEL-INF/classes
when Oracle AS is down. When the application server comes up, it recompiles the deployed process.

Remove .../BPEL-INF/src and .../BPEL-INF/classes to force regeneration and recompilation.

This is applicable for Oracle AS 10.1.3.3.1.

Struts validation - validwhen - 3rd degree of complexity

Let us say you have a form in which a field is a required field(mandatory) based on selections of two other fields in the form, then it gets really tough to get the rules right.


Here is an example.
- An employee is transferred to a new organization in the company, with or without a promotion(optional).
- Let us say the same screen also allows promotions to be done without any org transfer.
- The third field, namely "myfield", is an optional field most of the time, except when either or both of the above actions are done at the same time.



Validation Rules in words.
- Field 1 (neworg) -> If "neworg" value is non-null and not same as "prevorg", then "myfield" is required.

- Field 2 (newgrade) -> If "newgrade" is equal to 'A', then "myfield" is required, otherwise not.

- Field 3 (myfield) -> Required if either of the above condition is valid.

Let us say this form also has another field namely "prevorg" to hold the user's original org name.


<field property="myfield" depends="validwhen" >
....
<var-value>
(
  (
    (
      (neworg == prevorg) or (neworg == null)
    ) and (newgrade != 'A')
  ) or (*this* != null)
)
</var-value>
...

Note carefully that negative of written rules is realized as the "var-value".

Launching Cygwin from Cygwin

Have you wondered how to launch a cygwin shell in a window of its own from a cygwin shell?

Set this alias in your .bashrc.

alias cygwin='cmd /C start c:/cygwin/cygwin.bat'

If you have customized cygwin.bat as mentioned in http://cygwin.com/ml/cygwin/2004-03/msg00006.html, then the following works better.

alias cygwin='cmd /C start c:/cygwin/cygwin.bat "$PWD"'


Replace c:/cygwin in the above aliases with your installation specific location.