The corresponding variable corresponding to the non-String type defined by the user, JBPM is first converted into a binary Object stream, and then converted into a String type in the database, the process of taking variables is reversed. Since the conversion into String involves the encoding format, such as GBK, ISO, etc., the encoding format involves many of the operating system, database, JVM, etc., JBPM has not yet solved this problem, so when using non-String type variables JBPM will be wrong. This problem TOM (JBPM founder) is being resolved. This problem seems to be better to press the variable to press binary storage, so that it will not involve the problem of encoding format. Another method is to use unified encoding formats, ORG.JBPM.DELEGATION.SERIALIZERSERIALIZABLELEGAALIZER are as follows: Public Class Serializer {
Public String Serialize (Object Object) {String Serialized = NULL;
if (object! = null) {if (! (object instanceof Serializable)) {throw new IllegalArgumentException ( "object '" object "' (" object.getClass (). getName () ") can not be serialized with " This.getClass (). Getname ());
Try {BYTEARRAYOUTPUTSTREAM baos = new byteArrayoutputStream (); ObjectOutputStream OOS = New ObjectOutputStream (baos); Oos.WriteObject (Object); OOS.Flush (); baos.flush ();
Serialized = baos.toTOString ("ISO-8859-1"); // Modify
} catch (ioException e) {E.PrintStackTrace (); throw new runtimeException ("couldnown't serialize state definition);}}
Return serialized;}
Public Object Deserialize (String text) {Object Object = NULL;
if (text = null!) {try {ByteArrayInputStream bais = new ByteArrayInputStream (text getBytes ( "ISO-8859-1").); // modify ObjectInputStream ois = new ObjectInputStream (bais); object = ois.readObject (); } catCH (Exception E) {E.PrintStackTrace (); throw new runtimeException ("couldnown't deserialize object from infutstream);}} Return Object;}
}