JBoss Community

Re: jBPM-console - Oracle - start process

created by Aadav N in jBPM - View the full discussion

Hi bpmn2user,

 

To support the analysis, the code which I run as (web-app). Yes its the sample webapp you shared long back.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

if

 

(action.equals("CreateProcess"

)) {

 

UserTransaction ut = (UserTransaction)

new InitialContext().lookup( "java:comp/UserTransaction"

);

ut.begin();

StatefulKnowledgeSession ksession = JbpmAPIUtil.getSession();

 

Map<String, Object> params =

new

HashMap<String, Object>();

params.put(

"priority", "High"

);

params.put(

"modelNumber", "123"

);

params.put(

"quantity", "66"

);

 

 

ksession.startProcess(

"com.sample.bpmn.user"

,params);

 

ksession.fireAllRules();

ut.commit();

 

request.setAttribute(

"message", "Process Created!"

);

 

TaskClient client =

new TaskClient(new MinaTaskClientConnector("mina", new

MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));

 

try

{

 

client.connect(

"127.0.0.1"

, 9123);

BlockingTaskSummaryResponseHandler summaryHandler =

new

BlockingTaskSummaryResponseHandler();

client.getTasksAssignedAsPotentialOwner(

"mina", "en-UK"

, summaryHandler);

List<TaskSummary> tasks = summaryHandler.getResults();

TaskSummary task =

null

;

 

for

(TaskSummary taskSummary : tasks)

{

System.

out.println(taskSummary.getId() + " : "

+ taskSummary.getName()); task = taskSummary;

}

}

 

catch

(Exception e)

{

 

}

 

RequestDispatcher rD = request.getRequestDispatcher(

"adminuser.jsp"

);

rD.forward(request, response);

 

}



 

Thanks,

Aadav

Reply to this message by going to Community

Start a new discussion in jBPM at Community