[JBoss jBPM] - Re:
by kukeltje
anonymous wrote : Let's take an example, I have an "Approval task node" that handles the approval from two departments: HR and Accounting. When I design this by using the GPD, I will create two Tasks and at runtime one Task instance will be created for each Task.
|
That is indeed an option
anonymous wrote : Now if I want to do this at runtime by using a rule file (or a delegation class), one way would be to create a default Task definition for this node when designing my process and then at runtime my rules will create two Task instances (one for HR and one for Accounting) for the same Task definition.
Correct, again, an option
anonymous wrote :
| For the same idea, which is 2 Tasks one for HR and one for Accounting (at least in the BA point of view) I'm not using the same objects of my domain model to implement it. I'm just wondering if this is ok.... ? Yes, the implementation works fine in both cases but what if one day I'm stuck because I found out I can do some specific reporting in one case but not in the other case since the implementation is different ?
Then you have the same api at you disposal and you can 'migrate' the tasks or the complete processes by deploying a new processdefinition (or changing the existing one as you found out is also possible) and place the part of the tokens in the new tasknodes. Since you obviously want to minimize that and have clear e.g. swimlanes, make sure in advance (design time) things are split.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215551#4215551
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215551
15 years, 10 months
[JBoss jBPM] - Re:
by AlClientView
I agree it's easy to create task instances at runtime and that's the way I'm using when the implementation requires such feature. But it's a bit different... I was talking about Task (not task instance). Also the default implementation of the Task instance is that its properties are copied from the Task definition when it is created... I know we don't have to follow the default implementation, JBPM is flexible enough for that. But my point is more about the logic of domain model.
Let's take an example, I have an "Approval task node" that handles the approval from two departments: HR and Accounting. When I design this by using the GPD, I will create two Tasks and at runtime one Task instance will be created for each Task.
Now if I want to do this at runtime by using a rule file (or a delegation class), one way would be to create a default Task definition for this node when designing my process and then at runtime my rules will create two Task instances (one for HR and one for Accounting) for the same Task definition.
For the same idea, which is 2 Tasks one for HR and one for Accounting (at least in the BA point of view) I'm not using the same objects of my domain model to implement it. I'm just wondering if this is ok.... ? Yes, the implementation works fine in both cases but what if one day I'm stuck because I found out I can do some specific reporting in one case but not in the other case since the implementation is different ?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215546#4215546
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215546
15 years, 10 months
[JBoss AOP] - Re: Log Messages Not Showing with Compile Time Weaving
by stale.pedersen@jboss.org
hi, please take a look at the pom.xml file in the method-execution example provided in the distro; jboss-aop-2.0.0.GA/docs/aspect-framework/examples/method-execution/pom.xml. there you'll see an example of a 2-step process where the classes are compile time woven, and then executed with the jboss-aop.xml referenced in the run step.
<plugin>
| <groupId>org.jboss.maven.plugins</groupId>
| <artifactId>maven-jbossaop-plugin</artifactId>
| <version>${jboss.aop.plugin.version}</version>
| <executions>
| <execution>
| <id>compile</id>
| <configuration>
| <aoppaths>
| <aoppath>jboss-aop.xml</aoppath>
| </aoppaths>
| </configuration>
| <goals>
| <goal>compile</goal>
| </goals>
| </execution>
| <execution>
| <id>run</id>
| <configuration>
| <aoppaths>
| <aoppath>jboss-aop.xml</aoppath>
| </aoppaths>
| <executable>Driver</executable>
| </configuration>
| <goals>
| <goal>run</goal>
| </goals>
| </execution>
| </executions>
| </plugin>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215539#4215539
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215539
15 years, 10 months
[EJB 3.0] - Enumtransfer between entities, one without EnumType.STRING
by cdebergh
Hello,
I have a application running on Jboss AS 4.2.2 that uses entities with enum attributes. I noticed an occurrence while stepping through a method that got me curious. After a get/set of an enum value from one entity to the other, the object being set contained the same null value it previously held. No exception was throw nor debug log printed. The entity getting from had an annotation for that field that stated @Enumerated(EnumType.STRING) while the entity being set did not have this annotation. However, as expected, an exception was encountered when the entity, that was set, was committed to the database.
I don't understand why the value was not transferred, or at least why no exception was thrown or error logged.
Here is some code to illustrate:
|
| public enum ColorEnum {
| BLONDE("Blonde"),
| RED("Red"),
| TAN("Tan");
| }
|
| @Entity
| @Table(name = "DOG")
| public class Dog {
| @Column(name = "COAT_COLOR"
| @Enumerated(EnumType.STRING)
| ColorEnum coatColor;
|
| public void setCoatColor(ColorEnum coatColor) {
| this.coatColor = coatColor;
| }
|
| public ColorEnumgetCoatColor() { return this.coatColor; }
| }
|
| @Entity
| @Table(name = "CAT")
| public class Cat {
| @Column(name = "COAT_COLOR"
| ColorEnum coatColor;
|
| public void setCoatColor(ColorEnum coatColor) {
| this.coatColor = coatColor;
| }
|
| public ColorEnumgetCoatColor() { return this.coatColor; }
| }
|
|
| public void newCatWithDogCoat() {
| ...
| // cat.getCoatColor() returns null
| // dog.getCoatColor() returns red
| cat.setCoatColor(dog.getCoatColor());
| ...
| // cat.getCoatColor() still returns null (no errors/exceptions)
| }
|
After adding @Enumerated(EnumType.STRING) to the Cat class, cat.getCoatColor() returns red
So why are there no exceptions/errors until it fails to save to the database?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215533#4215533
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215533
15 years, 10 months
[JBoss Tools (users)] - Hibernate reverse engineering errors
by bdlink
For the last couple of years, I have been trying hibernate reverse engineering on a test database with seam-gen or JBT. It is improving, but does not work out of the box. (work, in terms of generating examples that will compile). I think all of the issues are in JIRA.
At the moment I am trying to get the hibernate.reveng.xml to customize the reverse engineering so it will be as desired. I have read the Hibernate Tools Reference Guide version 3.2.4.CR2 from the JBoss Tools CR2 Doc site, as well as the one at Hibernate.org (which is quite similar). Neither has a detailed reference on how to specify the reverse engineering of relationships. The hibernate reverse engineering editor (part of Hibernate tools) does not seem to deal with this aspect, so I have been trying to use the source window to add <foreign-key> elements appropriately.
I get the following error when I try to generate the entities:
Exception while generating code
| Reason:
| org.hibernate.MappingException: Could not configure overrides from file: C:\apps\workspace3.4.2\infosys-ejb\.settings\hibernate.reveng.xml
| Could not configure overrides from file: C:\apps\workspace3.4.2\infosys-ejb\.settings\hibernate.reveng.xml
| org.hibernate.MappingException: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
| java.lang.StringIndexOutOfBoundsException: String index out of range: 0
| org.hibernate.MappingException: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
| java.lang.StringIndexOutOfBoundsException: String index out of range: 0
| java.lang.StringIndexOutOfBoundsException: String index out of range: 0
| String index out of range: 0
|
This is using 3.0.x branch nightly on top of eclipse 3.4.2
Unfortunately, this error does not help me figure out what I did wrong.
I am currently searching for the DTD, but if there is some more detailed documentation I have not found, that would be appreciated.
A useful addition to the documentation would be examples of how to reverse engineer:
1. OneToOne unidirectional
2. OneToOne bidirectional
3. OneToMany unidirectional
4. ManyToOne unidirectional
5. OneToMany bidirectional
6. ManyToMany unidirectional
7. ManyToMany bidirectional
How should one reverse engineer JoinTable mapping in all of the above, as well as foreign key mapping, and primary key join columns where those are appropriate?
Is it possible to specify how to handle composite primary keys (@IdClass vs. @EmbeddedId)?
Also, how to specify the type of collection (Collection, Set, List, Map)?
Also wonderful would be how to reverse engineer inheritance strategies (SINGLE_TABLE, TABLE_PER_CLASS, JOINED)
Finally, is it possible to reverse engineer an entity with properties from multiple tables (@SecondaryTable)?
The reason for all of these questions, is that there is the large ripple effect to generated artifacts when the relationships are not as desired. The current default seems to aggressively add reverse engineered relationships (even in the absence of foreign key constraints in the DB), so knowing how to eliminate undesired ones is also important.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215530#4215530
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215530
15 years, 10 months