Variable type processing of jbpm3

Source: Internet
Author: User

We know that the variable in the process definition is persistent, for example, it may be stored in the database. How can we deal with the type?
Let's take a look at the jbpm3 method:
Jbpm3 defines its own class jbpmtype, which has two attributes:
1) public class variableinstanceclass = NULL;
It indicates that the variable corresponds to the engine type.
2) Public converter = NULL;
It indicates the converter between the slave engine type and the Java type.

During processing, the engine first searches for the jbpm. type. properties file in the class path. If not
Search in the org/jbpm/DB/hibernate/jbpm. types. properties file. The file is edited as follows:
# Each line contains 2 or 3 class names (transformer-class is optional) separated by a space:
# Variable-class <space> transformer-class <space> variableinstance-class
# Or
# Variable-class <space> variableinstance-class

### Stored in a text-field in the database ###
Java. Lang. String org.jbpm.context.exe. variableinstance. stringinstance
Java. Lang. boolean org.jbpm.context.exe. converter. booleantostringconverter org.jbpm.context.exe. variableinstance. stringinstance
Java. Lang. Character org.jbpm.context.exe. converter. charactertostringconverter org.jbpm.context.exe. variableinstance. stringinstance
Java. Lang. Float org.jbpm.context.exe. converter. floattostringconverter org.jbpm.context.exe. variableinstance. stringinstance
Java. Lang. Double org.jbpm.context.exe. converter. doubletostringconverter org.jbpm.context.exe. variableinstance. stringinstance
Java. Io. serializable org.jbpm.context.exe. converter. serializabletostringconverter org.jbpm.context.exe. variableinstance. stringinstance

### Stored in a number-field in the database ###
Java. Lang. Long org.jbpm.context.exe. variableinstance. longinstance
Java. Lang. byte org.jbpm.context.exe. converter. bytetolongconverter org.jbpm.context.exe. variableinstance. longinstance
Java. Lang. Short org.jbpm.context.exe. converter. Convert tolongconverter org.jbpm.context.exe. variableinstance. longinstance
Java. Lang. Integer org.jbpm.context.exe. converter. integertolongconverter org.jbpm.context.exe. variableinstance. longinstance
Java. util. Date org.jbpm.context.exe. converter. datetolongconverter org.jbpm.context.exe. variableinstance. longinstance
The first column indicates the Java type, the third column indicates the type in the engine, and the middle column indicates the definition of the converter.

The concept of a converter is actually very simple. For example, if the Boolean value is true, it is a Java. Lang. boolean type in the program.
But in the jbpm3 database, it is a string "T" or "F", then a converter is required.
Org.jbpm.context.exe. converter. booleantostringconverter to convert.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.