Task Management Service

3 views
Skip to first unread message

Pierpaolo

unread,
Mar 25, 2008, 7:03:34 PM3/25/08
to tempo-dev
Hi to all.
I'm using the TMS directly from my code but I'm having some problems
doing that: to get the tasks-list I need to provide a valid
token...How can I create it? I think I should use the TokenService but
I have troubles using it...Usually I create a WebService client using
ADB but in this case the created stub is different and I can't manage
it.

Can someone help me? I need just to know how I can to have a token
from that service.

Thanks
Pierpaolo

Nicolas Modrzyk

unread,
Mar 25, 2008, 8:32:14 PM3/25/08
to temp...@googlegroups.com
Hi PL,

The TokenWSTest has great examples of how you use the TokenService.

public void testAuthenticateRealUser() throws Exception... {
String token = _client.authenticateUser("exolab\\castor", "castor");
}

There is your token.
As a reference the WSDL for the TokenWS can be accessed at:
http://localhost:8080/axis2/services/TokenService?wsdl

And you can use any SOAP graphic client to test it.

Niko,

Pierpaolo

unread,
Mar 25, 2008, 8:52:24 PM3/25/08
to tempo-dev
Thank you..I found it 2 hours ago and I started working....I can have
a token now but an error occurs when I try to get the task list..here
is my code

TaskManagementServicesStub stub = new
TaskManagementServicesStub("http://localhost:8080/axis2/services/
TaskManagementServices");
GetTaskListRequest req = new GetTaskListRequest();
req.setParticipantToken(token);
GetTaskListResponse res = stub.getTaskList(req);

and here is the exception
Exception in thread "main" org.apache.axis2.AxisFault:
org.apache.axis2.databinding.ADBException: Unexpected subelement task
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
at
stub.TaskManagementServicesStub.fromOM(TaskManagementServicesStub.java:
2660)
at
stub.TaskManagementServicesStub.getTaskList(TaskManagementServicesStub.java:
701)
at Main.main(Main.java:52)
Caused by: java.lang.Exception:
org.apache.axis2.databinding.ADBException: Unexpected subelement task
at stub.TaskManagementServicesStub$TaskMetadata
$Factory.parse(TaskManagementServicesStub.java:16152)
at stub.TaskManagementServicesStub$GetTaskListResponse
$Factory.parse(TaskManagementServicesStub.java:11777)
at
stub.TaskManagementServicesStub.fromOM(TaskManagementServicesStub.java:
2448)
... 2 more
Caused by: org.apache.axis2.databinding.ADBException: Unexpected
subelement task
at stub.TaskManagementServicesStub$TaskMetadata
$Factory.parse(TaskManagementServicesStub.java:16139)
... 4 more


What did go wrong?





On Mar 26, 1:32 am, "Nicolas Modrzyk" <hellon...@gmail.com> wrote:
> Hi PL,
>
> The TokenWSTest has great examples of how you use the TokenService.
>
> public void testAuthenticateRealUser() throws Exception... {
> String token = _client.authenticateUser("exolab\\castor", "castor");
> }
>
> There is your token.
> As a reference the WSDL for the TokenWS can be accessed at:http://localhost:8080/axis2/services/TokenService?wsdl
>
> And you can use any SOAP graphic client to test it.
>
> Niko,
>

Nicolas Modrzyk

unread,
Mar 25, 2008, 9:25:38 PM3/25/08
to temp...@googlegroups.com
If you go from java to java, you can use the RemoteTMSClient class.

I'll dig into ADB sometimes this week.

Niko,

On 3/26/08, Pierpaolo <pier...@gmail.com> wrote:
>

Alex Boisvert

unread,
Mar 25, 2008, 9:27:12 PM3/25/08
to temp...@googlegroups.com
My guesses are either that,

1) ADB doesn't support the schema very well (since we use extension elements for dynamic content), or
2) the schema doesn't match what is sent over the wire

alex

Nicolas Modrzyk

unread,
Mar 25, 2008, 9:42:06 PM3/25/08
to temp...@googlegroups.com
Option 2:

> 2) the schema doesn't match what is sent over the wire

Niko,

xml-wsdl.txt

Alex Boisvert

unread,
Mar 25, 2008, 9:46:51 PM3/25/08
to temp...@googlegroups.com
It looks right,

            <xsd:element name="getTaskListResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="task" type="tns:taskMetadata" maxOccurs="unbounded" minOccurs="0">
                        </xsd:element>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>

What do you think is wrong?

alex


Xml Returned:
<tms:getTaskListResponse xmlns:tms="http://www.intalio.com/BPMS/Workflow/TaskManagementServices-20051109/">
-<tms:task>
-<tms:taskId>5zrmdgo9hc6vdara47nohnj58zosd56d</tms:taskId>
-<tms:taskType>INIT</tms:taskType>
-<tms:description>Examples - Absence Request</tms:description>
-<tms:creationDate>2008-03-24T19:48:40.000+09:00</tms:creationDate>
-<tms:roleOwner>examples\employee</tms:roleOwner>
-<tms:formUrl>oxf:/AbsenceRequest/AbsenceRequest.xform</tms:formUrl>
-<tms:processEndpoint>http://localhost:8080/ode/processes/AbsenceRequest/Employee_To_AbsenceRequest</tms:processEndpoint>
-<tms:initMessageNamespaceURI>http://www.intalio.com/workflow/forms/AbsenceRequest/AbsenceRequest</tms:initMessageNamespaceURI>
-<tms:initOperationSOAPAction>http://www.example.com/AbsenceRequest/Employee_To_AbsenceRequest/Employee_To_AbsenceRequest_PortType/Receive_Absence_Request</tms:initOperationSOAPAction>
</tms:task>
...
</tms:getTaskListResponse>

WSDL:
                       <xsd:complexType name="taskMetadata">
                               <xsd:sequence>
                                       <xsd:element name="taskId" type="xsd:string"/>
                                       <xsd:element name="taskState" type="xsd:token" maxOccurs="1" minOccurs="0"/>
                                       <xsd:element name="taskType" type="xsd:token"/>
                                       <xsd:element name="description" type="xsd:string" maxOccurs="1" minOccurs="0"/>
                                       <xsd:element name="processId" type="xsd:string" maxOccurs="1" minOccurs="0"/>
                                       <xsd:element name="creationDate" type="xsd:dateTime" maxOccurs="1" minOccurs="0"/>
                                       <xsd:element name="deadline" type="xsd:dateTime" maxOccurs="1" minOccurs="0" />
                                       <xsd:element name="priority" type="xsd:int" nillable="true" maxOccurs="1" minOccurs="0" />
                                       <xsd:element name="userOwner" type="xsd:string" maxOccurs="unbounded" minOccurs="0"/>
                                       <xsd:element name="roleOwner" type="xsd:string" maxOccurs="unbounded" minOccurs="0"/>
                                       <xsd:element name="formUrl" type="xsd:anyURI"/>
                                       <xsd:element name="failureCode" type="xsd:string" maxOccurs="1" minOccurs="0"/>
                                       <xsd:element name="failureReason" type="xsd:string" maxOccurs="1" minOccurs="0"/>
                                       <xsd:element name="userProcessCompleteSOAPAction" type="xsd:string" maxOccurs="1" minOccurs="0"/>
                                       <xsd:element name="processEndpoint" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
                                       <xsd:element name="initMessageNamespaceURI" type="xsd:anyURI" maxOccurs="1" minOccurs="0"/>
                                       <xsd:element name="initOperationSOAPAction" type="xsd:string" maxOccurs="1" minOccurs="0"/>
                                       <xsd:element name="isChainedBefore" type="xsd:string" maxOccurs="1" minOccurs="0"/>
                                       <xsd:element name="previousTaskId" type="xsd:string" maxOccurs="1" minOccurs="0"/>
                                   <xsd:element name="claimAction" type="tns:accessControlType" maxOccurs="1" minOccurs="0"/>
                   <xsd:element name="revokeAction" type="tns:accessControlType" maxOccurs="1" minOccurs="0"/>
                   <xsd:element name="saveAction" type="tns:accessControlType" maxOccurs="1" minOccurs="0"/>
                   <xsd:element name="completeAction" type="tns:accessControlType" maxOccurs="1" minOccurs="0"/>

                                       <xsd:element name="attachments">
                                        <xsd:complexType>
                                          <xsd:sequence>
                                            <xsd:element name="attachment" type="tns:attachment" minOccurs="0" maxOccurs="unbounded" />
                                          </xsd:sequence>
                                        </xsd:complexType>
                                       </xsd:element>
                               </xsd:sequence>
                       </xsd:complexType>
                       <xsd:complexType name="task">
                               <xsd:sequence>
                                       <xsd:element name="metadata" type="tns:taskMetadata"/>
                                       <xsd:element name="input">
                                               <xsd:complexType>
                                                       <xsd:sequence>
                                                               <xsd:any maxOccurs="unbounded" minOccurs="0" />
                                                       </xsd:sequence>
                                               </xsd:complexType>
                                       </xsd:element>
                                       <xsd:element name="output">
                                               <xsd:complexType>
                                                       <xsd:sequence>
                                                               <xsd:any maxOccurs="unbounded" minOccurs="0" />
                                                       </xsd:sequence>
                                               </xsd:complexType>
                                       </xsd:element>
                               </xsd:sequence>
                       </xsd:complexType>

Nicolas Modrzyk

unread,
Mar 25, 2008, 9:56:21 PM3/25/08
to temp...@googlegroups.com
my bad.

It is according to the WSDL.

Pierpaolo

unread,
Mar 26, 2008, 6:54:36 AM3/26/08
to tempo-dev
So...what is the solution? Have I to use RemoteTMSClient?

On Mar 26, 2:56 am, "Nicolas Modrzyk" <hellon...@gmail.com> wrote:
> my bad.
>
> It is according to the WSDL.
>
> On 3/26/08, Alex Boisvert <boisv...@intalio.com> wrote:
>
> > It looks right,
>
> > <xsd:element name="getTaskListResponse">
> > <xsd:complexType>
> > <xsd:sequence>
> > <xsd:element name="task" type="tns:taskMetadata"
> > maxOccurs="unbounded" minOccurs="0">
> > </xsd:element>
> > </xsd:sequence>
> > </xsd:complexType>
> > </xsd:element>
>
> > What do you think is wrong?
>
> > alex
>
> > On Tue, Mar 25, 2008 at 6:42 PM, Nicolas Modrzyk <hellon...@gmail.com>
> > wrote:
>
> > > Option 2:
>
> > > > 2) the schema doesn't match what is sent over the wire
>
> > > Niko,
>
> > > Xml Returned:
> > > <tms:getTaskListResponse
> > xmlns:tms="http://www.intalio.com/BPMS/Workflow/TaskManagementServices-20051109/">
> > > -<tms:task>
>
> > -<tms:taskId>5zrmdgo9hc6vdara47nohnj58zosd56d</tms:taskId>
> > > -<tms:taskType>INIT</tms:taskType>
> > > -<tms:description>Examples - Absence Request</tms:description>
>
> > -<tms:creationDate>2008-03-24T19:48:40.000+09:00</tms:creationDate>
> > > -<tms:roleOwner>examples\employee</tms:roleOwner>
>
> > -<tms:formUrl>oxf:/AbsenceRequest/AbsenceRequest.xform</tms:formUrl>
>
> > -<tms:processEndpoint>http://localhost:8080/ode/processes/AbsenceRequest/Employee_To_Absenc...</tms:processEndpoint>
>
> > -<tms:initMessageNamespaceURI>http://www.intalio.com/workflow/forms/AbsenceRequest/AbsenceRequest</tms:initMessageNamespaceURI>
>
> > -<tms:initOperationSOAPAction>http://www.example.com/AbsenceRequest/Employee_To_AbsenceRequest/Empl...</tms:initOperationSOAPAction>

Alex Boisvert

unread,
Mar 26, 2008, 11:11:20 AM3/26/08
to temp...@googlegroups.com
On Wed, Mar 26, 2008 at 3:54 AM, Pierpaolo <pier...@gmail.com> wrote:

So...what is the solution? Have I to use RemoteTMSClient?

That's what I would recommend, unless you're willing to investigate/debug why things aren't working with ADB.  (I'd be interested to know...)

alex

Nicolas Modrzyk

unread,
Mar 26, 2008, 12:21:54 PM3/26/08
to temp...@googlegroups.com
I've been as far as being able to reproduce the problem.

I've used the following options when generating the adb code:

./wsdl2java.sh -Eosv -or -sp -ss -g -uri
$TEMPO_HOME/tms-service/src/main/axis2/TaskManagementService.wsdl -o
ax2

and looks like it worked with:


TaskManagementServicesStub stub = new
TaskManagementServicesStub("http://localhost:8080/axis2/services/TaskManagementServices");

GetTaskListRequest r1 = new GetTaskListRequest();
r1.setParticipantToken(token);
GetTaskListResponse gtr = stub.getTaskList(r1);
TaskMetadata[] tm = gtr.getTask();

So suppressing namespaces and turning off strict validation.
This is not really good for production environment though.

Regards,

Niko,

Pierpaolo Lombardi

unread,
Mar 26, 2008, 2:13:22 PM3/26/08
to temp...@googlegroups.com
It's very simple to use the clients...I'm using now the TokenClient and RemoteTMSClient...I can't try it right now..I will run the program later..I hope it works.

Thanks again..your help is very usefull!!!!!

Pierpaolo

tdakanalis

unread,
Mar 31, 2008, 1:56:00 PM3/31/08
to tempo-dev
Hi,

I have a question: Where can I find the RemoteTMSClient class and how
can I use it to make calls in the TMS service?

On Mar 26, 9:13 pm, "Pierpaolo Lombardi" <pier.l...@gmail.com> wrote:
> It's very simple to use the clients...I'm using now the TokenClient and
> RemoteTMSClient...I can't try it right now..I will run the program later..I
> hope it works.
>
> Thanks again..your help is very usefull!!!!!
>
> Pierpaolo
>
> On 26/03/2008, Nicolas Modrzyk <hellon...@gmail.com> wrote:
>
>
>
> > I've been as far as being able to reproduce the problem.
>
> > I've used the following options when generating the adb code:
>
> > ./wsdl2java.sh -Eosv -or -sp -ss -g -uri
> > $TEMPO_HOME/tms-service/src/main/axis2/TaskManagementService.wsdl -o
> > ax2
>
> > and looks like it worked with:
>
> > TaskManagementServicesStub stub = new
> > TaskManagementServicesStub("
> >http://localhost:8080/axis2/services/TaskManagementServices");
>
> > GetTaskListRequest r1 = new GetTaskListRequest();
> > r1.setParticipantToken(token);
> > GetTaskListResponse gtr = stub.getTaskList(r1);
> > TaskMetadata[] tm = gtr.getTask();
>
> > So suppressing namespaces and turning off strict validation.
> > This is not really good for production environment though.
>
> > Regards,
>
> > Niko,
>
> > On 3/27/08, Alex Boisvert <boisv...@intalio.com> wrote:

Alex Boisvert

unread,
Mar 31, 2008, 2:16:05 PM3/31/08
to temp...@googlegroups.com
On Mon, Mar 31, 2008 at 10:56 AM, tdakanalis <tdaka...@gmail.com> wrote:
I have a question: Where can I find the RemoteTMSClient class and how
can I use it to make calls in the TMS service?

tms-client/src/main/java/org/intalio/tempo/workflow/tms/client/RemoteTMSClient.java

and for an example, you can look at the test,

tms-client/src/test/java/org/intalio/tempo/workflow/tms/client/dependent_tests/RemoteTMSClientTest.java

alex

Reply all
Reply to author
Forward
0 new messages