Maximo Wire - The IBM Maximo Help & Discussion Forum
May 22, 2012, 11:48:49 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to Maximo Wire, the IBM Maximo help forum. Feel free to register and ask any Maximo related questions you like.
 
  Home Help Search Login Register  
*
Pages: [1]   Go Down
  Print  
Author Topic: Automating WorkFlow initiation  (Read 1849 times)
0 Members and 2 Guests are viewing this topic.
Akshay Patil
Newbie
*

Karma: 0
Posts: 4


View Profile
« on: March 15, 2011, 08:56:16 am »

Hi,

How can I initiate workflows automatically right after generating new workorders?
Any documentation or code templates will help?

Thanks,
Akshay
Logged
Ethen
Global Moderator
Sr. Member
*****

Karma: 16
Posts: 303



View Profile WWW
« Reply #1 on: March 15, 2011, 12:05:52 pm »

Set the workflow as auto initiate from select action.
Logged

regards,

Ethen...
Akshay Patil
Newbie
*

Karma: 0
Posts: 4


View Profile
« Reply #2 on: March 15, 2011, 01:24:14 pm »

Sorry for being so brief...

The problem Im facing is that I've written the custom code that generates the workorders successfully according to the given meter readings but I cannot find any documentation on how to put that generated workorder into workflow through code and not through Maximo application.

BTW ,
Im using Maximo 5.2

Thanks for the reply!!
Logged
Ethen
Global Moderator
Sr. Member
*****

Karma: 16
Posts: 303



View Profile WWW
« Reply #3 on: March 15, 2011, 07:15:01 pm »

Oh.. Dont know about Maximo 5.2 but in Maximo 7 it can be initiated through coding.
Logged

regards,

Ethen...
Ethen
Global Moderator
Sr. Member
*****

Karma: 16
Posts: 303



View Profile WWW
« Reply #4 on: March 15, 2011, 07:20:28 pm »

a code sample..  you might want to explore classed in 5.2

import psdi.workflow.WorkFlowServiceRemote;
 public class woext extends wo{

public int SAVE()
{
MXServer mxs;
try
{
mxs = MXServer.getMXServer();
WorkFlowServiceRemote wsrmt = (WorkFlowServiceRemote)mxs.lookup("WORKFLOW");
 
WOActivityRemote mbo = (WOActivityRemote)getMbo();
wsrmt.initiateWorkflow("yourworkflow", mbo);
}
catch (Exception e)
{
e.printStackTrace();
}
return 1;
}
}
Logged

regards,

Ethen...
Akshay Patil
Newbie
*

Karma: 0
Posts: 4


View Profile
« Reply #5 on: March 16, 2011, 12:24:44 pm »

Thanks for the code but it is not working along with its tried mofications . It cant seem to find WOActivityRemote  class.
I too tried searching it manually but cant find it .
Moreover the program cant seem to find the overload for initiateworkflow that takes am MBO as an argument

wsrmt.initiateWorkflow("yourworkflow", mbo);

I am new to maximo ,maybe Im missing something.

Any documentations on initiating workflows in maximo 5.2?

Thanks for the help!!!!
 
Logged
Ethen
Global Moderator
Sr. Member
*****

Karma: 16
Posts: 303



View Profile WWW
« Reply #6 on: March 17, 2011, 07:08:08 pm »

well the code sample was for maximo 7.
you might want to explore some workflow classes in 5.2
Logged

regards,

Ethen...
maurogrz
Global Moderator
Full Member
*****

Karma: 14
Posts: 111



View Profile Email
« Reply #7 on: March 18, 2011, 01:15:46 pm »

Hi,
I have an old v5.2 crontask class that start workflow of a new created workrder.
the statement is simple:

newWorkorder.initiateWorkflow("automatic WO from backend");

where newWorkorder is my newly create WO and "automatic WO from backend" is the memo I wanto to set for this wokflow step.

regards,
Mauro
Logged
Ethen
Global Moderator
Sr. Member
*****

Karma: 16
Posts: 303



View Profile WWW
« Reply #8 on: March 21, 2011, 12:11:49 pm »

Hi,
I have an old v5.2 crontask class that start workflow of a new created workrder.
the statement is simple:

newWorkorder.initiateWorkflow("automatic WO from backend");

where newWorkorder is my newly create WO and "automatic WO from backend" is the memo I wanto to set for this wokflow step.

regards,
Mauro

hope it solves the problem. But I have one ques. If workorder has more then 1 workorders in active status, how will program know which one to start. I dont see any arguements with regards to the workflow instances .
Logged

regards,

Ethen...
maurogrz
Global Moderator
Full Member
*****

Karma: 14
Posts: 111



View Profile Email
« Reply #9 on: March 21, 2011, 01:31:10 pm »

in v5.2 there was only one active workflow for specific object (WORKFLOW, SR, and so on)


in v7 I use another statement:

((WorkFlowServiceRemote)MXServer.getMXServer().lookup("WORKFLOW")).initiateWorkflow("MYWORKFLOWPROCESS", newWorkorder);

...where MYWORKFLOWPROCESS is the name of the workflow I want to start.

Logged
Akshay Patil
Newbie
*

Karma: 0
Posts: 4


View Profile
« Reply #10 on: March 22, 2011, 11:18:23 am »

Hi,

The statement

newWorkorder.initiateWorkflow("automatic WO from backend");

Initiates workflow of the newly created workorders only and this method is only available if the class is inherited from WFMbo.
Currently Im generating orkorders using MEASUREPOINT Mbo which has a different inheritance heirarchy.

measurepointremote.generateWorkOrder(measureDate,"Generated by CM Cron Task",true);

Typecasting is creating problems and also I tried to introduce WFMbo in the inheritance heirarchy but in vain.
 
Logged
Ethen
Global Moderator
Sr. Member
*****

Karma: 16
Posts: 303



View Profile WWW
« Reply #11 on: March 22, 2011, 12:06:07 pm »

why dont you extend both d classes and create a custom method which initiates the workflow.
and call it from the other class.
Logged

regards,

Ethen...
maurogrz
Global Moderator
Full Member
*****

Karma: 14
Posts: 111



View Profile Email
« Reply #12 on: March 22, 2011, 03:19:45 pm »

....or a piece of code that search for the newly created WO and start workflow
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Recent

TinyPortal v1.0 beta 4 © Bloc
Powered by MySQL Powered by PHP Powered by SMF 1.1.15 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!