6 Replies Latest reply on Sep 8, 2006 2:17 AM by stibrian

    how to save data to my existed table but not jbpm_variablein

    whk1007

      I am using jbpm3.0. in process definition file, the code like:

      <controller>
       <variable name="item"/>
       <variable name="quantity"/>
       <variable name="address"/>
       </controller>

      these data are saved to table jbpm_variableinstance, but I donn't want to use this in my application, because we already have customizd form to collect information of user entered. I want to know how to make relations between jbpm table with our existed table such as ppp_info, how to save form data to ppp_info and also keep the relations with jbpm_variableinstance and how to retrieve the data from ppp_info with a taskInstanceId?

        • 1. Re: how to save data to my existed table but not jbpm_variab
          kukeltje

          build your own ui, refere to your own data by storing e.g. a reference in the jbpm tables or the other way around, store a reference to the process instances in your own table

          • 2. Re: how to save data to my existed table but not jbpm_variab
            jbpmndc

            It's best to decouple the bpm data from your domain data. I prefer to use jBPM or any BPM engine variables for process management and process management only. I hold domain related data in separate tables.

            • 3. Re: how to save data to my existed table but not jbpm_variab
              stibrian

              I agree that you don't want to be using the jBPM tables in your domain, I'd encourage you to look at either writing converters OR switching to jBPM 3.1.

              You can write converters in either version, allowing you to reference full domain objects in the process (including in scripts via the context) while storing said objects in your own domain tables.

              In 3.1 this is transparent and quite wonderful assuming your object is "hibernatable". That is, if the hibernate configuration tells the engine that it knows how to persist your type, you can use it as a variable in your process and jBPM via hibernate will handle persisting the object and loading it when you reference it. I'm pretty sure there are some boundaries related to the use of complex keys etc, but for most things with a "standard" single field primary key jBPM will handle this for you.

              That said, I'm not aware of this feature in 3.0 - please correct me if I'm wrong, but 3.0 IIRC wanted you to supply converters (tiny little things really), but 3.1 just makes things cleaner.

              Short of that - the standard jBPM<-> UI responses apply - write one :)

              • 4. Re: how to save data to my existed table but not jbpm_variab
                stibrian

                yeah, so everything was working fine with the unit tests (transactions are not being simulated perfectly apparently), as in the actual web app there is a problem with the jBPM perfectly recognizing the "hibernateable" types and doing the right thing.

                Long story short, my domain class is serializable, so there is a problem as hibernate updates the serialized instance, not the instance in the domain model. As I work through this I'll post an update... seee the reference guide 10.6 for more information... I'm working with customizing the variable instance mapping to get the engine to correctly recognize my type and "do the right thing", where the "right thing" is what is intuitive...

                more on this one later - and yes, I'm going to dig into the source to figure out what's going on.

                That is one thing about jBPM - the source is nice and clean - easy to get set up in eclipse and get a debugger going quite quickly so it's easy to figure out what's going on at the very least :)

                • 5. Re: how to save data to my existed table but not jbpm_variab
                  whk1007

                  Can anybody give me a sample code to do this?

                  • 6. Re: how to save data to my existed table but not jbpm_variab
                    stibrian