It seems that the problem was in httparty. The current gem version was 0.4.4
and the working version was 0.4.3.

also changed the request to

HTTParty.post "http://localhost:4567/processes";, :body => {:pdef_url => '',
:pdef => <string above>, :fields => {'approvers' => []}.to_json}

to placed the process definition in the body.

Thanks!

On Wed, Jul 29, 2009 at 10:31 PM, raldo yeman <[email protected]> wrote:

> Thanks! Will get back to you after trying those suggestions. :D
>
>
> On Wed, Jul 29, 2009 at 10:29 PM, John Mettraux <[email protected]>wrote:
>
>>
>> On Thu, Jul 30, 2009 at 11:05 AM, raldo yeman<[email protected]>
>> wrote:
>> >
>> > class Test0 < OpenWFE::ProcessDefinition
>> >  sequence do
>> >    concurrence do
>> >      sequence do
>> >        user1 :rif => "!wi.fields['approvers'].include?('user1')"
>> >        _cancel_process :if => "${f:cancel} == true"
>> >        user2 :rif => "!wi.fields['approvers'].include?('user2')"
>> >        _cancel_process :if => "${f:cancel} == true"
>> >      end
>> >      sequence do
>> >        user3 :rif => "!wi.fields['approvers'].include?('user3')"
>> >        _cancel_process :if => "${f:cancel} == true"
>> >        user4 :rif => "!wi.fields['approvers'].include?('user4')"
>> >        _cancel_process :if => "${f:cancel} == true"
>> >      end
>> >      sequence do
>> >        user5 :rif => "!wi.fields['approvers'].include?('user5')"
>> >        _cancel_process :if => "${f:cancel} == true"
>> >      end
>> >      sequence do
>> >        user6 :rif => "!wi.fields['approvers'].include?('user6')"
>> >        _cancel_process :if => "${f:cancel} == true"
>> >      end
>> >      sequence do
>> >        user7 :rif => "!wi.fields['approvers'].include?('user7')"
>> >        _cancel_process :if => "${f:cancel} == true"
>> >      end
>> >    end
>> >  end
>> > end
>>
>> Hello Raldo,
>>
>> I know it's not the point of your message, but what about having a
>> subprocess that does :
>>
>> ---8<--
>>  ...
>>  user :id => 1
>>  ...
>>  process_definition "user" do
>>    sequence do
>>      set :field => 'user', :val => 'user${v:id}'
>>      participant :ref => '${f:user}', :rif => " !
>> wi.fields['approvers'].include?(wi.fields['user'])"
>>       cancel_process :if => "${f:cancel} == true"
>>    end
>>  end
>> --->8---
>>
>> Maybe you don't want that because it screws the process graphical
>> rendering somehow...
>>
>> I worked via a temporary field 'user' because of the "rif". Not quite
>> happy with that. I will come up with something better for ruote2.0.
>>
>>
>> > When I paste this code using the html interface of the ruote rest
>> > server, it was able to create the process. However, using httparty,
>> >
>> > HTTParty.post "http://localhost:4567/processes";, :query => {:pdef_url
>> > => '', :pdef => <string above>, :fields => {'approvers' =>
>> > []}.to_json}
>> >
>> > i get the response,
>> >
>> > 'failed to parse incoming representation'.
>>
>> Ouch, you should place the process definition in the body of your
>> post, or at least escape it (Rack::Utils.escape(<string>) or
>> http://ruby-doc.org/stdlib/libdoc/uri/rdoc/classes/URI/Escape.html)
>>
>>
>> I hope this will help, best regards,
>>
>> --
>> John Mettraux   -   http://jmettraux.wordpress.com
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to