PageRenderTime 32ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/sdk-1.5.5/services/swf.class.php

https://bitbucket.org/ardydedase/web-build-optimizer
PHP | 1344 lines | 220 code | 89 blank | 1035 comment | 33 complexity | eaa3eaf6095814648ab62c7196ebe0e4 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause
  1. <?php
  2. /*
  3. * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License").
  6. * You may not use this file except in compliance with the License.
  7. * A copy of the License is located at
  8. *
  9. * http://aws.amazon.com/apache2.0
  10. *
  11. * or in the "license" file accompanying this file. This file is distributed
  12. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  13. * express or implied. See the License for the specific language governing
  14. * permissions and limitations under the License.
  15. */
  16. /**
  17. * The Amazon Simple Workflow Service API Reference is intended for programmers who need detailed
  18. * information about the Amazon SWF actions and data types.
  19. *
  20. * For an broader overview of the Amazon SWF programming model, please go to the <a href=
  21. * "http://docs.amazonwebservices.com/amazonswf/latest/developerguide/">Amazon SWF Developer
  22. * Guide</a>.
  23. *
  24. * This section provides an overview of Amazon SWF actions.
  25. *
  26. * <strong>Action Categories</strong>
  27. *
  28. * The Amazon SWF actions can be grouped into the following major categories.
  29. *
  30. * <ul>
  31. * <li>Actions related to Activities</li>
  32. * <li>Actions related to Deciders</li>
  33. * <li>Actions related to Workflow Executions</li>
  34. * <li>Actions related to Administration</li>
  35. * <li>Actions related to Visibility</li>
  36. * </ul>
  37. *
  38. * <strong>Actions related to Activities</strong>
  39. *
  40. * The following are actions that are performed by activity workers:
  41. *
  42. * <ul>
  43. * <li><a href="API_PollForActivityTask.html" title=
  44. * "PollForActivityTask">PollForActivityTask</a></li>
  45. * <li><a href="API_RespondActivityTaskCompleted.html" title=
  46. * "RespondActivityTaskCompleted">RespondActivityTaskCompleted</a></li>
  47. * <li><a href="API_RespondActivityTaskFailed.html" title=
  48. * "RespondActivityTaskFailed">RespondActivityTaskFailed</a></li>
  49. * <li><a href="API_RespondActivityTaskCanceled.html" title=
  50. * "RespondActivityTaskCanceled">RespondActivityTaskCanceled</a></li>
  51. * <li><a href="API_RecordActivityTaskHeartbeat.html" title=
  52. * "RecordActivityTaskHeartbeat">RecordActivityTaskHeartbeat</a></li>
  53. * </ul>
  54. *
  55. * Activity workers use the <a href="API_PollForActivityTask.html" title=
  56. * "PollForActivityTask">PollForActivityTask</a> to get new activity tasks. After a worker
  57. * receives an activity task from Amazon SWF, it performs the task and responds using <a href=
  58. * "API_RespondActivityTaskCompleted.html" title=
  59. * "RespondActivityTaskCompleted">RespondActivityTaskCompleted</a> if successful or <a href=
  60. * "API_RespondActivityTaskFailed.html" title=
  61. * "RespondActivityTaskFailed">RespondActivityTaskFailed</a> if unsuccessful.
  62. *
  63. * <strong>Actions related to Deciders</strong>
  64. *
  65. * The following are actions that are performed by deciders:
  66. *
  67. * <ul>
  68. * <li><a href="API_PollForDecisionTask.html" title=
  69. * "PollForDecisionTask">PollForDecisionTask</a></li>
  70. * <li><a href="API_RespondDecisionTaskCompleted.html" title=
  71. * "RespondDecisionTaskCompleted">RespondDecisionTaskCompleted</a></li>
  72. * </ul>
  73. *
  74. * Deciders use <a href="API_PollForDecisionTask.html" title=
  75. * "PollForDecisionTask">PollForDecisionTask</a> to get decision tasks. After a decider receives a
  76. * decision task from Amazon SWF, it examines its workflow execution history and decides what to
  77. * do next. It calls <a href="API_RespondDecisionTaskCompleted.html" title=
  78. * "RespondDecisionTaskCompleted">RespondDecisionTaskCompleted</a> to complete the decision task
  79. * and provide zero or more next decisions.
  80. *
  81. * <strong>Actions related to Workflow Executions</strong>
  82. *
  83. * The following actions operate on a workflow execution:
  84. *
  85. * <ul>
  86. * <li><a href="API_RequestCancelWorkflowExecution.html" title=
  87. * "RequestCancelWorkflowExecution">RequestCancelWorkflowExecution</a></li>
  88. * <li><a href="API_StartWorkflowExecution.html" title=
  89. * "StartWorkflowExecution">StartWorkflowExecution</a></li>
  90. * <li><a href="API_SignalWorkflowExecution.html" title=
  91. * "SignalWorkflowExecution">SignalWorkflowExecution</a></li>
  92. * <li><a href="API_TerminateWorkflowExecution.html" title=
  93. * "TerminateWorkflowExecution">TerminateWorkflowExecution</a></li>
  94. * </ul>
  95. *
  96. * <strong>Actions related to Administration</strong>
  97. *
  98. * Although you can perform administrative tasks from the Amazon SWF console, you can use the
  99. * actions in this section to automate functions or build your own administrative tools.
  100. *
  101. * <strong>Activity Management</strong>
  102. *
  103. * <ul>
  104. * <li><a href="API_RegisterActivityType.html" title=
  105. * "RegisterActivityType">RegisterActivityType</a></li>
  106. * <li><a href="API_DeprecateActivityType.html" title=
  107. * "DeprecateActivityType">DeprecateActivityType</a></li>
  108. * </ul>
  109. *
  110. * <strong>Workflow Management</strong>
  111. *
  112. * <ul>
  113. * <li><a href="API_RegisterWorkflowType.html" title=
  114. * "RegisterWorkflowType">RegisterWorkflowType</a></li>
  115. * <li><a href="API_DeprecateWorkflowType.html" title=
  116. * "DeprecateWorkflowType">DeprecateWorkflowType</a></li>
  117. * </ul>
  118. *
  119. * <strong>Domain Management</strong>
  120. *
  121. * <ul>
  122. * <li><a href="API_RegisterDomain.html" title="RegisterDomain">RegisterDomain</a></li>
  123. * <li><a href="API_DeprecateDomain.html" title="DeprecateDomain">DeprecateDomain</a></li>
  124. * </ul>
  125. *
  126. * <strong>Workflow Execution Management</strong>
  127. *
  128. * <ul>
  129. * <li><a href="API_RequestCancelWorkflowExecution.html" title=
  130. * "RequestCancelWorkflowExecution">RequestCancelWorkflowExecution</a></li>
  131. * <li><a href="API_TerminateWorkflowExecution.html" title=
  132. * "TerminateWorkflowExecution">TerminateWorkflowExecution</a></li>
  133. * </ul>
  134. *
  135. * <strong>Visibility Actions</strong>
  136. *
  137. * Although you can perform visibility actions from the Amazon SWF console, you can use the
  138. * actions in this section to build your own console or administrative tools.
  139. *
  140. * <strong>Activity Visibility</strong>
  141. *
  142. * <ul>
  143. * <li><a href="API_ListActivityTypes.html" title="ListActivities">ListActivityTypes</a></li>
  144. * <li><a href="API_DescribeActivityType.html" title=
  145. * "DescribeActivityType">DescribeActivity</a></li>
  146. * </ul>
  147. *
  148. * <strong>Workflow Visibility</strong>
  149. *
  150. * <ul>
  151. * <li><a href="API_ListWorkflowTypes.html" title="ListWorkflowTypes">ListWorkflowTypes</a></li>
  152. * <li><a href="API_DescribeWorkflowType.html" title=
  153. * "DescribeWorkflowType">DescribeWorkflowType</a></li>
  154. * </ul>
  155. *
  156. * <strong>Workflow Execution Visibility</strong>
  157. *
  158. * <ul>
  159. * <li><a href="API_DescribeWorkflowExecution.html" title=
  160. * "DescribeWorkflowExecution">DescribeWorkflowExecution</a></li>
  161. * <li><a href="API_ListOpenWorkflowExecutions.html" title=
  162. * "ListOpenWorkflowExecutions">ListOpenWorkflowExecutions</a></li>
  163. * <li><a href="API_ListClosedWorkflowExecutions.html" title=
  164. * "ListClosedWorkflowExecutions">ListClosedWorkflowExecutions</a></li>
  165. * <li><a href="API_CountOpenWorkflowExecutions.html" title=
  166. * "CountOpenWorkflowExecutions">CountOpenWorkflowExecutions</a></li>
  167. * <li><a href="API_CountClosedWorkflowExecutions.html" title=
  168. * "CountClosedWorkflowExecutions">CountClosedWorkflowExecutions</a></li>
  169. * <li><a href="API_GetWorkflowExecutionHistory.html" title=
  170. * "GetWorkflowExecutionHistory">GetWorkflowExecutionHistory</a></li>
  171. * </ul>
  172. *
  173. * <strong>Domain Visibility</strong>
  174. *
  175. * <ul>
  176. * <li><a href="API_ListDomains.html" title="ListDomains">ListDomains</a></li>
  177. * <li><a href="API_DescribeDomain.html" title="DescribeDomain">DescribeDomain</a></li>
  178. * </ul>
  179. *
  180. * <strong>Task List Visibility</strong>
  181. *
  182. * <ul>
  183. * <li><a href="API_CountPendingActivityTasks.html" title=
  184. * "CountPendingActivityTasks">CountPendingActivityTasks</a></li>
  185. * <li><a href="API_CountPendingDecisionTasks.html" title=
  186. * "CountPendingDecisionTasks">CountPendingDecisionTasks</a></li>
  187. * </ul>
  188. *
  189. * @version 2012.05.01
  190. * @license See the included NOTICE.md file for complete information.
  191. * @copyright See the included NOTICE.md file for complete information.
  192. * @link http://aws.amazon.com/simpleworkflow/ Amazon Simple Workflow
  193. * @link http://aws.amazon.com/simpleworkflow/documentation/ Amazon Simple Workflow documentation
  194. */
  195. class AmazonSWF extends CFRuntime
  196. {
  197. /*%******************************************************************************************%*/
  198. // CLASS CONSTANTS
  199. /**
  200. * Specify the queue URL for the United States East (Northern Virginia) Region.
  201. */
  202. const REGION_US_E1 = 'swf.us-east-1.amazonaws.com';
  203. /**
  204. * Specify the queue URL for the United States East (Northern Virginia) Region.
  205. */
  206. const REGION_VIRGINIA = self::REGION_US_E1;
  207. /**
  208. * Default service endpoint.
  209. */
  210. const DEFAULT_URL = self::REGION_US_E1;
  211. /*%******************************************************************************************%*/
  212. // STATUS CONSTANTS
  213. /**
  214. * Status: Registered
  215. */
  216. const STATUS_REGISTERED = 'REGISTERED';
  217. /**
  218. * Status: Deprecated
  219. */
  220. const STATUS_DEPRECATED = 'DEPRECATED';
  221. /*%******************************************************************************************%*/
  222. // POLICY CONSTANTS
  223. /**
  224. * Policy: Terminate
  225. */
  226. const POLICY_TERMINATE = 'TERMINATE';
  227. /**
  228. * Policy: Request Cancel
  229. */
  230. const POLICY_REQUEST_CANCEL = 'REQUEST_CANCEL';
  231. /**
  232. * Policy: Abandon
  233. */
  234. const POLICY_ABANDON = 'ABANDON';
  235. /*%******************************************************************************************%*/
  236. // CONSTRUCTOR
  237. /**
  238. * Constructs a new instance of <AmazonSWF>.
  239. *
  240. * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
  241. * <li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
  242. * <li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
  243. * <li><code>default_cache_config</code> - <code>string</code> - Optional - This option allows a preferred storage type to be configured for long-term caching. This can be changed later using the <set_cache_config()> method. Valid values are: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
  244. * <li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
  245. * <li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
  246. * <li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
  247. * @return void
  248. */
  249. public function __construct(array $options = array())
  250. {
  251. $this->api_version = '2012-01-25';
  252. $this->hostname = self::DEFAULT_URL;
  253. $this->auth_class = 'AuthV3JSON';
  254. $this->operation_prefix = "x-amz-target:SimpleWorkflowService.";
  255. return parent::__construct($options);
  256. }
  257. /*%******************************************************************************************%*/
  258. // SETTERS
  259. /**
  260. * This allows you to explicitly sets the region for the service to use.
  261. *
  262. * @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>.
  263. * @return $this A reference to the current instance.
  264. */
  265. public function set_region($region)
  266. {
  267. // @codeCoverageIgnoreStart
  268. $this->set_hostname($region);
  269. return $this;
  270. // @codeCoverageIgnoreEnd
  271. }
  272. /*%******************************************************************************************%*/
  273. // SERVICE METHODS
  274. /**
  275. * Returns the number of closed workflow executions within the given domain that meet the
  276. * specified filtering criteria.
  277. *
  278. * <p class="note">
  279. * This operation is eventually consistent. The results are best effort and may not exactly
  280. * reflect recent updates and changes.
  281. * </p>
  282. *
  283. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  284. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain containing the workflow executions to count.</li>
  285. * <li><code>startTimeFilter</code> - <code>array</code> - Optional - If specified, only workflow executions that meet the start time criteria of the filter are counted. <p class="note"> <code>startTimeFilter</code> and <code>closeTimeFilter</code> are mutually exclusive. You must specify one of these in a request but not both.</p> <ul>
  286. * <li><code>oldestDate</code> - <code>string</code> - Required - Specifies the oldest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  287. * <li><code>latestDate</code> - <code>string</code> - Optional - Specifies the latest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  288. * </ul></li>
  289. * <li><code>closeTimeFilter</code> - <code>array</code> - Optional - If specified, only workflow executions that meet the close time criteria of the filter are counted. <p class="note"> <code>startTimeFilter</code> and <code>closeTimeFilter</code> are mutually exclusive. You must specify one of these in a request but not both.</p> <ul>
  290. * <li><code>oldestDate</code> - <code>string</code> - Required - Specifies the oldest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  291. * <li><code>latestDate</code> - <code>string</code> - Optional - Specifies the latest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  292. * </ul></li>
  293. * <li><code>executionFilter</code> - <code>array</code> - Optional - If specified, only workflow executions matching the <code>WorkflowId</code> in the filter are counted. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  294. * <li><code>workflowId</code> - <code>string</code> - Required - The workflowId to pass of match the criteria of this filter.</li>
  295. * </ul></li>
  296. * <li><code>typeFilter</code> - <code>array</code> - Optional - If specified, indicates the type of the workflow executions to be counted. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  297. * <li><code>name</code> - <code>string</code> - Required - Name of the workflow type. This field is required.</li>
  298. * <li><code>version</code> - <code>string</code> - Optional - Version of the workflow type.</li>
  299. * </ul></li>
  300. * <li><code>tagFilter</code> - <code>array</code> - Optional - If specified, only executions that have a tag that matches the filter are counted. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  301. * <li><code>tag</code> - <code>string</code> - Required - Specifies the tag that must be associated with the execution for it to meet the filter criteria. This field is required.</li>
  302. * </ul></li>
  303. * <li><code>closeStatusFilter</code> - <code>array</code> - Optional - If specified, only workflow executions that match this close status are counted. This filter has an affect only if <code>executionStatus</code> is specified as <code>CLOSED</code>. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  304. * <li><code>status</code> - <code>string</code> - Required - The close status that must match the close status of an execution for it to meet the criteria of this filter. This field is required. [Allowed values: <code>COMPLETED</code>, <code>FAILED</code>, <code>CANCELED</code>, <code>TERMINATED</code>, <code>CONTINUED_AS_NEW</code>, <code>TIMED_OUT</code>]</li>
  305. * </ul></li>
  306. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  307. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  308. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  309. */
  310. public function count_closed_workflow_executions($opt = null)
  311. {
  312. if (!$opt) $opt = array();
  313. $opt = json_encode($opt);
  314. return $this->authenticate('CountClosedWorkflowExecutions', $opt);
  315. }
  316. /**
  317. * Returns the number of open workflow executions within the given domain that meet the specified
  318. * filtering criteria.
  319. *
  320. * <p class="note">
  321. * This operation is eventually consistent. The results are best effort and may not exactly
  322. * reflect recent updates and changes.
  323. * </p>
  324. *
  325. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  326. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain containing the workflow executions to count.</li>
  327. * <li><code>startTimeFilter</code> - <code>array</code> - Required - Specifies the start time criteria that workflow executions must meet in order to be counted. <ul>
  328. * <li><code>oldestDate</code> - <code>string</code> - Required - Specifies the oldest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  329. * <li><code>latestDate</code> - <code>string</code> - Optional - Specifies the latest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  330. * </ul></li>
  331. * <li><code>typeFilter</code> - <code>array</code> - Optional - Specifies the type of the workflow executions to be counted. <p class="note"> <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  332. * <li><code>name</code> - <code>string</code> - Required - Name of the workflow type. This field is required.</li>
  333. * <li><code>version</code> - <code>string</code> - Optional - Version of the workflow type.</li>
  334. * </ul></li>
  335. * <li><code>tagFilter</code> - <code>array</code> - Optional - If specified, only executions that have a tag that matches the filter are counted. <p class="note"> <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  336. * <li><code>tag</code> - <code>string</code> - Required - Specifies the tag that must be associated with the execution for it to meet the filter criteria. This field is required.</li>
  337. * </ul></li>
  338. * <li><code>executionFilter</code> - <code>array</code> - Optional - If specified, only workflow executions matching the <code>WorkflowId</code> in the filter are counted. <p class="note"> <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  339. * <li><code>workflowId</code> - <code>string</code> - Required - The workflowId to pass of match the criteria of this filter.</li>
  340. * </ul></li>
  341. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  342. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  343. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  344. */
  345. public function count_open_workflow_executions($opt = null)
  346. {
  347. if (!$opt) $opt = array();
  348. $opt = json_encode($opt);
  349. return $this->authenticate('CountOpenWorkflowExecutions', $opt);
  350. }
  351. /**
  352. * Returns the estimated number of activity tasks in the specified task list. The count returned
  353. * is an approximation and is not guaranteed to be exact. If you specify a task list that no
  354. * activity task was ever scheduled in then 0 will be returned.
  355. *
  356. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  357. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain that contains the task list.</li>
  358. * <li><code>taskList</code> - <code>array</code> - Required - The name of the task list. <ul>
  359. * <li><code>name</code> - <code>string</code> - Required - The name of the task list.</li>
  360. * </ul></li>
  361. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  362. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  363. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  364. */
  365. public function count_pending_activity_tasks($opt = null)
  366. {
  367. if (!$opt) $opt = array();
  368. $opt = json_encode($opt);
  369. return $this->authenticate('CountPendingActivityTasks', $opt);
  370. }
  371. /**
  372. * Returns the estimated number of decision tasks in the specified task list. The count returned
  373. * is an approximation and is not guaranteed to be exact. If you specify a task list that no
  374. * decision task was ever scheduled in then 0 will be returned.
  375. *
  376. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  377. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain that contains the task list.</li>
  378. * <li><code>taskList</code> - <code>array</code> - Required - The name of the task list. <ul>
  379. * <li><code>name</code> - <code>string</code> - Required - The name of the task list.</li>
  380. * </ul></li>
  381. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  382. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  383. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  384. */
  385. public function count_pending_decision_tasks($opt = null)
  386. {
  387. if (!$opt) $opt = array();
  388. $opt = json_encode($opt);
  389. return $this->authenticate('CountPendingDecisionTasks', $opt);
  390. }
  391. /**
  392. * Deprecates the specified <em>activity type</em>. After an activity type has been deprecated,
  393. * you cannot create new tasks of that activity type. Tasks of this type that were scheduled
  394. * before the type was deprecated will continue to run.
  395. *
  396. * <p class="note">
  397. * This operation is eventually consistent. The results are best effort and may not exactly
  398. * reflect recent updates and changes.
  399. * </p>
  400. *
  401. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  402. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which the activity type is registered.</li>
  403. * <li><code>activityType</code> - <code>array</code> - Required - The activity type to deprecate. <ul>
  404. * <li><code>name</code> - <code>string</code> - Required - The name of this activity. <p class="note">The combination of activity type name and version must be unique within a domain.</p></li>
  405. * <li><code>version</code> - <code>string</code> - Required - The version of this activity. <p class="note">The combination of activity type name and version must be unique with in a domain.</p></li>
  406. * </ul></li>
  407. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  408. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  409. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  410. */
  411. public function deprecate_activity_type($opt = null)
  412. {
  413. if (!$opt) $opt = array();
  414. $opt = json_encode($opt);
  415. return $this->authenticate('DeprecateActivityType', $opt);
  416. }
  417. /**
  418. * Deprecates the specified domain. After a domain has been deprecated it cannot be used to create
  419. * new workflow executions or register new types. However, you can still use visibility actions on
  420. * this domain. Deprecating a domain also deprecates all activity and workflow types registered in
  421. * the domain. Executions that were started before the domain was deprecated will continue to run.
  422. *
  423. * <p class="note">
  424. * This operation is eventually consistent. The results are best effort and may not exactly
  425. * reflect recent updates and changes.
  426. * </p>
  427. *
  428. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  429. * <li><code>name</code> - <code>string</code> - Required - The name of the domain to deprecate.</li>
  430. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  431. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  432. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  433. */
  434. public function deprecate_domain($opt = null)
  435. {
  436. if (!$opt) $opt = array();
  437. $opt = json_encode($opt);
  438. return $this->authenticate('DeprecateDomain', $opt);
  439. }
  440. /**
  441. * Deprecates the specified <em>workflow type</em>. After a workflow type has been deprecated, you
  442. * cannot create new executions of that type. Executions that were started before the type was
  443. * deprecated will continue to run. A deprecated workflow type may still be used when calling
  444. * visibility actions.
  445. *
  446. * <p class="note">
  447. * This operation is eventually consistent. The results are best effort and may not exactly
  448. * reflect recent updates and changes.
  449. * </p>
  450. *
  451. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  452. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which the workflow type is registered.</li>
  453. * <li><code>workflowType</code> - <code>array</code> - Required - The workflow type to deprecate. <ul>
  454. * <li><code>name</code> - <code>string</code> - Required - The name of the workflow type. This field is required. <p class="note">The combination of workflow type name and version must be unique with in a domain.</p></li>
  455. * <li><code>version</code> - <code>string</code> - Required - The version of the workflow type. This field is required. <p class="note">The combination of workflow type name and version must be unique with in a domain.</p></li>
  456. * </ul></li>
  457. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  458. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  459. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  460. */
  461. public function deprecate_workflow_type($opt = null)
  462. {
  463. if (!$opt) $opt = array();
  464. $opt = json_encode($opt);
  465. return $this->authenticate('DeprecateWorkflowType', $opt);
  466. }
  467. /**
  468. * Returns information about the specified activity type. This includes configuration settings
  469. * provided at registration time as well as other general information about the type.
  470. *
  471. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  472. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which the activity type is registered.</li>
  473. * <li><code>activityType</code> - <code>array</code> - Required - The activity type to describe. <ul>
  474. * <li><code>name</code> - <code>string</code> - Required - The name of this activity. <p class="note">The combination of activity type name and version must be unique within a domain.</p></li>
  475. * <li><code>version</code> - <code>string</code> - Required - The version of this activity. <p class="note">The combination of activity type name and version must be unique with in a domain.</p></li>
  476. * </ul></li>
  477. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  478. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  479. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  480. */
  481. public function describe_activity_type($opt = null)
  482. {
  483. if (!$opt) $opt = array();
  484. $opt = json_encode($opt);
  485. return $this->authenticate('DescribeActivityType', $opt);
  486. }
  487. /**
  488. * Returns information about the specified domain including description and status.
  489. *
  490. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  491. * <li><code>name</code> - <code>string</code> - Required - The name of the domain to describe.</li>
  492. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  493. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  494. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  495. */
  496. public function describe_domain($opt = null)
  497. {
  498. if (!$opt) $opt = array();
  499. $opt = json_encode($opt);
  500. return $this->authenticate('DescribeDomain', $opt);
  501. }
  502. /**
  503. * Returns information about the specified workflow execution including its type and some
  504. * statistics.
  505. *
  506. * <p class="note">
  507. * This operation is eventually consistent. The results are best effort and may not exactly
  508. * reflect recent updates and changes.
  509. * </p>
  510. *
  511. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  512. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain containing the workflow execution.</li>
  513. * <li><code>execution</code> - <code>array</code> - Required - The workflow execution to describe. <ul>
  514. * <li><code>workflowId</code> - <code>string</code> - Required - The user defined identifier associated with the workflow execution.</li>
  515. * <li><code>runId</code> - <code>string</code> - Required - A system generated unique identifier for the workflow execution.</li>
  516. * </ul></li>
  517. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  518. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  519. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  520. */
  521. public function describe_workflow_execution($opt = null)
  522. {
  523. if (!$opt) $opt = array();
  524. $opt = json_encode($opt);
  525. return $this->authenticate('DescribeWorkflowExecution', $opt);
  526. }
  527. /**
  528. * Returns information about the specified <em>workflow type</em>. This includes configuration
  529. * settings specified when the type was registered and other information such as creation date,
  530. * current status, etc.
  531. *
  532. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  533. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which this workflow type is registered.</li>
  534. * <li><code>workflowType</code> - <code>array</code> - Required - The workflow type to describe. <ul>
  535. * <li><code>name</code> - <code>string</code> - Required - The name of the workflow type. This field is required. <p class="note">The combination of workflow type name and version must be unique with in a domain.</p></li>
  536. * <li><code>version</code> - <code>string</code> - Required - The version of the workflow type. This field is required. <p class="note">The combination of workflow type name and version must be unique with in a domain.</p></li>
  537. * </ul></li>
  538. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  539. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  540. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  541. */
  542. public function describe_workflow_type($opt = null)
  543. {
  544. if (!$opt) $opt = array();
  545. $opt = json_encode($opt);
  546. return $this->authenticate('DescribeWorkflowType', $opt);
  547. }
  548. /**
  549. * Returns the history of the specified workflow execution. The results may be split into multiple
  550. * pages. To retrieve subsequent pages, make the call again using the <code>nextPageToken</code>
  551. * returned by the initial call.
  552. *
  553. * <p class="note">
  554. * This operation is eventually consistent. The results are best effort and may not exactly
  555. * reflect recent updates and changes.
  556. * </p>
  557. *
  558. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  559. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain containing the workflow execution.</li>
  560. * <li><code>execution</code> - <code>array</code> - Required - Specifies the workflow execution for which to return the history. <ul>
  561. * <li><code>workflowId</code> - <code>string</code> - Required - The user defined identifier associated with the workflow execution.</li>
  562. * <li><code>runId</code> - <code>string</code> - Required - A system generated unique identifier for the workflow execution.</li>
  563. * </ul></li>
  564. * <li><code>nextPageToken</code> - <code>string</code> - Optional - If a <code>NextPageToken</code> is returned, the result has more than one pages. To get the next page, repeat the call and specify the nextPageToken with all other arguments unchanged.</li>
  565. * <li><code>maximumPageSize</code> - <code>integer</code> - Optional - Specifies the maximum number of history events returned in one page. The next page in the result is identified by the <code>NextPageToken</code> returned. By default 100 history events are returned in a page but the caller can override this value to a page size <em>smaller</em> than the default. You cannot specify a page size larger than 100.</li>
  566. * <li><code>reverseOrder</code> - <code>boolean</code> - Optional - When set to <code>true</code>, returns the events in reverse order. By default the results are returned in ascending order of the <code>eventTimeStamp</code> of the events.</li>
  567. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  568. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  569. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  570. */
  571. public function get_workflow_execution_history($opt = null)
  572. {
  573. if (!$opt) $opt = array();
  574. $opt = json_encode($opt);
  575. return $this->authenticate('GetWorkflowExecutionHistory', $opt);
  576. }
  577. /**
  578. * Returns information about all activities registered in the specified domain that match the
  579. * specified name and registration status. The result includes information like creation date,
  580. * current status of the activity, etc. The results may be split into multiple pages. To retrieve
  581. * subsequent pages, make the call again using the <code>nextPageToken</code> returned by the
  582. * initial call.
  583. *
  584. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  585. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which the activity types have been registered.</li>
  586. * <li><code>name</code> - <code>string</code> - Optional - If specified, only lists the activity types that have this name.</li>
  587. * <li><code>registrationStatus</code> - <code>string</code> - Required - Specifies the registration status of the activity types to list. [Allowed values: <code>REGISTERED</code>, <code>DEPRECATED</code>]</li>
  588. * <li><code>nextPageToken</code> - <code>string</code> - Optional - If on a previous call to this method a <code>NextResultToken</code> was returned, the results have more than one page. To get the next page of results, repeat the call with the <code>nextPageToken</code> and keep all other arguments unchanged.</li>
  589. * <li><code>maximumPageSize</code> - <code>integer</code> - Optional - The maximum number of results returned in each page. The default is 100, but the caller can override this value to a page size <em>smaller</em> than the default. You cannot specify a page size greater than 100.</li>
  590. * <li><code>reverseOrder</code> - <code>boolean</code> - Optional - When set to <code>true</code>, returns the results in reverse order. By default the results are returned in ascending alphabetical order of the <code>name</code> of the activity types.</li>
  591. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  592. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  593. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  594. */
  595. public function list_activity_types($opt = null)
  596. {
  597. if (!$opt) $opt = array();
  598. $opt = json_encode($opt);
  599. return $this->authenticate('ListActivityTypes', $opt);
  600. }
  601. /**
  602. * Returns a list of closed workflow executions in the specified domain that meet the filtering
  603. * criteria. The results may be split into multiple pages. To retrieve subsequent pages, make the
  604. * call again using the nextPageToken returned by the initial call.
  605. *
  606. * <p class="note">
  607. * This operation is eventually consistent. The results are best effort and may not exactly
  608. * reflect recent updates and changes.
  609. * </p>
  610. *
  611. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  612. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain that contains the workflow executions to list.</li>
  613. * <li><code>startTimeFilter</code> - <code>array</code> - Optional - If specified, the workflow executions are included in the returned results based on whether their start times are within the range specified by this filter. Also, if this parameter is specified, the returned results are ordered by their start times. <p class="note"> <code>startTimeFilter</code> and <code>closeTimeFilter</code> are mutually exclusive. You must specify one of these in a request but not both.</p> <ul>
  614. * <li><code>oldestDate</code> - <code>string</code> - Required - Specifies the oldest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  615. * <li><code>latestDate</code> - <code>string</code> - Optional - Specifies the latest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  616. * </ul></li>
  617. * <li><code>closeTimeFilter</code> - <code>array</code> - Optional - If specified, the workflow executions are included in the returned results based on whether their close times are within the range specified by this filter. Also, if this parameter is specified, the returned results are ordered by their close times. <p class="note"> <code>startTimeFilter</code> and <code>closeTimeFilter</code> are mutually exclusive. You must specify one of these in a request but not both.</p> <ul>
  618. * <li><code>oldestDate</code> - <code>string</code> - Required - Specifies the oldest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  619. * <li><code>latestDate</code> - <code>string</code> - Optional - Specifies the latest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  620. * </ul></li>
  621. * <li><code>executionFilter</code> - <code>array</code> - Optional - If specified, only workflow executions matching the workflow id specified in the filter are returned. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  622. * <li><code>workflowId</code> - <code>string</code> - Required - The workflowId to pass of match the criteria of this filter.</li>
  623. * </ul></li>
  624. * <li><code>closeStatusFilter</code> - <code>array</code> - Optional - If specified, only workflow executions that match this <em>close status</em> are listed. For example, if TERMINATED is specified, then only TERMINATED workflow executions are listed. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  625. * <li><code>status</code> - <code>string</code> - Required - The close status that must match the close status of an execution for it to meet the criteria of this filter. This field is required. [Allowed values: <code>COMPLETED</code>, <code>FAILED</code>, <code>CANCELED</code>, <code>TERMINATED</code>, <code>CONTINUED_AS_NEW</code>, <code>TIMED_OUT</code>]</li>
  626. * </ul></li>
  627. * <li><code>typeFilter</code> - <code>array</code> - Optional - If specified, only executions of the type specified in the filter are returned. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  628. * <li><code>name</code> - <code>string</code> - Required - Name of the workflow type. This field is required.</li>
  629. * <li><code>version</code> - <code>string</code> - Optional - Version of the workflow type.</li>
  630. * </ul></li>
  631. * <li><code>tagFilter</code> - <code>array</code> - Optional - If specified, only executions that have the matching tag are listed. <p class="note"> <code>closeStatusFilter</code>, <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  632. * <li><code>tag</code> - <code>string</code> - Required - Specifies the tag that must be associated with the execution for it to meet the filter criteria. This field is required.</li>
  633. * </ul></li>
  634. * <li><code>nextPageToken</code> - <code>string</code> - Optional - If on a previous call to this method a <code>NextPageToken</code> was returned, the results are being paginated. To get the next page of results, repeat the call with the returned token and all other arguments unchanged.</li>
  635. * <li><code>maximumPageSize</code> - <code>integer</code> - Optional - The maximum number of results returned in each page. The default is 100, but the caller can override this value to a page size <em>smaller</em> than the default. You cannot specify a page size greater than 100.</li>
  636. * <li><code>reverseOrder</code> - <code>boolean</code> - Optional - When set to <code>true</code>, returns the results in reverse order. By default the results are returned in descending order of the start or the close time of the executions.</li>
  637. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  638. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  639. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  640. */
  641. public function list_closed_workflow_executions($opt = null)
  642. {
  643. if (!$opt) $opt = array();
  644. $opt = json_encode($opt);
  645. return $this->authenticate('ListClosedWorkflowExecutions', $opt);
  646. }
  647. /**
  648. * Returns the list of domains registered in the account. The results may be split into multiple
  649. * pages. To retrieve subsequent pages, make the call again using the nextPageToken returned by
  650. * the initial call.
  651. *
  652. * <p class="note">
  653. * This operation is eventually consistent. The results are best effort and may not exactly
  654. * reflect recent updates and changes.
  655. * </p>
  656. *
  657. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  658. * <li><code>nextPageToken</code> - <code>string</code> - Optional - If on a previous call to this method a <code>NextPageToken</code> was returned, the result has more than one page. To get the next page of results, repeat the call with the returned token and all other arguments unchanged.</li>
  659. * <li><code>registrationStatus</code> - <code>string</code> - Required - Specifies the registration status of the domains to list. [Allowed values: <code>REGISTERED</code>, <code>DEPRECATED</code>]</li>
  660. * <li><code>maximumPageSize</code> - <code>integer</code> - Optional - The maximum number of results returned in each page. The default is 100, but the caller can override this value to a page size <em>smaller</em> than the default. You cannot specify a page size greater than 100.</li>
  661. * <li><code>reverseOrder</code> - <code>boolean</code> - Optional - When set to <code>true</code>, returns the results in reverse order. By default the results are returned in ascending alphabetical order of the <code>name</code> of the domains.</li>
  662. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  663. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  664. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  665. */
  666. public function list_domains($opt = null)
  667. {
  668. if (!$opt) $opt = array();
  669. $opt = json_encode($opt);
  670. return $this->authenticate('ListDomains', $opt);
  671. }
  672. /**
  673. * Returns a list of open workflow executions in the specified domain that meet the filtering
  674. * criteria. The results may be split into multiple pages. To retrieve subsequent pages, make the
  675. * call again using the nextPageToken returned by the initial call.
  676. *
  677. * <p class="note">
  678. * This operation is eventually consistent. The results are best effort and may not exactly
  679. * reflect recent updates and changes.
  680. * </p>
  681. *
  682. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  683. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain that contains the workflow executions to list.</li>
  684. * <li><code>startTimeFilter</code> - <code>array</code> - Required - Workflow executions are included in the returned results based on whether their start times are within the range specified by this filter. <ul>
  685. * <li><code>oldestDate</code> - <code>string</code> - Required - Specifies the oldest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  686. * <li><code>latestDate</code> - <code>string</code> - Optional - Specifies the latest start or close date and time to return. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
  687. * </ul></li>
  688. * <li><code>typeFilter</code> - <code>array</code> - Optional - If specified, only executions of the type specified in the filter are returned. <p class="note"> <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  689. * <li><code>name</code> - <code>string</code> - Required - Name of the workflow type. This field is required.</li>
  690. * <li><code>version</code> - <code>string</code> - Optional - Version of the workflow type.</li>
  691. * </ul></li>
  692. * <li><code>tagFilter</code> - <code>array</code> - Optional - If specified, only executions that have the matching tag are listed. <p class="note"> <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  693. * <li><code>tag</code> - <code>string</code> - Required - Specifies the tag that must be associated with the execution for it to meet the filter criteria. This field is required.</li>
  694. * </ul></li>
  695. * <li><code>nextPageToken</code> - <code>string</code> - Optional - If on a previous call to this method a <code>NextPageToken</code> was returned, the results are being paginated. To get the next page of results, repeat the call with the returned token and all other arguments unchanged.</li>
  696. * <li><code>maximumPageSize</code> - <code>integer</code> - Optional - The maximum number of results returned in each page. The default is 100, but the caller can override this value to a page size <em>smaller</em> than the default. You cannot specify a page size greater than 100.</li>
  697. * <li><code>reverseOrder</code> - <code>boolean</code> - Optional - When set to <code>true</code>, returns the results in reverse order. By default the results are returned in descending order of the start time of the executions.</li>
  698. * <li><code>executionFilter</code> - <code>array</code> - Optional - If specified, only workflow executions matching the workflow id specified in the filter are returned. <p class="note"> <code>executionFilter</code>, <code>typeFilter</code> and <code>tagFilter</code> are mutually exclusive. You can specify at most one of these in a request.</p> <ul>
  699. * <li><code>workflowId</code> - <code>string</code> - Required - The workflowId to pass of match the criteria of this filter.</li>
  700. * </ul></li>
  701. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  702. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  703. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  704. */
  705. public function list_open_workflow_executions($opt = null)
  706. {
  707. if (!$opt) $opt = array();
  708. $opt = json_encode($opt);
  709. return $this->authenticate('ListOpenWorkflowExecutions', $opt);
  710. }
  711. /**
  712. * Returns information about workflow types in the specified domain. The results may be split into
  713. * multiple pages that can be retrieved by making the call repeatedly.
  714. *
  715. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  716. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which the workflow types have been registered.</li>
  717. * <li><code>name</code> - <code>string</code> - Optional - If specified, lists the workflow type with this name.</li>
  718. * <li><code>registrationStatus</code> - <code>string</code> - Required - Specifies the registration status of the workflow types to list. [Allowed values: <code>REGISTERED</code>, <code>DEPRECATED</code>]</li>
  719. * <li><code>nextPageToken</code> - <code>string</code> - Optional - If on a previous call to this method a <code>NextPageToken</code> was returned, the results are being paginated. To get the next page of results, repeat the call with the returned token and all other arguments unchanged.</li>
  720. * <li><code>maximumPageSize</code> - <code>integer</code> - Optional - The maximum number of results returned in each page. The default is 100, but the caller can override this value to a page size <em>smaller</em> than the default. You cannot specify a page size greater than 100.</li>
  721. * <li><code>reverseOrder</code> - <code>boolean</code> - Optional - When set to <code>true</code>, returns the results in reverse order. By default the results are returned in ascending alphabetical order of the <code>name</code> of the workflow types.</li>
  722. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  723. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  724. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  725. */
  726. public function list_workflow_types($opt = null)
  727. {
  728. if (!$opt) $opt = array();
  729. $opt = json_encode($opt);
  730. return $this->authenticate('ListWorkflowTypes', $opt);
  731. }
  732. /**
  733. * Used by workers to get an <code>ActivityTask</code> from the specified activity
  734. * <code>taskList</code>. This initiates a long poll, where the service holds the HTTP connection
  735. * open and responds as soon as a task becomes available. The maximum time the service holds on to
  736. * the request before responding is 60 seconds. If no task is available within 60 seconds, the
  737. * poll will return an empty result. An empty result, in this context, means that an ActivityTask
  738. * is returned, but that the value of taskToken is an empty string. If a task is returned, the
  739. * worker should use its type to identify and process it correctly.
  740. *
  741. * <p class="important">
  742. * Workers should set their client side socket timeout to at least 70 seconds (10 seconds higher
  743. * than the maximum time service may hold the poll request).
  744. * </p>
  745. *
  746. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  747. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain that contains the task lists being polled.</li>
  748. * <li><code>taskList</code> - <code>array</code> - Required - Specifies the task list to poll for activity tasks. The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn". <ul>
  749. * <li><code>name</code> - <code>string</code> - Required - The name of the task list.</li>
  750. * </ul></li>
  751. * <li><code>identity</code> - <code>string</code> - Optional - Identity of the worker making the request, which is recorded in the <code>ActivityTaskStarted</code> event in the workflow history. This enables diagnostic tracing when problems arise. The form of this identity is user defined.</li>
  752. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  753. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  754. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  755. */
  756. public function poll_for_activity_task($opt = null)
  757. {
  758. if (!$opt) $opt = array();
  759. $opt = json_encode($opt);
  760. return $this->authenticate('PollForActivityTask', $opt);
  761. }
  762. /**
  763. * Used by deciders to get a <code>DecisionTask</code> from the specified decision
  764. * <code>taskList</code>. A decision task may be returned for any open workflow execution that is
  765. * using the specified task list. The task includes a paginated view of the history of the
  766. * workflow execution. The decider should use the workflow type and the history to determine how
  767. * to properly handle the task.
  768. *
  769. * This action initiates a long poll, where the service holds the HTTP connection open and
  770. * responds as soon a task becomes available. If no decision task is available in the specified
  771. * task list before the timeout of 60 seconds expires, an empty result is returned. An empty
  772. * result, in this context, means that a DecisionTask is returned, but that the value of taskToken
  773. * is an empty string.
  774. *
  775. * <p class="important">
  776. * Deciders should set their client side socket timeout to at least 70 seconds (10 seconds higher
  777. * than the timeout).
  778. * </p>
  779. * <p class="important">
  780. * Because the number of workflow history events for a single workflow execution might be very
  781. * large, the result returned might be split up across a number of pages. To retrieve subsequent
  782. * pages, make additional calls to <code>PollForDecisionTask</code> using the
  783. * <code>nextPageToken</code> returned by the initial call. Note that you do <strong>not</strong>
  784. * call <code>GetWorkflowExecutionHistory</code> with this <code>nextPageToken</code>. Instead,
  785. * call <code>PollForDecisionTask</code> again.
  786. * </p>
  787. *
  788. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  789. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain containing the task lists to poll.</li>
  790. * <li><code>taskList</code> - <code>array</code> - Required - Specifies the task list to poll for decision tasks. The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn". <ul>
  791. * <li><code>name</code> - <code>string</code> - Required - The name of the task list.</li>
  792. * </ul></li>
  793. * <li><code>identity</code> - <code>string</code> - Optional - Identity of the decider making the request, which is recorded in the DecisionTaskStarted event in the workflow history. This enables diagnostic tracing when problems arise. The form of this identity is user defined.</li>
  794. * <li><code>nextPageToken</code> - <code>string</code> - Optional - If on a previous call to this method a <code>NextPageToken</code> was returned, the results are being paginated. To get the next page of results, repeat the call with the returned token and all other arguments unchanged. <p class="note">The <code>nextPageToken</code> returned by this action cannot be used with <code>GetWorkflowExecutionHistory</code> to get the next page. You must call <code>PollForDecisionTask</code> again (with the <code>nextPageToken</code>) to retrieve the next page of history records. Calling <code>PollForDecisionTask</code> with a <code>nextPageToken</code> will not return a new decision task.</p> .</li>
  795. * <li><code>maximumPageSize</code> - <code>integer</code> - Optional - The maximum number of history events returned in each page. The default is 100, but the caller can override this value to a page size <em>smaller</em> than the default. You cannot specify a page size greater than 100.</li>
  796. * <li><code>reverseOrder</code> - <code>boolean</code> - Optional - When set to <code>true</code>, returns the events in reverse order. By default the results are returned in ascending order of the <code>eventTimestamp</code> of the events.</li>
  797. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  798. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  799. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  800. */
  801. public function poll_for_decision_task($opt = null)
  802. {
  803. if (!$opt) $opt = array();
  804. $opt = json_encode($opt);
  805. return $this->authenticate('PollForDecisionTask', $opt);
  806. }
  807. /**
  808. * Used by activity workers to report to the service that the <code>ActivityTask</code>
  809. * represented by the specified <code>taskToken</code> is still making progress. The worker can
  810. * also (optionally) specify details of the progress, for example percent complete, using the
  811. * <code>details</code> parameter. This action can also be used by the worker as a mechanism to
  812. * check if cancellation is being requested for the activity task. If a cancellation is being
  813. * attempted for the specified task, then the boolean <code>cancelRequested</code> flag returned
  814. * by the service is set to <code>true</code>.
  815. *
  816. * This action resets the <code>taskHeartbeatTimeout</code> clock. The
  817. * <code>taskHeartbeatTimeout</code> is specified in <code>RegisterActivityType</code>.
  818. *
  819. * This action does not in itself create an event in the workflow execution history. However, if
  820. * the task times out, the workflow execution history will contain a
  821. * <code>ActivityTaskTimedOut</code> event that contains the information from the last heartbeat
  822. * generated by the activity worker.
  823. *
  824. * <p class="note">
  825. * The <code>taskStartToCloseTimeout</code> of an activity type is the maximum duration of an
  826. * activity task, regardless of the number of <code>RecordActivityTaskHeartbeat</code> requests
  827. * received. The <code>taskStartToCloseTimeout</code> is also specified in
  828. * <code>RegisterActivityType</code>.
  829. * </p>
  830. * <p class="note">
  831. * This operation is only useful for long-lived activities to report liveliness of the task and to
  832. * determine if a cancellation is being attempted.
  833. * </p>
  834. * <p class="important">
  835. * If the <code>cancelRequested</code> flag returns <code>true</code>, a cancellation is being
  836. * attempted. If the worker can cancel the activity, it should respond with
  837. * <code>RespondActivityTaskCanceled</code>. Otherwise, it should ignore the cancellation request.
  838. * </p>
  839. *
  840. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  841. * <li><code>taskToken</code> - <code>string</code> - Required - The <code>taskToken</code> of the <code>ActivityTask</code>. <p class="important">The <code>taskToken</code> is generated by the service and should be treated as an opaque value. If the task is passed to another process, its <code>taskToken</code> must also be passed. This enables it to provide its progress and respond with results.</p></li>
  842. * <li><code>details</code> - <code>string</code> - Optional - If specified, contains details about the progress of the task.</li>
  843. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  844. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  845. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  846. */
  847. public function record_activity_task_heartbeat($opt = null)
  848. {
  849. if (!$opt) $opt = array();
  850. $opt = json_encode($opt);
  851. return $this->authenticate('RecordActivityTaskHeartbeat', $opt);
  852. }
  853. /**
  854. * Registers a new <em>activity type</em> along with its configuration settings in the specified
  855. * domain.
  856. *
  857. * <p class="important">
  858. * A <code>TypeAlreadyExists</code> fault is returned if the type already exists in the domain.
  859. * You cannot change any configuration settings of the type after its registration, and it must be
  860. * registered as a new version.
  861. * </p>
  862. *
  863. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  864. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which this activity is to be registered.</li>
  865. * <li><code>name</code> - <code>string</code> - Required - The name of the activity type within the domain. The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn".</li>
  866. * <li><code>version</code> - <code>string</code> - Required - The version of the activity type. <p class="note">The activity type consists of the name and version, the combination of which must be unique within the domain.</p> The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn".</li>
  867. * <li><code>description</code> - <code>string</code> - Optional - A textual description of the activity type.</li>
  868. * <li><code>defaultTaskStartToCloseTimeout</code> - <code>string</code> - Optional - If set, specifies the default maximum duration that a worker can take to process tasks of this activity type. This default can be overridden when scheduling an activity task using the <code>ScheduleActivityTask</code> <code>Decision</code>. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration.</li>
  869. * <li><code>defaultTaskHeartbeatTimeout</code> - <code>string</code> - Optional - If set, specifies the default maximum time before which a worker processing a task of this type must report progress by calling <code>RecordActivityTaskHeartbeat</code>. If the timeout is exceeded, the activity task is automatically timed out. This default can be overridden when scheduling an activity task using the <code>ScheduleActivityTask</code> <code>Decision</code>. If the activity worker subsequently attempts to record a heartbeat or returns a result, the activity worker receives an <code>UnknownResource</code> fault. In this case, Amazon SWF no longer considers the activity task to be valid; the activity worker should clean up the activity task. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration.</li>
  870. * <li><code>defaultTaskList</code> - <code>array</code> - Optional - If set, specifies the default task list to use for scheduling tasks of this activity type. This default task list is used if a task list is not provided when a task is scheduled through the <code>ScheduleActivityTask</code> <code>Decision</code>. <ul>
  871. * <li><code>name</code> - <code>string</code> - Required - The name of the task list.</li>
  872. * </ul></li>
  873. * <li><code>defaultTaskScheduleToStartTimeout</code> - <code>string</code> - Optional - If set, specifies the default maximum duration that a task of this activity type can wait before being assigned to a worker. This default can be overridden when scheduling an activity task using the <code>ScheduleActivityTask</code> <code>Decision</code>. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration.</li>
  874. * <li><code>defaultTaskScheduleToCloseTimeout</code> - <code>string</code> - Optional - If set, specifies the default maximum duration for a task of this activity type. This default can be overridden when scheduling an activity task using the <code>ScheduleActivityTask</code> <code>Decision</code>. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration.</li>
  875. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  876. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  877. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  878. */
  879. public function register_activity_type($opt = null)
  880. {
  881. if (!$opt) $opt = array();
  882. $opt = json_encode($opt);
  883. return $this->authenticate('RegisterActivityType', $opt);
  884. }
  885. /**
  886. * Registers a new domain.
  887. *
  888. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  889. * <li><code>name</code> - <code>string</code> - Required - Name of the domain to register. The name must be unique. The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn".</li>
  890. * <li><code>description</code> - <code>string</code> - Optional - Textual description of the domain.</li>
  891. * <li><code>workflowExecutionRetentionPeriodInDays</code> - <code>string</code> - Required - Specifies the duration-- <strong><em>in days</em></strong> --for which the record (including the history) of workflow executions in this domain should be kept by the service. After the retention period, the workflow execution will not be available in the results of visibility calls. If a duration of <code>NONE</code> is specified, the records for workflow executions in this domain are not retained at all.</li>
  892. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  893. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  894. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  895. */
  896. public function register_domain($opt = null)
  897. {
  898. if (!$opt) $opt = array();
  899. $opt = json_encode($opt);
  900. return $this->authenticate('RegisterDomain', $opt);
  901. }
  902. /**
  903. * Registers a new <em>workflow type</em> and its configuration settings in the specified domain.
  904. *
  905. * <p class="important">
  906. * If the type already exists, then a <code>TypeAlreadyExists</code> fault is returned. You cannot
  907. * change the configuration settings of a workflow type once it is registered and it must be
  908. * registered as a new version.
  909. * </p>
  910. *
  911. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  912. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which to register the workflow type.</li>
  913. * <li><code>name</code> - <code>string</code> - Required - The name of the workflow type. The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn".</li>
  914. * <li><code>version</code> - <code>string</code> - Required - The version of the workflow type. <p class="note">The workflow type consists of the name and version, the combination of which must be unique within the domain. To get a list of all currently registered workflow types, use the <code>ListWorkflowTypes</code> action.</p> The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn".</li>
  915. * <li><code>description</code> - <code>string</code> - Optional - Textual description of the workflow type.</li>
  916. * <li><code>defaultTaskStartToCloseTimeout</code> - <code>string</code> - Optional - If set, specifies the default maximum duration of decision tasks for this workflow type. This default can be overridden when starting a workflow execution using the <code>StartWorkflowExecution</code> action or the <code>StartChildWorkflowExecution</code> <code>Decision</code>. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration.</li>
  917. * <li><code>defaultExecutionStartToCloseTimeout</code> - <code>string</code> - Optional - If set, specifies the default maximum duration for executions of this workflow type. You can override this default when starting an execution through the <code>StartWorkflowExecution</code> Action or <code>StartChildWorkflowExecution</code> <code>Decision</code>. The duration is specified in seconds. The valid values are integers greater than or equal to 0. Unlike some of the other timeout parameters in Amazon SWF, you cannot specify a value of "NONE" for <code>defaultExecutionStartToCloseTimeout</code>; there is a one-year max limit on the time that a workflow execution can run. Exceeding this limit will always cause the workflow execution to time out.</li>
  918. * <li><code>defaultTaskList</code> - <code>array</code> - Optional - If set, specifies the default task list to use for scheduling decision tasks for executions of this workflow type. This default is used only if a task list is not provided when starting the execution through the <code>StartWorkflowExecution</code> Action or <code>StartChildWorkflowExecution</code> <code>Decision</code>. <ul>
  919. * <li><code>name</code> - <code>string</code> - Required - The name of the task list.</li>
  920. * </ul></li>
  921. * <li><code>defaultChildPolicy</code> - <code>string</code> - Optional - If set, specifies the default policy to use for the child workflow executions when a workflow execution of this type is terminated, by calling the <code>TerminateWorkflowExecution</code> action explicitly or due to an expired timeout. This default can be overridden when starting a workflow execution using the <code>StartWorkflowExecution</code> action or the <code>StartChildWorkflowExecution</code> <code>Decision</code>. The supported child policies are:<ul><li> <strong>TERMINATE:</strong> the child executions will be terminated.</li><li> <strong>REQUEST_CANCEL:</strong> a request to cancel will be attempted for each child execution by recording a <code>WorkflowExecutionCancelRequested</code> event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.</li><li> <strong>ABANDON:</strong> no action will be taken. The child executions will continue to run.</li></ul> [Allowed values: <code>TERMINATE</code>, <code>REQUEST_CANCEL</code>, <code>ABANDON</code>]</li>
  922. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  923. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  924. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  925. */
  926. public function register_workflow_type($opt = null)
  927. {
  928. if (!$opt) $opt = array();
  929. $opt = json_encode($opt);
  930. return $this->authenticate('RegisterWorkflowType', $opt);
  931. }
  932. /**
  933. * Records a <code>WorkflowExecutionCancelRequested</code> event in the currently running workflow
  934. * execution identified by the given domain, workflowId, and runId. This logically requests the
  935. * cancellation of the workflow execution as a whole. It is up to the decider to take appropriate
  936. * actions when it receives an execution history with this event.
  937. *
  938. * <p class="note">
  939. * If the runId is not specified, the <code>WorkflowExecutionCancelRequested</code> event is
  940. * recorded in the history of the current open workflow execution with the specified workflowId in
  941. * the domain.
  942. * </p>
  943. * <p class="note">
  944. * Because this action allows the workflow to properly clean up and gracefully close, it should be
  945. * used instead of <code>TerminateWorkflowExecution</code> when possible.
  946. * </p>
  947. *
  948. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  949. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain containing the workflow execution to cancel.</li>
  950. * <li><code>workflowId</code> - <code>string</code> - Required - The workflowId of the workflow execution to cancel.</li>
  951. * <li><code>runId</code> - <code>string</code> - Optional - The runId of the workflow execution to cancel.</li>
  952. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  953. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  954. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  955. */
  956. public function request_cancel_workflow_execution($opt = null)
  957. {
  958. if (!$opt) $opt = array();
  959. $opt = json_encode($opt);
  960. return $this->authenticate('RequestCancelWorkflowExecution', $opt);
  961. }
  962. /**
  963. * Used by workers to tell the service that the <code>ActivityTask</code> identified by the
  964. * <code>taskToken</code> was successfully canceled. Additional <code>details</code> can be
  965. * optionally provided using the <code>details</code> argument.
  966. *
  967. * These <code>details</code> (if provided) appear in the <code>ActivityTaskCanceled</code> event
  968. * added to the workflow history.
  969. *
  970. * <p class="important">
  971. * Only use this operation if the <code>canceled</code> flag of a
  972. * <code>RecordActivityTaskHeartbeat</code> request returns <code>true</code> and if the activity
  973. * can be safely undone or abandoned.
  974. * </p>
  975. *
  976. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  977. * <li><code>taskToken</code> - <code>string</code> - Required - The <code>taskToken</code> of the <code>ActivityTask</code>. <p class="important">The <code>taskToken</code> is generated by the service and should be treated as an opaque value. If the task is passed to another process, its <code>taskToken</code> must also be passed. This enables it to provide its progress and respond with results.</p></li>
  978. * <li><code>details</code> - <code>string</code> - Optional - Optional information about the cancellation.</li>
  979. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  980. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  981. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  982. */
  983. public function respond_activity_task_canceled($opt = null)
  984. {
  985. if (!$opt) $opt = array();
  986. $opt = json_encode($opt);
  987. return $this->authenticate('RespondActivityTaskCanceled', $opt);
  988. }
  989. /**
  990. * Used by workers to tell the service that the <code>ActivityTask</code> identified by the
  991. * <code>taskToken</code> completed successfully with a <code>result</code> (if provided).
  992. *
  993. * The <code>result</code> appears in the <code>ActivityTaskCompleted</code> event in the workflow
  994. * history.
  995. *
  996. * <p class="important">
  997. * If the requested task does not complete successfully, use
  998. * <code>RespondActivityTaskFailed</code> instead. If the worker finds that the task is canceled
  999. * through the <code>canceled</code> flag returned by <code>RecordActivityTaskHeartbeat</code>, it
  1000. * should cancel the task, clean up and then call <code>RespondActivityTaskCanceled</code>.
  1001. * </p>
  1002. *
  1003. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  1004. * <li><code>taskToken</code> - <code>string</code> - Required - The <code>taskToken</code> of the <code>ActivityTask</code>. <p class="important">The <code>taskToken</code> is generated by the service and should be treated as an opaque value. If the task is passed to another process, its <code>taskToken</code> must also be passed. This enables it to provide its progress and respond with results.</p></li>
  1005. * <li><code>result</code> - <code>string</code> - Optional - The result of the activity task. It is a free form string that is implementation specific.</li>
  1006. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  1007. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  1008. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  1009. */
  1010. public function respond_activity_task_completed($opt = null)
  1011. {
  1012. if (!$opt) $opt = array();
  1013. $opt = json_encode($opt);
  1014. return $this->authenticate('RespondActivityTaskCompleted', $opt);
  1015. }
  1016. /**
  1017. * Used by workers to tell the service that the <code>ActivityTask</code> identified by the
  1018. * <code>taskToken</code> has failed with <code>reason</code> (if specified).
  1019. *
  1020. * The <code>reason</code> and <code>details</code> appear in the <code>ActivityTaskFailed</code>
  1021. * event added to the workflow history.
  1022. *
  1023. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  1024. * <li><code>taskToken</code> - <code>string</code> - Required - The <code>taskToken</code> of the <code>ActivityTask</code>. <p class="important">The <code>taskToken</code> is generated by the service and should be treated as an opaque value. If the task is passed to another process, its <code>taskToken</code> must also be passed. This enables it to provide its progress and respond with results.</p></li>
  1025. * <li><code>reason</code> - <code>string</code> - Optional - Description of the error that may assist in diagnostics.</li>
  1026. * <li><code>details</code> - <code>string</code> - Optional - Optional detailed information about the failure.</li>
  1027. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  1028. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  1029. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  1030. */
  1031. public function respond_activity_task_failed($opt = null)
  1032. {
  1033. if (!$opt) $opt = array();
  1034. $opt = json_encode($opt);
  1035. return $this->authenticate('RespondActivityTaskFailed', $opt);
  1036. }
  1037. /**
  1038. * Used by deciders to tell the service that the <code>DecisionTask</code> identified by the
  1039. * <code>taskToken</code> has successfully completed. The <code>decisions</code> argument
  1040. * specifies the list of decisions made while processing the task.
  1041. *
  1042. * A <code>DecisionTaskCompleted</code> event is added to the workflow history. The
  1043. * <code>executionContext</code> specified is attached to the event in the workflow execution
  1044. * history.
  1045. *
  1046. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  1047. * <li><code>taskToken</code> - <code>string</code> - Required - The <code>taskToken</code> from the <code>DecisionTask</code>. <p class="important">The <code>taskToken</code> is generated by the service and should be treated as an opaque value. If the task is passed to another process, its <code>taskToken</code> must also be passed. This enables it to provide its progress and respond with results.</p></li>
  1048. * <li><code>decisions</code> - <code>array</code> - Optional - The list of decisions (possibly empty) made by the decider while processing this decision task. See the docs for the <code>Decision</code> structure for details. <ul>
  1049. * <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
  1050. * <li><code>decisionType</code> - <code>string</code> - Required - Specifies the type of the decision. [Allowed values: <code>ScheduleActivityTask</code>, <code>RequestCancelActivityTask</code>, <code>CompleteWorkflowExecution</code>, <code>FailWorkflowExecution</code>, <code>CancelWorkflowExecution</code>, <code>ContinueAsNewWorkflowExecution</code>, <code>RecordMarker</code>, <code>StartTimer</code>, <code>CancelTimer</code>, <code>SignalExternalWorkflowExecution</code>, <code>RequestCancelExternalWorkflowExecution</code>, <code>StartChildWorkflowExecution</code>]</li>
  1051. * <li><code>scheduleActivityTaskDecisionAttributes</code> - <code>array</code> - Optional - Provides details of the <code>ScheduleActivityTask</code> decision. It is not set for other decision types. <ul>
  1052. * <li><code>activityType</code> - <code>array</code> - Required - The type of the activity task to schedule. This field is required. <ul>
  1053. * <li><code>name</code> - <code>string</code> - Required - The name of this activity. <p class="note">The combination of activity type name and version must be unique within a domain.</p></li>
  1054. * <li><code>version</code> - <code>string</code> - Required - The version of this activity. <p class="note">The combination of activity type name and version must be unique with in a domain.</p></li>
  1055. * </ul></li>
  1056. * <li><code>activityId</code> - <code>string</code> - Required - The <code>activityId</code> of the activity task. This field is required. The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn".</li>
  1057. * <li><code>control</code> - <code>string</code> - Optional - Optional data attached to the event that can be used by the decider in subsequent workflow tasks. This data is not sent to the activity.</li>
  1058. * <li><code>input</code> - <code>string</code> - Optional - The input provided to the activity task.</li>
  1059. * <li><code>scheduleToCloseTimeout</code> - <code>string</code> - Optional - The maximum duration for this activity task. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration. <p class="note">A schedule-to-close timeout for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default schedule-to-close timeout was specified at registration time then a fault will be returned.</p></li>
  1060. * <li><code>taskList</code> - <code>array</code> - Optional - If set, specifies the name of the task list in which to schedule the activity task. If not specified, the <code>defaultTaskList</code> registered with the activity type will be used. <p class="note">A task list for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default task list was specified at registration time then a fault will be returned.</p> The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn". <ul>
  1061. * <li><code>name</code> - <code>string</code> - Required - The name of the task list.</li>
  1062. * </ul></li>
  1063. * <li><code>scheduleToStartTimeout</code> - <code>string</code> - Optional - If set, specifies the maximum duration the activity task can wait to be assigned to a worker. This overrides the default schedule-to-start timeout specified when registering the activity type using <code>RegisterActivityType</code>. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration. <p class="note">A schedule-to-start timeout for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default schedule-to-start timeout was specified at registration time then a fault will be returned.</p></li>
  1064. * <li><code>startToCloseTimeout</code> - <code>string</code> - Optional - If set, specifies the maximum duration a worker may take to process this activity task. This overrides the default start-to-close timeout specified when registering the activity type using <code>RegisterActivityType</code>. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration. <p class="note">A start-to-close timeout for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default start-to-close timeout was specified at registration time then a fault will be returned.</p></li>
  1065. * <li><code>heartbeatTimeout</code> - <code>string</code> - Optional - If set, specifies the maximum time before which a worker processing a task of this type must report progress by calling <code>RecordActivityTaskHeartbeat</code>. If the timeout is exceeded, the activity task is automatically timed out. If the worker subsequently attempts to record a heartbeat or returns a result, it will be ignored. This overrides the default heartbeat timeout specified when registering the activity type using <code>RegisterActivityType</code>. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration.</li>
  1066. * </ul></li>
  1067. * <li><code>requestCancelActivityTaskDecisionAttributes</code> - <code>array</code> - Optional - Provides details of the <code>RequestCancelActivityTask</code> decision. It is not set for other decision types. <ul>
  1068. * <li><code>activityId</code> - <code>string</code> - Required - The <code>activityId</code> of the activity task to be canceled.</li>
  1069. * </ul></li>
  1070. * <li><code>completeWorkflowExecutionDecisionAttributes</code> - <code>array</code> - Optional - Provides details of the <code>CompleteWorkflowExecution</code> decision. It is not set for other decision types. <ul>
  1071. * <li><code>result</code> - <code>string</code> - Optional - The result of the workflow execution. The form of the result is implementation defined.</li>
  1072. * </ul></li>
  1073. * <li><code>failWorkflowExecutionDecisionAttributes</code> - <code>array</code> - Optional - Provides details of the <code>FailWorkflowExecution</code> decision. It is not set for other decision types. <ul>
  1074. * <li><code>reason</code> - <code>string</code> - Optional - A descriptive reason for the failure that may help in diagnostics.</li>
  1075. * <li><code>details</code> - <code>string</code> - Optional - Optional details of the failure.</li>
  1076. * </ul></li>
  1077. * <li><code>cancelWorkflowExecutionDecisionAttributes</code> - <code>array</code> - Optional - Provides details of the <code>CancelWorkflowExecution</code> decision. It is not set for other decision types. <ul>
  1078. * <li><code>details</code> - <code>string</code> - Optional - Optional details of the cancellation.</li>
  1079. * </ul></li>
  1080. * <li><code>continueAsNewWorkflowExecutionDecisionAttributes</code> - <code>array</code> - Optional - Provides details of the <code>ContinueAsNewWorkflowExecution</code> decision. It is not set for other decision types. <ul>
  1081. * <li><code>input</code> - <code>string</code> - Optional - The input provided to the new workflow execution.</li>
  1082. * <li><code>executionStartToCloseTimeout</code> - <code>string</code> - Optional - If set, specifies the total duration for this workflow execution. This overrides the <code>defaultExecutionStartToCloseTimeout</code> specified when registering the workflow type. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration. <p class="note">An execution start-to-close timeout for this workflow execution must be specified either as a default for the workflow type or through this field. If neither this field is set nor a default execution start-to-close timeout was specified at registration time then a fault will be returned.</p></li>
  1083. * <li><code>taskList</code> - <code>array</code> - Optional - Represents a task list. <ul>
  1084. * <li><code>name</code> - <code>string</code> - Required - The name of the task list.</li>
  1085. * </ul></li>
  1086. * <li><code>taskStartToCloseTimeout</code> - <code>string</code> - Optional - Specifies the maximum duration of decision tasks for the new workflow execution. This parameter overrides the <code>defaultTaskStartToCloseTimout</code> specified when registering the workflow type using <code>RegisterWorkflowType</code>. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration. <p class="note">A task start-to-close timeout for the new workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task start-to-close timeout was specified at registration time then a fault will be returned.</p></li>
  1087. * <li><code>childPolicy</code> - <code>string</code> - Optional - If set, specifies the policy to use for the child workflow executions of the new execution if it is terminated by calling the <code>TerminateWorkflowExecution</code> action explicitly or due to an expired timeout. This policy overrides the default child policy specified when registering the workflow type using <code>RegisterWorkflowType</code>. The supported child policies are:<ul><li> <strong>TERMINATE:</strong> the child executions will be terminated.</li><li> <strong>REQUEST_CANCEL:</strong> a request to cancel will be attempted for each child execution by recording a <code>WorkflowExecutionCancelRequested</code> event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.</li><li> <strong>ABANDON:</strong> no action will be taken. The child executions will continue to run.</li></ul> <p class="note">A child policy for the new workflow execution must be specified either as a default registered for its workflow type or through this field. If neither this field is set nor a default child policy was specified at registration time then a fault will be returned.</p> [Allowed values: <code>TERMINATE</code>, <code>REQUEST_CANCEL</code>, <code>ABANDON</code>]</li>
  1088. * <li><code>tagList</code> - <code>string|array</code> - Optional - The list of tags to associate with the new workflow execution. A maximum of 5 tags can be specified. You can list workflow executions with a specific tag by calling <code>ListOpenWorkflowExecutions</code> or <code>ListClosedWorkflowExecutions</code> and specifying a <code>TagFilter</code>. Pass a string for a single value, or an indexed array for multiple values.</li>
  1089. * <li><code>workflowTypeVersion</code> - <code>string</code> - Optional - </li>
  1090. * </ul></li>
  1091. * <li><code>recordMarkerDecisionAttributes</code> - <code>array</code> - Optional - Provides details of the <code>RecordMarker</code> decision. It is not set for other decision types. <ul>
  1092. * <li><code>markerName</code> - <code>string</code> - Required - The name of the marker. This filed is required.</li>
  1093. * <li><code>details</code> - <code>string</code> - Optional - Optional details of the marker.</li>
  1094. * </ul></li>
  1095. * <li><code>startTimerDecisionAttributes</code> - <code>array</code> - Optional - Provides details of the <code>StartTimer</code> decision. It is not set for other decision types. <ul>
  1096. * <li><code>timerId</code> - <code>string</code> - Required - The unique Id of the timer. This field is required. The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn".</li>
  1097. * <li><code>control</code> - <code>string</code> - Optional - Optional data attached to the event that can be used by the decider in subsequent workflow tasks.</li>
  1098. * <li><code>startToFireTimeout</code> - <code>string</code> - Required - The duration to wait before firing the timer. This field is required. The duration is specified in seconds. The valid values are integers greater than or equal to 0.</li>
  1099. * </ul></li>
  1100. * <li><code>cancelTimerDecisionAttributes</code> - <code>array</code> - Optional - Provides details of the <code>CancelTimer</code> decision. It is not set for other decision types. <ul>
  1101. * <li><code>timerId</code> - <code>string</code> - Required - The unique Id of the timer to cancel. This field is required.</li>
  1102. * </ul></li>
  1103. * <li><code>signalExternalWorkflowExecutionDecisionAttributes</code> - <code>array</code> - Optional - Provides details of the <code>SignalExternalWorkflowExecution</code> decision. It is not set for other decision types. <ul>
  1104. * <li><code>workflowId</code> - <code>string</code> - Required - The <code>workflowId</code> of the workflow execution to be signaled. This field is required.</li>
  1105. * <li><code>runId</code> - <code>string</code> - Optional - The <code>runId</code> of the workflow execution to be signaled.</li>
  1106. * <li><code>signalName</code> - <code>string</code> - Required - The name of the signal.The target workflow execution will use the signal name and input to process the signal. This field is required.</li>
  1107. * <li><code>input</code> - <code>string</code> - Optional - Optional input to be provided with the signal.The target workflow execution will use the signal name and input to process the signal.</li>
  1108. * <li><code>control</code> - <code>string</code> - Optional - Optional data attached to the event that can be used by the decider in subsequent decision tasks.</li>
  1109. * </ul></li>
  1110. * <li><code>requestCancelExternalWorkflowExecutionDecisionAttributes</code> - <code>array</code> - Optional - Provides details of the <code>RequestCancelExternalWorkflowExecution</code> decision. It is not set for other decision types. <ul>
  1111. * <li><code>workflowId</code> - <code>string</code> - Required - The <code>workflowId</code> of the external workflow execution to cancel. This field is required.</li>
  1112. * <li><code>runId</code> - <code>string</code> - Optional - The <code>runId</code> of the external workflow execution to cancel.</li>
  1113. * <li><code>control</code> - <code>string</code> - Optional - Optional data attached to the event that can be used by the decider in subsequent workflow tasks.</li>
  1114. * </ul></li>
  1115. * <li><code>startChildWorkflowExecutionDecisionAttributes</code> - <code>array</code> - Optional - Provides details of the <code>StartChildWorkflowExecution</code> decision. It is not set for other decision types. <ul>
  1116. * <li><code>workflowType</code> - <code>array</code> - Required - The type of the workflow execution to be started. This field is required. <ul>
  1117. * <li><code>name</code> - <code>string</code> - Required - The name of the workflow type. This field is required. <p class="note">The combination of workflow type name and version must be unique with in a domain.</p></li>
  1118. * <li><code>version</code> - <code>string</code> - Required - The version of the workflow type. This field is required. <p class="note">The combination of workflow type name and version must be unique with in a domain.</p></li>
  1119. * </ul></li>
  1120. * <li><code>workflowId</code> - <code>string</code> - Required - The <code>workflowId</code> of the workflow execution. This field is required. The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn".</li>
  1121. * <li><code>control</code> - <code>string</code> - Optional - Optional data attached to the event that can be used by the decider in subsequent workflow tasks. This data is not sent to the child workflow execution.</li>
  1122. * <li><code>input</code> - <code>string</code> - Optional - The input to be provided to the workflow execution.</li>
  1123. * <li><code>executionStartToCloseTimeout</code> - <code>string</code> - Optional - The total duration for this workflow execution. This overrides the defaultExecutionStartToCloseTimeout specified when registering the workflow type. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration. <p class="note">An execution start-to-close timeout for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default execution start-to-close timeout was specified at registration time then a fault will be returned.</p></li>
  1124. * <li><code>taskList</code> - <code>array</code> - Optional - The name of the task list to be used for decision tasks of the child workflow execution. <p class="note">A task list for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task list was specified at registration time then a fault will be returned.</p> The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn". <ul>
  1125. * <li><code>name</code> - <code>string</code> - Required - The name of the task list.</li>
  1126. * </ul></li>
  1127. * <li><code>taskStartToCloseTimeout</code> - <code>string</code> - Optional - Specifies the maximum duration of decision tasks for this workflow execution. This parameter overrides the <code>defaultTaskStartToCloseTimout</code> specified when registering the workflow type using <code>RegisterWorkflowType</code>. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration. <p class="note">A task start-to-close timeout for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task start-to-close timeout was specified at registration time then a fault will be returned.</p></li>
  1128. * <li><code>childPolicy</code> - <code>string</code> - Optional - If set, specifies the policy to use for the child workflow executions if the workflow execution being started is terminated by calling the <code>TerminateWorkflowExecution</code> action explicitly or due to an expired timeout. This policy overrides the default child policy specified when registering the workflow type using <code>RegisterWorkflowType</code>. The supported child policies are:<ul><li> <strong>TERMINATE:</strong> the child executions will be terminated.</li><li> <strong>REQUEST_CANCEL:</strong> a request to cancel will be attempted for each child execution by recording a <code>WorkflowExecutionCancelRequested</code> event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.</li><li> <strong>ABANDON:</strong> no action will be taken. The child executions will continue to run.</li></ul> <p class="note">A child policy for the workflow execution being started must be specified either as a default registered for its workflow type or through this field. If neither this field is set nor a default child policy was specified at registration time then a fault will be returned.</p> [Allowed values: <code>TERMINATE</code>, <code>REQUEST_CANCEL</code>, <code>ABANDON</code>]</li>
  1129. * <li><code>tagList</code> - <code>string|array</code> - Optional - The list of tags to associate with the child workflow execution. A maximum of 5 tags can be specified. You can list workflow executions with a specific tag by calling <code>ListOpenWorkflowExecutions</code> or <code>ListClosedWorkflowExecutions</code> and specifying a <code>TagFilter</code>. Pass a string for a single value, or an indexed array for multiple values.</li>
  1130. * </ul></li>
  1131. * </ul></li>
  1132. * </ul></li>
  1133. * <li><code>executionContext</code> - <code>string</code> - Optional - User defined context to add to workflow execution.</li>
  1134. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  1135. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  1136. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  1137. */
  1138. public function respond_decision_task_completed($opt = null)
  1139. {
  1140. if (!$opt) $opt = array();
  1141. // List (non-map)
  1142. if (isset($opt['decisions']))
  1143. {
  1144. $opt['decisions'] = (is_array($opt['decisions']) ? $opt['decisions'] : array($opt['decisions']));
  1145. }
  1146. $opt = json_encode($opt);
  1147. return $this->authenticate('RespondDecisionTaskCompleted', $opt);
  1148. }
  1149. /**
  1150. * Records a <code>WorkflowExecutionSignaled</code> event in the workflow execution history and
  1151. * creates a decision task for the workflow execution identified by the given domain, workflowId
  1152. * and runId. The event is recorded with the specified user defined signalName and input (if
  1153. * provided).
  1154. *
  1155. * <p class="note">
  1156. * If a runId is not specified, then the <code>WorkflowExecutionSignaled</code> event is recorded
  1157. * in the history of the current open workflow with the matching workflowId in the domain.
  1158. * </p>
  1159. * <p class="note">
  1160. * If the specified workflow execution is not open, this method fails with
  1161. * <code>UnknownResource</code>.
  1162. * </p>
  1163. *
  1164. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  1165. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain containing the workflow execution to signal.</li>
  1166. * <li><code>workflowId</code> - <code>string</code> - Required - The workflowId of the workflow execution to signal.</li>
  1167. * <li><code>runId</code> - <code>string</code> - Optional - The runId of the workflow execution to signal.</li>
  1168. * <li><code>signalName</code> - <code>string</code> - Required - The name of the signal. This name must be meaningful to the target workflow.</li>
  1169. * <li><code>input</code> - <code>string</code> - Optional - Data to attach to the <code>WorkflowExecutionSignaled</code> event in the target workflow execution's history.</li>
  1170. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  1171. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  1172. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  1173. */
  1174. public function signal_workflow_execution($opt = null)
  1175. {
  1176. if (!$opt) $opt = array();
  1177. $opt = json_encode($opt);
  1178. return $this->authenticate('SignalWorkflowExecution', $opt);
  1179. }
  1180. /**
  1181. * Starts an execution of the workflow type in the specified domain using the provided
  1182. * <code>workflowId</code> and input data.
  1183. *
  1184. * This action returns the newly started workflow execution.
  1185. *
  1186. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  1187. * <li><code>domain</code> - <code>string</code> - Required - The name of the domain in which the workflow execution is created.</li>
  1188. * <li><code>workflowId</code> - <code>string</code> - Required - The user defined identifier associated with the workflow execution. You can use this to associate a custom identifier with the workflow execution. You may specify the same identifier if a workflow execution is logically a <em>restart</em> of a previous execution. You cannot have two open workflow executions with the same <code>workflowId</code> at the same time. The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn".</li>
  1189. * <li><code>workflowType</code> - <code>array</code> - Required - The type of the workflow to start. <ul>
  1190. * <li><code>name</code> - <code>string</code> - Required - The name of the workflow type. This field is required. <p class="note">The combination of workflow type name and version must be unique with in a domain.</p></li>
  1191. * <li><code>version</code> - <code>string</code> - Required - The version of the workflow type. This field is required. <p class="note">The combination of workflow type name and version must be unique with in a domain.</p></li>
  1192. * </ul></li>
  1193. * <li><code>taskList</code> - <code>array</code> - Optional - The task list to use for the decision tasks generated for this workflow execution. This overrides the <code>defaultTaskList</code> specified when registering the workflow type. <p class="note">A task list for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task list was specified at registration time then a fault will be returned.</p> The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (\u0000-\u001f | \u007f - \u009f). Also, it must not contain the literal string "arn". <ul>
  1194. * <li><code>name</code> - <code>string</code> - Required - The name of the task list.</li>
  1195. * </ul></li>
  1196. * <li><code>input</code> - <code>string</code> - Optional - The input for the workflow execution. This is a free form string which should be meaningful to the workflow you are starting. This <code>input</code> is made available to the new workflow execution in the <code>WorkflowExecutionStarted</code> history event.</li>
  1197. * <li><code>executionStartToCloseTimeout</code> - <code>string</code> - Optional - The total duration for this workflow execution. This overrides the defaultExecutionStartToCloseTimeout specified when registering the workflow type. The duration is specified in seconds. The valid values are integers greater than or equal to 0. Exceeding this limit will cause the workflow execution to time out. Unlike some of the other timeout parameters in Amazon SWF, you cannot specify a value of "NONE" for this timeout; there is a one-year max limit on the time that a workflow execution can run. <p class="note">An execution start-to-close timeout must be specified either through this parameter or as a default when the workflow type is registered. If neither this parameter nor a default execution start-to-close timeout is specified, a fault is returned.</p></li>
  1198. * <li><code>tagList</code> - <code>string|array</code> - Optional - The list of tags to associate with the workflow execution. You can specify a maximum of 5 tags. You can list workflow executions with a specific tag by calling <code>ListOpenWorkflowExecutions</code> or <code>ListClosedWorkflowExecutions</code> and specifying a <code>TagFilter</code>. Pass a string for a single value, or an indexed array for multiple values.</li>
  1199. * <li><code>taskStartToCloseTimeout</code> - <code>string</code> - Optional - Specifies the maximum duration of decision tasks for this workflow execution. This parameter overrides the <code>defaultTaskStartToCloseTimout</code> specified when registering the workflow type using <code>RegisterWorkflowType</code>. The valid values are integers greater than or equal to <code>0</code>. An integer value can be used to specify the duration in seconds while <code>NONE</code> can be used to specify unlimited duration. <p class="note">A task start-to-close timeout for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default task start-to-close timeout was specified at registration time then a fault will be returned.</p></li>
  1200. * <li><code>childPolicy</code> - <code>string</code> - Optional - If set, specifies the policy to use for the child workflow executions of this workflow execution if it is terminated, by calling the <code>TerminateWorkflowExecution</code> action explicitly or due to an expired timeout. This policy overrides the default child policy specified when registering the workflow type using <code>RegisterWorkflowType</code>. The supported child policies are:<ul><li> <strong>TERMINATE:</strong> the child executions will be terminated.</li><li> <strong>REQUEST_CANCEL:</strong> a request to cancel will be attempted for each child execution by recording a <code>WorkflowExecutionCancelRequested</code> event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.</li><li> <strong>ABANDON:</strong> no action will be taken. The child executions will continue to run.</li></ul> <p class="note">A child policy for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default child policy was specified at registration time then a fault will be returned.</p> [Allowed values: <code>TERMINATE</code>, <code>REQUEST_CANCEL</code>, <code>ABANDON</code>]</li>
  1201. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  1202. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  1203. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  1204. */
  1205. public function start_workflow_execution($opt = null)
  1206. {
  1207. if (!$opt) $opt = array();
  1208. // List (non-map)
  1209. if (isset($opt['tagList']))
  1210. {
  1211. $opt['tagList'] = (is_array($opt['tagList']) ? $opt['tagList'] : array($opt['tagList']));
  1212. }
  1213. $opt = json_encode($opt);
  1214. return $this->authenticate('StartWorkflowExecution', $opt);
  1215. }
  1216. /**
  1217. * Records a <code>WorkflowExecutionTerminated</code> event and forces closure of the workflow
  1218. * execution identified by the given domain, runId, and workflowId. The child policy, registered
  1219. * with the workflow type or specified when starting this execution, is applied to any open child
  1220. * workflow executions of this workflow execution.
  1221. *
  1222. * <p class="important">
  1223. * If the identified workflow execution was in progress, it is terminated immediately.
  1224. * </p>
  1225. * <p class="note">
  1226. * If a runId is not specified, then the <code>WorkflowExecutionTerminated</code> event is
  1227. * recorded in the history of the current open workflow with the matching workflowId in the
  1228. * domain.
  1229. * </p>
  1230. * <p class="note">
  1231. * You should consider using <code>RequestCancelWorkflowExecution</code> action instead because it
  1232. * allows the workflow to gracefully close while <code>TerminateWorkflowExecution</code> does not.
  1233. * </p>
  1234. *
  1235. * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
  1236. * <li><code>domain</code> - <code>string</code> - Required - The domain of the workflow execution to terminate.</li>
  1237. * <li><code>workflowId</code> - <code>string</code> - Required - The workflowId of the workflow execution to terminate.</li>
  1238. * <li><code>runId</code> - <code>string</code> - Optional - The runId of the workflow execution to terminate.</li>
  1239. * <li><code>reason</code> - <code>string</code> - Optional - An optional descriptive reason for terminating the workflow execution.</li>
  1240. * <li><code>details</code> - <code>string</code> - Optional - Optional details for terminating the workflow execution.</li>
  1241. * <li><code>childPolicy</code> - <code>string</code> - Optional - If set, specifies the policy to use for the child workflow executions of the workflow execution being terminated. This policy overrides the child policy specified for the workflow execution at registration time or when starting the execution. The supported child policies are:<ul><li> <strong>TERMINATE:</strong> the child executions will be terminated.</li><li> <strong>REQUEST_CANCEL:</strong> a request to cancel will be attempted for each child execution by recording a <code>WorkflowExecutionCancelRequested</code> event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.</li><li> <strong>ABANDON:</strong> no action will be taken. The child executions will continue to run.</li></ul> <p class="note">A child policy for this workflow execution must be specified either as a default for the workflow type or through this parameter. If neither this parameter is set nor a default child policy was specified at registration time, a fault will be returned.</p> [Allowed values: <code>TERMINATE</code>, <code>REQUEST_CANCEL</code>, <code>ABANDON</code>]</li>
  1242. * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
  1243. * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
  1244. * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
  1245. */
  1246. public function terminate_workflow_execution($opt = null)
  1247. {
  1248. if (!$opt) $opt = array();
  1249. $opt = json_encode($opt);
  1250. return $this->authenticate('TerminateWorkflowExecution', $opt);
  1251. }
  1252. }
  1253. /*%******************************************************************************************%*/
  1254. // EXCEPTIONS
  1255. class SWF_Exception extends Exception {}