AnsweredAssumed Answered

Object in workflow

Question asked by alexskinner on Jul 31, 2012
Latest reply on Aug 1, 2012 by alexskinner
Hi all,

Apologies in advanced as I am a complete newbie to activiti. I have been trying to read through the user guide over the last few weeks trying to teach myself how it works etc. I'd previously only really done some java programming so forgive me if my questions seem really easy to you. :p

Basically I have created an object called request with the relevant methods. Here is a snippet:

@Entity(name="request")
public class Request {

   @Id
   @GeneratedValue(strategy=GenerationType.IDENTITY)
   private Long id;   
   
   @OneToOne(cascade={CascadeType.DETACH})
   @JoinColumn(name="softwareapplicationid", nullable=false)
   private Application softwareApplication;
   
   public Long getId() {
      return id;
   }

   public void setId(Long id) {
      this.id = id;
   }

   public Application getSoftwareApplication() {
      return softwareApplication;
   }

   public void setSoftwareApplication(Application softwareApplication) {
      this.softwareApplication = softwareApplication;
   }

I have also created a workflow. I would like to be able to call certain request fields into the workflow.

For example, within the request object, there is a pointer to another object (softwareApplication) which contains a getter 'isRequiresApproval', returning a boolean and I would like to be able to use the value in an exclusive gateway.

Is it easier to pass in a request object when the workflow is started or just reference the request class.

Eventually an instance of the request object will be created by reading the data from a postgresql database.

I hope I've given enough information but please let me know if I can help any more. As I said I am a very new to this. I'm in my 2nd year of Comp Sci degree but currently on an internship over the summer and trying to impress the guys in the office so any help will be greatly appreciated! :)

Thank you in advanced for taking the time to read this!

Outcomes