CastNode extends ActivityNode, DataFlowEdgeDestination, DataFlowEdgesSource

Allows one data type to be cast to another data type. Has an outgoing "check" DataFlowEdge which can be used to check for invalid casts, otherwise a failing conversion is silent.

A ActivityOperation may contain any number of CastNode data flow nodes. A CastNode must have exactly one incoming DataFlowEdge, representing the source value and type. A CastNode must also have exactly one outgoing DataFlowEdge to another data flow node, representing the target value and type.

A CastNode may have additional outgoing DataFlowEdges. If an outgoing DataFlowEdge is connected to a DecisionNode named "can cast?", then the value of this DataFlowEdge represents whether the incoming source value to the CastNode can be successfully cast to the target type. All other outgoing DataFlowEdges represent the forcibly cast value of the incoming source value to the target type; a forcibly cast value will not display an error message if the cast was not possible.

A "successful" cast is one where the source can be converted successfully with no loss of information. So, for example, the String "123" can be successfully cast to an Integer, but "123.4" cannot. However, this failure can be discarded if loss of information is acceptable; for example, "123.4" forcibly cast to an Integer will return "123".

List of possible casts, ignoring identical types:

Source type Target type Successful Cast
iamlInteger iamlString Yes 123 is converted into "123".
iamlDateTime iamlString Yes Date is converted into RFC 2822, for example Thu, 21 Dec 2000 16:01:07 +0200.
iamlEmail iamlString Yes test@openiaml.org is converted into "test@openiaml.org".
iamlString iamlEmail If string matches an e-mail regexp. or is empty "". Will be converted at best as it can into an e-mail address, or "" if it cannot be converted.
iamlString iamlDateTime If PHP's strtotime() method does not return false. The result of PHP's strtotime() method, or the UNIX epoch otherwise. [note]
iamlString iamlInteger Only successful if the source string matches the regular expression ^[0-9]*$ [note]. An empty string is cast to 0. Follows the semantics of PHP's intval() function.
iamlInteger iamlDateTime Yes. The integer represents the time measured in the number of seconds since the Unix Epoch (i.e. a timestamp) [note]. Can be negative.
iamlDateTime iamlInteger Only successful if the date is between December 13, 1901 20:45:52 GMT and January 19, 2038 03:14:07 GMT, inclusive. The integer represents the time measured in the number of seconds since the Unix Epoch (i.e. a timestamp) [note].

Notes

[CastNode.html]

Examples

Inference Rules

(none)

Constraints

Attributes

(none)

Inherited Attributes

Children

(none)

Inherited Children

(none)

References

(none)

Inherited References

Extensions

(none)

Inherited Extensions