ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » Creation of automatic workitems

Post new topic  Reply to topic
 Creation of automatic workitems « View previous topic :: View next topic » 
Author Message
sridhar
PostPosted: Mon Oct 20, 2003 1:55 pm    Post subject: Creation of automatic workitems Reply with quote

Newbie

Joined: 11 Jun 2003
Posts: 8

Guys,
I want to create workitems automatically when a user logs-in or when the refresh button is clicked?

Could anyone give suggestions or code examples.

I was thinking to implement this in Listviewer.jsp but dont know how?


Thanks in advance for the help
Sridhar
_________________
sridhar
Back to top
View user's profile Send private message
Ratan
PostPosted: Mon Oct 20, 2003 2:27 pm    Post subject: Reply with quote

Grand Master

Joined: 18 Jul 2002
Posts: 1245

Workflow Creates Workitems, You can only display them.
_________________
-Ratan
Back to top
View user's profile Send private message Send e-mail
sridhar
PostPosted: Tue Oct 21, 2003 6:27 am    Post subject: Reply with quote

Newbie

Joined: 11 Jun 2003
Posts: 8

Actually, let me put the question in more detail -

I have a process where my Java program gets records from a Database table and for each record Workflow should create a workitem from the template(which I already created in buidltime and exported to webclient).

So when a person logs-in or hits refresh button on the webclient, he should get created and started process instances for each record.

For doing this I am writing a Java program which gets records from Database and for each record I will create and start the process instance but I dont know how I would display them in the webclient when the user logs-in or hits refresh button.

Any help is appreciated and if you have any other idea or suggestion with code examples, please let me know.

Thanks
Sridhar
Back to top
View user's profile Send private message
madhu
PostPosted: Tue Oct 21, 2003 6:53 am    Post subject: Reply with quote

Novice

Joined: 09 Jul 2003
Posts: 22

cross check the Output Data Container values you giving to start the new Process Instance.

--madhu
Back to top
View user's profile Send private message
sridhar
PostPosted: Tue Oct 21, 2003 7:07 am    Post subject: Reply with quote

Newbie

Joined: 11 Jun 2003
Posts: 8

But my question is - how do I display the workitems automatically, when the user logs-in or hits the refeh button
_________________
sridhar
Back to top
View user's profile Send private message
madhu
PostPosted: Tue Oct 21, 2003 7:20 am    Post subject: Reply with quote

Novice

Joined: 09 Jul 2003
Posts: 22

If you start a Process Instance, all the workitems (pending) which are assigned to the logged-is User will be displayed automatically (or by refresh)on your webclient screen.
_________________
madhu
Back to top
View user's profile Send private message
Ratan
PostPosted: Tue Oct 21, 2003 8:44 am    Post subject: Reply with quote

Grand Master

Joined: 18 Jul 2002
Posts: 1245

Quote:
I have a process where my Java program gets records from a Database table and for each record Workflow should create a workitem from the template(which I already created in buidltime and exported to webclient).

I believe you are trying to say "Workflow should create a Process Instance" instead of "Workflow should create a Workitem".

"which I already created in buildtime and exported to webclient"

I you are using the same MQ Workflow Software as everyone else here, we import FDL into Workflow Server (workflow runtime DB) not Webclient. Client is just an interface through which you view Workitems and execute them.


Quote:

So when a person logs-in or hits refresh button on the webclient, he should get created and started process instances for each record.


I did not understand what you meant or trying to do here.

Workitems are created according to Staff Assignments that you do in buildtime.
_________________
-Ratan
Back to top
View user's profile Send private message Send e-mail
sridhar
PostPosted: Tue Oct 21, 2003 12:22 pm    Post subject: Reply with quote

Newbie

Joined: 11 Jun 2003
Posts: 8

Yes , I am using the same software as everybody else.
I have imported the buidltime using fmcibie and I am using web client as my runtime client instead of the thick client.

What I am trying to do here is - when a user logs-in, he should be able to see all the new process instance activities started on their worklist automatically.

So , usually, I think everybody does manually create and start instances by clicking on the start instance (or checkout workitem button) but my requirement is that, as soon as the database gets a record , it should be created and started as process instance in any user that logs in to the workflow application.

Thanks
Sridhar
Back to top
View user's profile Send private message
Ratan
PostPosted: Tue Oct 21, 2003 12:34 pm    Post subject: Reply with quote

Grand Master

Joined: 18 Jul 2002
Posts: 1245

I think you are getting yourself confused between Process Instance and Workitems.

You create and Start a Process Instance not a WORKITEM.

When you create and start a Process Instance, Activity Workitems will be automatically created (If they are designated as manual and a user is assigned to them).

Quote:
So , usually, I think everybody does manually create and start instances by clicking on the start instance (or checkout workitem button)

You are talking about 2 different things here.

How to create and start a Process Instance is up to your requirements. There are two ways of Creating and Starting a Process Instance. 1) Using the MQ Workflow API call, 2) using XML Interface.

I believe this is what you are asking for:
"When a User logs in all his workitems should be started automatically".
I dont understand the usage of Workitems if there is such a requirements (you can aswell use automatic Activities), but to acheive this all you need to do is query users Workitems (API call : queryWorkItems(,,)) get hold of each workitem and start them (some api call).
_________________
-Ratan
Back to top
View user's profile Send private message Send e-mail
sridhar
PostPosted: Thu Oct 23, 2003 6:25 am    Post subject: Reply with quote

Newbie

Joined: 11 Jun 2003
Posts: 8

I weill try again to re-phrase the question -

for each record getting inserted into a table, I should create and start a process instance with populating the data into its input container.

The above part I am doing it through some Java codeby create and starting a process instance for each row getting inserted into the table by other application

But the problem that I have is -

When any user logs-in or hits refresh button in the web client , he should see the new process instances on the worklist, so whenever some new records are inserted into the table and any user logs-in or hits refresh button, there should be some mechanism that should trigger the Java program which gets the Database record and creates and starts the process instance and displays them on the user's worklist.


I would really appreciate any help on this.

Thanks
Sridhar
Back to top
View user's profile Send private message
vennela
PostPosted: Thu Oct 23, 2003 6:57 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Is there any reason why don't want to start the process instances as soon as a record is inserted into the database and wait until the user logs on.

You can design your application this way. Set a database trigger so that whenever a record is inserted, an app would be invoked. Now, you say that you already have the program to create and start a process instance. Having done this, if a user logs on he will have all that you think he should have.

If you still want to do what you are intending to do, I think there are a lot of questions to be answered.
1. Why should a process instance be not created until a user logs on or hits refresh (though a record has been inserted a while ago and the user has not logged on).
2. If there are many users and many newly inserted records, how would you determine which user login/refresh action should process which newly inserted records.
3. If there are more than one user authorized for a particular process template, how would you determine whether or not process instances are already created by some other users logon/refresh action.

I feel that is too much trouble to go through while you have a straight dumb procedure to follow.
What you are doing can be done in simple three steps.
1. Setup a DB trigger for insert.
2. Write an app that is invoked by the database trigger, to transform the record passed to the app by the DB trigger, into an XML message and use it to start a processs instance
3. Users refresh/login, they will be seeing the newly created instances.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sridhar
PostPosted: Thu Oct 23, 2003 9:50 am    Post subject: Reply with quote

Newbie

Joined: 11 Jun 2003
Posts: 8

1) Yes, as soon as a record is entered into the table, the process instance could be created and started.
2)Even though there are many users, only one user (like admin) will have own the process instance.

If you are saying write trigger on DB and when a record inserted and write an app - how could u invoke an app in the trigger and how and what needs to be done in the app?

Could you please give more details.
The reason, I designed it like this is because the way we have written the systems suits best this way. anyway if you could share more details with code examples that would be great

Thanks
Sridhar
Back to top
View user's profile Send private message
vennela
PostPosted: Thu Oct 23, 2003 10:58 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

I am not a Database person, so I can't really give you info on how to setup a database trigger. But I can tell you this.
On most of the popular relational databases (DB2, Oracle, etc), you can setup triggers for events like Insert, Delete, Update etc. While setting up the trigger, you will have to give which application (shell script, batch file or CL program, executable etc) to invoke. This app that you specify to invoke, will be invoked by the database, by passing the application an argument called trigger buffer. This trigger buffer will contain the information like table changed, whether it is an insert or a delete, what the old record looked like(if it's an update or a delete), what the new record is, what the length of the record is etc.

I have done this but for a different pupose. On a DB2 Database on iSeries, a DB trigger was setup to trigger a CL program. The CL program would call a C++ app to parse the trigger buffer, transform the contents of the records into an XML message, and then PUT to an MQ Queue.

-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
workflowdude
PostPosted: Mon Jan 19, 2004 4:45 pm    Post subject: Reply with quote

Novice

Joined: 17 Nov 2003
Posts: 24
Location: US

we have a similar requirement. Now I belive some program on the application side is inserting this new record in the database. if this is the case, this program can write a UPES message (using XML interface) to the workflow input queue directly. You can createandStartInstance using XML interface.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » Creation of automatic workitems
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.