Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Process Manager (Stardust) » How to access transitions programmatically
How to access transitions programmatically [message #1705285] Thu, 13 August 2015 13:35 Go to next message
Tam Gom is currently offline Tam GomFriend
Messages: 36
Registered: July 2011
Member
Hi all,

I would like to access the outgoing transitions for each activity in my workflows. I see that the IActivity interface and its implementation, the ActivityBean class provide the getOutTransitions() method but the QueryService, WorkflowService etc use the Activity interface (and interfaces without the "I" at the beginning in general).

How can I acquire an instance of the IActivity interface or could someone please explain the proper way to access transitions?

Thanks.

[Updated on: Thu, 13 August 2015 13:37]

Report message to a moderator

Re: How to access transitions programmatically [message #1705490 is a reply to message #1705285] Mon, 17 August 2015 07:04 Go to previous messageGo to next message
Ashish Khole is currently offline Ashish KholeFriend
Messages: 28
Registered: April 2015
Junior Member
Hi,

Here is another approach see if below code helps you

ServiceFactory sf=ServiceFactoryLocator.get("motu", "motu");
QueryService qs=sf.getQueryService();
ProcessDefinition processDefinition = qs.getProcessDefinition(
            "ProcessDefinition1");
List<Activity> activityList=processDefinition.getAllActivities();
System.out.println("Iterating for all Activities for OutGoing transitions");
for (Activity activity : activityList) {
	System.out.println("Displaying Outgoing Transition for Activity"+activityList.indexOf(activity)+"="+activity.getName());
	List<Transition> transitionList = processDefinition.getOutgoingTransitions(activity);
	for (Transition transition : transitionList) {
		System.out.println(" *******Trans details*********" +
			"\n transitionId = "+transition.getId()+
			"\n transitionCondition = "+transition.getCondition()+
			"\n transitionSourceActivity = "+transition.getSourceActivityId()+
			"\n transitionTargetActivity = "+transition.getTargetActivityId()+
			"\n transitionConditionType = "+transition.getConditionType());
		}
	}


Regards,
Ashish
Re: How to access transitions programmatically [message #1705536 is a reply to message #1705490] Mon, 17 August 2015 12:26 Go to previous messageGo to next message
Tam Gom is currently offline Tam GomFriend
Messages: 36
Registered: July 2011
Member
Hi Ashish,

Thank you for your answer! This is exactly what I need, but as I see, the ProcessDefinition interface contains this method only in Stardust 3.0.0 and I'm currently using 2.1.1. If I upgrade my Stardust artifacts to 3.0.0., does that mean I have to upgrade the modeller to 3.0.0., thus upgrade my Eclipse to Mars as well? What are the implications in terms of the AuditTrail database, do I have to upgrade the 2.1.1. schema?

Regards,
Tamás
Re: How to access transitions programmatically [message #1705565 is a reply to message #1705536] Mon, 17 August 2015 14:11 Go to previous message
Tam Gom is currently offline Tam GomFriend
Messages: 36
Registered: July 2011
Member
I've checked and the database schema hasn't changed, this is the most important, so I'm good to go. Thank you once more!
Previous Topic:Deployed models are cached during unit tests
Next Topic:upgrade maven project 2 to 3
Goto Forum:
  


Current Time: Mon Nov 19 06:48:29 GMT 2018

Powered by FUDForum. Page generated in 0.02021 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top